Is there a command to delete a recipe?


#1

There is ‘chef generate recipe’. Is there a command to delete a recipe? If not, what files need to be deleted manually to completely remove a recipe from a cookbook?


#2

they’re just files on the computer. Just delete the files or the recipe etc.

if you use source control just use a rm command in your SCM such as ‘git rm’


#3

You just need to remove the recipe.rb

Be aware that if you’re using that recipe elsewhere in an "include_recipe"
that will fail once the recipe file is deleted.


#4

I see 2 folders, recipes/ and spec/unit/recipes/, where I need to delete files related to a recipe. A chef delete recipe or knife recipe delete command would make this a little easier.


#5

When chef generate recipe name command is used to create a recipe, there are 3 files created and updated in the below folders. Manually deleting them will remove suffice but make sure that particular recipe isn't included in other recipes.

  1. /test/integration/default/name.rb
  2. /spec/unit/recipes/name.rb
  3. /recipes/name.rb