Search code examples
chef-infraknife

Use knife to create a new recipe in a cookbook


I've used knife solo to create a new folder and a cookbook with a default recipe using a custom template defined by .chef/knife.rb. My question is what command do I use for knife to create new recipes with that template instead of using cp?

Something like knife cookbook addrecipe somerecipe


Solution

  • once you have the cookbook created, then there will be recipe folder inside the cookbook . you can go on writing as many recipes as you want inside the recipes folder. AFAIK, knife cookbook does not provide any option for creating a new recipe. check knife cookbook --help