Anirudh Singh
Anirudh Singh

Reputation: 81

Updating a run list in chef using knife

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

Upvotes: 8

Views: 8630

Answers (1)

coderanger
coderanger

Reputation: 54267

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

Upvotes: 13

Related Questions