Skip to content

Commit

Permalink
update readmes for info on cookbook_path and knife locations
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Oct 23, 2010
1 parent b60986b commit e7ca82d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -58,6 +58,8 @@ If you use the `ssl_cert` task, change the values in the `config/rake.rb` file a

The second config file, `.chef/knife.rb` is a repository specific configuration file for knife. If you're using the Opscode Platform, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.

http://help.opscode.com/faqs/chefbasics/knife

Next Steps
==========

Expand Down
13 changes: 12 additions & 1 deletion cookbooks/README.md
@@ -1,6 +1,17 @@
This directory contains the cookbooks used to configure systems in your infrastructure with Chef.

Configure knife to use your preferred copyright holder, email contact and license. Add the following lines to `~/chef-repo/.chef/knife.rb`.
Knife needs to be configured to know where the cookbooks are located with the `cookbook_path` setting. If this is not set, then several cookbook operations will fail to work properly.

cookbook_path ["./cookbooks"]

This setting tells knife to look for the cookbooks directory in the present working directory. This means the knife cookbook subcommands need to be run in the `chef-repo` directory itself. To make sure that the cookbooks can be found elsewhere inside the repository, use an absolute path. This is a Ruby file, so something like the following can be used:

current_dir = File.dirname(__FILE__)
cookbook_path ["#{current_dir}/../cookbooks"]

Which will set `current_dir` to the location of the knife.rb file itself (e.g. `~/chef-repo/.chef/knife.rb`).

Configure knife to use your preferred copyright holder, email contact and license. Add the following lines to `.chef/knife.rb`.

cookbook_copyright "Example, Com."
cookbook_email "cookbooks@example.com"
Expand Down

0 comments on commit e7ca82d

Please sign in to comment.