Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default search path for cookbook

I am a chef Newbie and facing an issue.

Every time I run any of the knife cookbook command, I have to explicitly provide the path to cookbook using -o /path/to/cookbook else it will error out saying no cookbooks found. Please find below commands:

$ knife cookbook upload getting-started ERROR: Could not find cookbook getting-started in your cookbook path, skipping it ERROR: Failed to upload 1 cookbook.  $ knife cookbook upload getting-started  -o /home/chefuser/chef11/chef-repo/cookbooks/ Uploading getting-started [0.4.0] Uploaded 1 cookbook. 

Question:

I want to know/list the default search path for cookbooks and need to know how to modify it.

Also, why it is not looking at cookbook path and I have to provide it explicitly?

Thanks.

like image 507
slayedbylucifer Avatar asked Jun 28 '13 10:06

slayedbylucifer


People also ask

Where are your cookbooks stored in Chef server?

It is stored in bookshelf directory , which can be modified and the files regarding the cookbook are located at /var/opt/chef-server/bookshelf/data/bookshelf . In that directory u can find all the cookbooks uploaded and also you can view the recipes .

How do I push cookbook to Chef server?

To upload a specific cookbook, go to the chef-repo directory, specify the cookbook name along with the cookbook directory as shown below. This will upload prod-db cookbook from local machine to the Chef Server. Please note that this will do the upload only if anything is changed in the cookbook locally.

How do I delete a workstation cookbook?

You can just delete the folder that was created, however you'd like. For example, rm -rf site-cookbooks/ruby .


1 Answers

Default cookbook path could be set in ~/.chef/knife.rb:

... cookbook_path [ '~/cookbooks/', '~/base-cookbooks/'] ... 

Also, you could find knife.rb documentation useful.

like image 141
ДМИТРИЙ МАЛИКОВ Avatar answered Sep 23 '22 13:09

ДМИТРИЙ МАЛИКОВ