Setting Attributes
Work in progress
Environments attributes are only going to be available in Chef 0.10.0 or above.
Attributes may be set on the node, in order of precedence, from the following objects
- cookbooks
- environments (Chef 0.10.0 or above only)
- roles
- nodes
Combining the precedence and the places where attributes can be set, we derive this chart:
Attributes File Role Environment Recipe
Default 1 2 n/a 3
Normal 4 n/a n/a 5
Override 6 7 8 9
default attributes applied in an attributes file have the lowest priority and override attributes applied on a node directly in a recipe have the highest priority. Again, the exception to this are automatic attributes, as these are regenerated by Ohai http://wiki.opscode.com/display/chef/Ohai every time Chef runs.
I think that there is a mistake and confusion in the wiki about order precedence of attributes
The last column of the chart above should be “Node” not “Recipe” while the first column should be “Cookbook”
Huy Le
Tecnología ING DIRECT
Administrador de sistema
Tel: +34 91 206 76 85
Por favor, no imprima este correo si no es necesario.