chef-infrachef-solo

How can I run a cookbook with a specific version using chef-client?


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 ?


Solution

  • 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.