title: Chef : How to add multiple nodes to a given role
body: <p>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?</p>
  
  <p>For a single node, I would execute the following command from the chefdk (Work station).</p>
  
  <p><code>knife node run_list add &lt;host-name1&gt; "role[httpd-role]"</code> (Have already created and uploaded recipes to chef-server and combined a few recipes to create the role 'httpd-role'). </p>
  
  <p>Assuming, I have many hosts names what is the easiest way to add the above role to all the nodes in the following scenario.</p>
  
  <ol>
  <li>When the host names have a fixed pattern with incremental numbers(fe1, fe2 etc...) </li>
  <li>When the host names doesn't have any fixed pattern(foo, bar, fooabcd, barabcd etc...)</li>
  </ol>
  
  <p>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.</p>
  
  <p>Thanks In Advance</p>