2

I am new to Chef and have experience in Puppet Enterprise. With Puppet the node classification was easy and straight forward from the puppet console where you can classify nodes into different node groups and tie up classes.

Does enterprise chef console provide such functionality similar to Puppet? So far what i have learnt is that it can only be achieved using roles and environments in Chef.

But if that is the case than defining each and every node under roles is going to be a big manual effort for big environments. Let me know if I am looking in the right direction and not missing any important points.

Saboo
  • 161
  • 1
  • 1
  • 5

1 Answers1

0

I never used Puppet and Enterprise Chef (what am I doing here then?!), so I cannot be sure I am answering the right question. As I understand you would like to (in Chef terminology) assign roles to group of nodes at the same time.

I use open-source Chef Server and I would approach this problem the following way.

There is a knife command line tool in Chef and you can set run list of the node through it. I would write a small bash script like that:

run_list="cb1::recipe1,cb2::recipe2,role1,role2"
nodes="node1 node2 node3 node4"
for node in $nodes do
  knife node run_list set $node $run_list
done

This will overwrite run lists of the nodes and set to the new value. You can also use add and remove instead of set in knife command, if you do not want to change the whole run_list, but just manipulate parts of it.

Draco Ater
  • 20,820
  • 8
  • 62
  • 86