Chef plugin should allow setting chef environment and initial attributes

Bug #845208 reported by Avishai Ish-Shalom
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Avishai Ish-Shalom

Bug Description

Chef 0.10 introduced environments which are set in the chef-client config file. The chef plugin should allow specifying the environment in cloud-config.
Also, additional attributes can be specified in initial json - that too should be available via cloud-config.

Tags: chef

Related branches

Changed in cloud-init:
assignee: nobody → avishai (avishai-ish-shalom)
Changed in cloud-init:
status: New → Fix Committed
Scott Moser (smoser)
Changed in cloud-init:
status: Fix Committed → Triaged
Revision history for this message
Scott Moser (smoser) wrote :

Mike, avishai,
  Thanks to both of you for trying to get Chef in cloud-init working.
  It seems that the two of you have been working separately and in-parallel on the same set of issues.
   Avishai has a branch at lp:~avishai-ish-shalom/cloud-init/chef
   Mike has a branch at lp:~mmoulton/cloud-init/chef (merge proposal at [1])

  If the two of you can work together, I'd like to get functional cloud-init support for chef in today or tomorrow (US Eastern 'day'). I've only visually reviewed the changes, but it looks like Mike's branch is mostly functional, but I'd like to have the changes i requested made, and then a report that you're both in agreement on them and that they're functional.

  Again, I'm really interested in having this fixed in 11.10, but time is very short. Avishai, can you please test Mike's branch and comment on any issues you have with it?

--
[1] https://code.launchpad.net/~mmoulton/cloud-init/chef/+merge/74900

Revision history for this message
Mike Moulton (mmoulton) wrote :

Avishai,

I have committed Scott's requested changes to lp:~mmoulton/cloud-init/chef

When you have a moment, can you take a look and let me know if you have any problems with the changes and if they work for you.

I have validated this branch is working with Chef 0.10.x on Oneiric Beta 1 for both gem and package install types connecting to a Ops Code hosted Chef server.

Revision history for this message
Avishai Ish-Shalom (avishai-ish-shalom) wrote : Re: [Bug 845208] Re: Chef plugin should allow setting chef environment and initial attributes

Mike,

In general your version is ok, there's a small issue though: chef-client
is invoked without the -j parameter.
I've attached a patch to fix this as well as format the firstboot.json
using the json module (i think this is cleaner).

Please consider this patch and update the bug (and your branch) so it
can be merged promptly.

Thanks,
Avishai

On 12/09/11 20:49, Mike Moulton wrote:
> Avishai,
>
> I have committed Scott's requested changes to lp:~mmoulton/cloud-
> init/chef
>
> When you have a moment, can you take a look and let me know if you have
> any problems with the changes and if they work for you.
>
> I have validated this branch is working with Chef 0.10.x on Oneiric Beta
> 1 for both gem and package install types connecting to a Ops Code hosted
> Chef server.
>

Revision history for this message
Mike Moulton (mmoulton) wrote :

Thanks Avishai for taking a look. The head of my branch [1] has your json patch in it. That is a much better way to handle writing out the json.

Regarding the '-j' parameter, that is intentionally left off as I switched over to using the 'json_attribs' property in the client.rb due to the fact chef-client starts up automatically when installing from packages. Using the 'json_attribs' property lets me support both the gems and packages install types with the same approach.

[1] lp:~mmoulton/cloud-init/chef

Scott Moser (smoser)
Changed in cloud-init:
importance: Undecided → Medium
status: Triaged → Fix Committed
Scott Moser (smoser)
Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.