Recipe DSL
About the Recipe DSL
The Recipe DSL is a Ruby DSL that is primarily used to declare resources from within a recipe. The Recipe DSL also helps ensure that recipes interact with nodes (and node properties) in the desired manner. Most of the methods in the Recipe DSL are used to find a specific parameter and then tell the chef-client what action(s) to take, based on whether that parameter is present on a node.
Because the Recipe DSL is a Ruby DSL, then anything that can be done using Ruby can also be done in a recipe, including if
and case
statements, using the include?
Ruby method, including recipes in recipes, and checking for dependencies.
Use Ruby
Common Ruby techniques can be used with the Recipe DSL methods.
if Statements
An if登录查看完整内容