# Attributes order precedence

**URL:** <https://discourse.chef.io/t/attributes-order-precedence/1625>\
**Category:** Chef Infra (archive)\
**Created:** [November 22, 2010, 11:03am UTC](https://discourse.chef.io/t/attributes-order-precedence/1625 "2010-11-22T11:03:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Le\_Huy](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@Le\_Huy](https://discourse.chef.io/u/Le_Huy)\
**Post date:** [November 22, 2010, 11:03am UTC](https://discourse.chef.io/t/attributes-order-precedence/1625/1 "2010-11-22T11:03:46Z")

</div>

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](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.

* * *

## ATTENTION: The information in this electronic mail message is private and confidential, and only intended for the addresses. Should you receive this message by mistake, you are hereby notified that any disclosure, reproduction, distribution or use of this message is strictly prohibited. Please inform the sender by reply transmission and delete the message without copying or opening it.

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [November 22, 2010, 4:44pm UTC](https://discourse.chef.io/t/attributes-order-precedence/1625/2 "2010-11-22T16:44:15Z")

</div>

On Mon, Nov 22, 2010 at 3:03 AM, [le.huy@ingdirect.es](mailto:le.huy@ingdirect.es) wrote:

> 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"

If it's confusing, it should be fixed, but it's written the way that it is  
because attributes files and recipes are both parts of cookbooks, so it's  
less ambiguous to say "attributes file" and "recipe."

Dan DeLeo
