问题
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!
回答1:
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.
回答2:
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'
回答3:
You can Try this command
knife cookbook site download cookbookname
来源:https://stackoverflow.com/questions/11113224/adding-chef-cookbooks-from-github