Changes to Opscode Cookbook attributes


#1

Ohai!

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!


Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.334.RUBY E: joshua@opscode.com


#2

I’ve been updating the wiki page for attributes:
http://wiki.opscode.com/display/chef/Attributes Let me know if you see
something wrong or unclear.

Also, if you’re using 0.9, you might want to clear out any attributes
that were set on your nodes by the older versions of the cookbooks in
order to get the full benefit of the upgrade. There’s no “penalty” for
not doing this–things will keep working as they did under chef
0.8–you just won’t see the benefits of the CHEF-838 fix until you do
so.

Thanks,
Dan DeLeo

On Sat, Jul 10, 2010 at 8:39 PM, Joshua Timberman joshua@opscode.com wrote:

Ohai!

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!


Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.334.RUBY E: joshua@opscode.com


#3

Joshua,

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.

-Paul

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

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

Ohai!

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!