Pergunta

I'm trying to test a cookbook that depends on three other local cookbooks. My directory structure looks like this:

/cookbooks/
  cookbook_test/
    recipes 
    templates 
    metadata.rb
  cookbook_dep1/
  cookbook_dep2/
  cookbook_dep3/

My metadata file in the cookbook I'm trying to test (cookbook_test) simply has the other three cookbook dependencies mentioned like:

depends cookbook_dep1
depends cookbook_dep2
depends cookbook_dep3

However when running kitchen converge default-ubuntu-1204 I get the following:

[2014-03-03T18:05:13+00:00] ERROR: Cookbook cookbook_devp1 not found. If you're loading cookbook_devp1 from another cookbook, make sure you configure the dependency in your metadata       
[2014-03-03T18:05:13+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)       

The only thing I could find online is that I should be using berkshelf. Is there no other way of referencing local cookbooks with test-kitchen only ?

Foi útil?

Solução

You have to put the dependencies into a directory named "cookbooks" (or "site-cookbooks") in the same directory where .kitchen.yml is. Or use Berkshelf or Librarian-Chef.

You could also try to just symlink the parent directory into "./cookbooks", but not sure if that would cause infinite recursion for some command.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top