Adding chef cookbooks from github

佐手、 提交于 2019-12-04 17:00:35

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!