At my day job, we’re having a discussion on the proper location for
attributes and it was suggested to ask the question on this list to see
what the community has to say.
The assertion initially made was to not use attributes at the Environment
level (since there’s one and only one Environment per node it is a limiting
place to put attributes). The questions that came up from this assertion
were as follows:
At what level should attributes be set?
At the file, role or node level?
Does it matter if we’re using default, normal/set or override for setting
the attributes (other than for precedence’s sake)?
Also, does the answer change depending on what the particular attribute
Is there a logical set of attributes that should be defaulted at the role
level and overridden at the file level?
Or is the usage wide open with the exception of using attributes at the
Looking at several cookbooks, it appears most cookbooks that have
attributes have “default” attributes (with exceptions being relatively old
ones). Also, role attributes tend to be “override” attributes. Is this
what can be considered “best practice”? Are there cases where this approach
is not the preferred approach?