Chef Infra Client uses six types of attributes to determine the value that’s applied to a node during a Chef Infra Client run. In addition, Chef Infra Client gathers attribute values from up to five locations. The combination of attribute types and sources makes up to 15 different competing values available during a Chef Infra Client run.
The attribute types are:
defaultattribute is automatically reset at the start of every Chef Infra Client run and has the lowest attribute precedence. Use
defaultattributes as often as possible in cookbooks.
- Use the force_default attribute to ensure that an attribute defined in a cookbook (by an attribute file or by a recipe) takes precedence over a default attribute set by a role or an environment.
normalattribute is a setting that persists in the node object. A
normalattribute has a higher attribute precedence than a
overrideattribute is automatically reset at the start of every Chef Infra Client run and has a higher attribute precedence than
overrideattribute is most often specified in a recipe, but can be specified in an attribute file, for a role, and/or for an environment. A cookbook should be authored so that it uses
overrideattributes only when required.
- Use the force_override attribute to ensure that an attribute defined in a cookbook (by an attribute file or by a recipe) takes precedence over an override attribute set by a role or an environment.
automaticattribute contains data that is identified by Ohai at the beginning of every Chef Infra Client run. An
automaticattribute cannot be modified and always has the highest attribute precedence.