Chef - Attributes
27 Jan 2016guidelines for attributes
-
cookbooks must not require attributes to be set outside of the cookbook itself to function
-
override community cookbook attributes in wrapper cookbooks using
override
-
don’t store attributes in roles at all
-
store environment-specific attributes in environment files
-
don’t store attributes in recipes - keep them in attribute files: to initialize attributes in environment cookbooks or override attributes in wrapper cookbooks
-
use only default and override attributes in cookbooks and recipes
-
don’t use local variables inside attribute files - they are eagerly evaluated and some node attributes might be not available yet
-
prefer strings to symbols as attribute names, in any case don’t mix different notations