Information Technology Reference
In-Depth Information
env_run_lists:
json_class: Chef::Role
name: webserver
override_attributes:
run_list:
recipe[motd]
recipe[users]
recipe[apache]
You can reset a node's run list with the knife node set command. Change the run list of
the snowman node to use the webserver role you just created, using the following command
on Linux/Mac OS X:
$ knife node run_list set snowman "role[webserver]"
snowman:
run_list: role[webserver]
or, on Windows:
$ knife node run_list set snowman "'role[webserver]'"
snowman:
run_list: role[webserver]
During the Chef run, the reference to the web server role will be expanded to the entries in
the role's run list:
▪ recipe[motd]
▪ recipe[users]
▪ recipe[apache]
Roles are a powerful abstraction that let you think of your infrastructure as arrays of func-
tionality. It is quite common for a role to contain dozens of recipes. Imagine needing to as-
sign dozens of recipes to the run list of, say, hundreds of nodes. Roles make this process
much easier.
Search WWH ::




Custom Search