I've downloaded a number of cookbooks from the opscode site using the command: knife cookbook site install git for example. However now I would like to download a cookbook from a repository on github into my current cookbooks directory. How should I go about doing this? should I just clone the repository into my cookbooks directory?
Thank you!
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.
Cookbooks are fundamental working units of Chef, which consists of all the details related to working units, having the capability to modify configuration and the state of any system configured as a node on Chef infrastructure. Cookbooks can perform multiple tasks.
To download and manage cookbooks, you could use Berkshelf which comes with a way in itself to manage the cookbook dependencies by itself. If you are familiar with Ruby, it works like Gemfile. You could download cookbooks from github by adding this command in your BerksFile
cookbook 'nginx' , path : ' github url for cookbook'
You coould install the knife github plugin from https://github.com/websterclay/knife-github-cookbooks, after which you could simply use knife cookbook github install cookbooks/yum
to install yum from https://github.com/cookbooks/yum.
However, I would suggest using Librarian-Chef from https://github.com/applicationsonline/librarian, it works pretty much like bundler does for ruby gems (if you're familiar with that).
Edit: Since this apparently still receives views, I would be remiss not to mention berkshelf, which is amazing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With