Different types of attributes

Chef provides six different types of attributes, as listed in the following table:

Attribute type

Description

default

This attribute is reset upon the start of every chef-client run and has the lowest attribute precedence. A cookbook should make the most use of the default attributes.

force_default

Say you've specified the same default attribute in role and environment along with a cookbook, and you want to ensure that the attribute in the cookbook takes precedence. In order to do so, one must make use of the force_default attribute type.

normal

A normal attribute is never reset and persists with the node object. It has higher precedence over the default attribute.

override

An override attribute has higher ...

Get Mastering Chef now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.