edmamerto
edmamerto

Reputation: 8165

chef, Could not find cookbook in your cookbook path

in my chef-repo I added a cookbook

cookbooks/mycookbook

when i do

$ knife cookbook upload mycookbook 

I get

ERROR: Could not find cookbook php-1.3.1 in your cookbook path, skipping it
Uploaded 0 cookbooks.

What did I do wrong here

Upvotes: 2

Views: 1625

Answers (2)

Dexirian
Dexirian

Reputation: 575

To re-iterate on this answer, not only do you have to configure your cookbook location in your knife/config.rb file, you also have to make sure that your dependencies are present in the cookbooks folders.

For instance your error message is about a specific version of php. To make sure the php cookbook gets uploaded alongside your cookbook, you could run the following commands while inside your cookbook folder :

berks install
berks upload

This will ensure that all dependent cookbooks are uploaded alongside your main one. See example here :

Berks

Upvotes: 1

Mr.
Mr.

Reputation: 10122

A config.rb file is used to specify configuration details for knife, which is loaded every time the knife executable is run and is located by default at ~/.chef/config.rb (and if i am not mistaken, you can also place it within the your chef repository directory at .chef/config.rb).

make sure that you set cookbook_path in config.rb

cookbook_path

The Chef Infra Client sub-directory for storing cookbooks. This value can be a string or an array of file system locations, processed in the specified order. The last cookbook is considered to override local modifications. For example:

cookbook_path [
  '/var/chef/cookbooks',
  '/var/chef/site-cookbooks'
]

Upvotes: 2

Related Questions