I have cookbook which contains a list of recipes. What is the command to add some specific recipes (not all) from cookbook using command line tool in chef knife?
I know the command to add the whole cookbook to run list which is knife node run_list add server name recipe[cookbook name].
So you have the right idea, knife node run_list add $nodename $item is the command you want.
recipe[mycookbook] doesn't add "the whole cookbook", instead that is just a shorthand for recipe[mycookbook::default], which in turn maps to mycookbook/recipes/default.rb. Similarly if you have mycookbook/recipes/foo.rb that would be recipe[mycookbook::foo].
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With