I am having 2 cookbooks name as mycookbook and version 0.1.0 and 0.1.1 on chef server. Now I want to run only cookbook mycookbook version 0.1.1 using chef-client. How do I do this ?
Asked
Active
Viewed 2.7k times
2 Answers
35
Found the answer with some hit and try
Ran following command
chef-client -o "recipe[mycookbook@0.1.1]"
This will call mycookbook version 0.1.1
NOTE: Running chef-client with the -o parameter will permanently override the runlist for that node.
-
That command will replace your runlist with new one with only that one cookbook. To use some version for all runs, you can specify exact version of cookbook into environment and assign that environment to your node. – rastasheep Feb 09 '15 at 18:26
-
@rastasheep Yes, I wanted to run a specific cookbook out of a run-list and that's what my requirement was. I knew about environment configuration and cookbook version assignment too but was not a solution for this scenario (I don't have permissions to create new environment in chef server ). – Salim Feb 11 '15 at 05:13