Am a newbie to chef and trying out various options. If a use case is to add multiple nodes to a particular role what is the easiest way to do it?
For a single node, I would execute the following command from the chefdk (Work station).
knife node run_list add <host-name1> "role[httpd-role]"
(Have already created and uploaded recipes to chef-server and combined a few recipes to create the role 'httpd-role').
Assuming, I have many hosts names what is the easiest way to add the above role to all the nodes in the following scenario.
- When the host names have a fixed pattern with incremental numbers(fe1, fe2 etc...)
- When the host names doesn't have any fixed pattern(foo, bar, fooabcd, barabcd etc...)
At the end of this exercise, I would like to add the role 'httpd-role' to all the nodes and upon executing 'sudo chef-client' on all the nodes, I would expect to fetch all the latest policies and install them in the nodes.
Thanks In Advance