[[chef-dev]] Re: [[chef-dev]] Changes to Opscode Cookbook attributes

Chronological Thread 
  • From: Paul Choi < >
  • To:
  • Subject: [[chef-dev]] Re: [[chef-dev]] Changes to Opscode Cookbook attributes
  • Date: Mon, 12 Jul 2010 10:14:07 -0700
  • Organization: Plaxo, Inc.


Thanks for updating the wiki page on attributes! Actually, I was trying to figure out how attributes work last week (the only way to change the default attributes for a running host was to enter changes in 'override'...). I guess 'default' is set once a chef-client starts running and any changes to 'default' is ignored?

I think the wiki page update certainly helps. Maybe a "best practices" doc on when to use overrides, how to change attributes for a currently-running client, etc. would be helpful. Since Chef is so flexible I figure there's lots of different ways to do things, and I'd love to hear more of the wisdom of the community.


Speaking of attributes and 'default' level vs. 'override' and others, is there an

On 7/10/10 8:39 PM, Joshua Timberman wrote:

I have updated all the Opscode cookbooks attributes files to use 'default' 
instead of 'set_unless'. This coincides with the CHEF-838 ticket, which 
changes the way that attributes are applied to the system. If you are not 
using Chef 0.9 yet, this is a semantic change and you likely won't see any 
difference, as the 'default' method for assigning attributes is a method 
alias for 'set_unless' in the Chef Node object.

If you are using Chef 0.9, please note that the 'default' is functionally 
different than 'set_unless'. The 'default' method will set the attribute at 
the default level in the Node's attributes. The 'set_unless' method will set 
the attribute at the normal level in the Node's attributes unless the 
attribute already exists (whether in normal, default or override).

This change in the cookbooks makes them more consistent with the way that 
these attributes are intended to be used. You can download new cookbooks from 
the site with knife:

knife cookbook site vendor COOKBOOK

Or if you're using the github repository directly, you can update to the 
latest revision from opscode/master.

Let us know if you have any questions!

Archive powered by MHonArc 2.6.16.