Search code examples
chef-infrachef-recipe

clarification on recipe names when including them in chef


I want some clarification when using include_recipe.

First of all am I correct in assuming that

include_recipe "cookbook-name::recipe"

is invalid because of - and that it should be a _.

Second of all where exactly is cookbook-name generated or set so I can change it.

I've looked but I can't find the answer in google and truth is I'm a bit tired (so I'm not firing on all cylinders) so I'm having a little trouble thinking of an answer to what's probably some simple questions.


Solution

  • First of all, your assumption is incorrect. It is possible to have a cookbook name with a - like cookbook-name.

    The cookbook name is defined in the metadata.rb file.

    Getting the aptcookbook as an example (https://github.com/opscode-cookbooks/apt), the cookbook name is defined here: https://github.com/opscode-cookbooks/apt/blob/master/metadata.rb#L1