In case it helps anyone, here is a test using chef-solo that shows
that the name in metadata.rb is not used by chef-solo, as opposed to
the name of the cookbook folder. This is true also for naming
dependencies, use the cookbook root folder and not the name in
This seems to contradict the specs.
[root@localhost cookbooks]# chef-solo --version
[root@localhost cookbooks]# ls -l | grep test
drwxr-xr-x 7 root root 4096 Oct 22 04:55 test_compliance
[root@localhost cookbooks]# cat test_compliance/metadata.rb
[root@localhost cookbooks]# chef-solo -o fake_name::echo
Starting Chef Client, version 11.4.4
[2013-10-22T04:58:39+00:00] WARN: Run List override has been provided.
[2013-10-22T04:58:39+00:00] WARN: Original Run List: 
[2013-10-22T04:58:39+00:00] WARN: Overridden Run List: [recipe[fake_name::echo]]
[2013-10-22T04:58:39+00:00] ERROR: Running exception handlers
[2013-10-22T04:58:39+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated
[2013-10-22T04:58:39+00:00] FATAL: Stacktrace dumped to
[2013-10-22T04:58:39+00:00] FATAL: Chef::Exceptions::CookbookNotFound:
Cookbook fake_name not found. If you’re loading fake_name from another
cookbook, make sure you configure the dependency in your metadata
On Tue, Oct 15, 2013 at 2:06 PM, Lucian Ciufudean
Thanks, I asked this because I’m seeing all kinds of community
content. For example cookbook ‘subversion’ got a name attribute in
metadata.rb only 11 months ago.
On Fri, Oct 11, 2013 at 11:04 PM, steve . email@example.com wrote:
metadata.rb is definitely required.
In fact, I believe the cookbook name in metadata.rb is actually honored over
the directory name…
On Fri, Oct 11, 2013 at 8:08 AM, Andrew Gross firstname.lastname@example.org wrote:
Assume metadata.rb is required. I am not 100% sure if Chef can operate
without one in the cookbook, but you should set up a commit hook so that it
forces the metadata.rb file to exist.
The name is metadata.rb is respected. All dependency resolvers should
unpack the cookbooks and parse the metadata file to find the name.
For an example check out “cookbook-elasticsearch”.
The name in metadata.rb is “elasticsearch” and that is how it is referred
On Fri, Oct 11, 2013 at 9:50 AM, Lucian Ciufudean
A have a couple of questions in this area:
- Is the metadata.rb file mandatory in a cookbook?
- if metadata.rb is present, and it specifies a different name than
the cookbook archive filename, which is the name considered by
cookbook dependency resolution alg during a chef-run?