Information Technology Reference
In-Depth Information
Chapter 8. Attributes
Attributes represent information about your node. In addition to the information that can be
automatically generated by
ohai
, you can set attributes in Chef recipes or in separate attrib-
ute files.
Attribute files are located in the
attributes
folder of a cookbook. Similar to recipes, the de-
fault attribute file is called:
<cookbook>
└── attributes
└── default.rb
Figure 8-1
shows the format of an attribute when it is specified in a cookbook attribute file.
Figure 8-1. Setting attributes in attribute files
Attributes can also be set directly in recipes.
Figure 8-2
shows the format of an attribute
when it is set in a recipe. You must precede the attribute name with
node.
when you set an
attribute directly in a recipe.