Managing custom cookbooks in a chef repo

感情迁移 提交于 2019-12-13 04:39:37

问题


I was wondering how Chef users organize custom cookbooks with relation to the main Chef repository. I started a repository based on a blank Chef Repo, and then installed custom cookbooks into the chef repo (i.e. the cookbook code is managed in the chef repo codebase). It's becoming a bit unmanageable though - especially when we want to work on different versions of a cookbook, and I'm wondering if it makes more sense to create independent cookbook projects and then pull in the cookbooks with Berkshelf - what's recommended in terms of best practises and how are you doing it?


回答1:


Keeping cookbooks in a GIT chef repository doesn't scale well. I keep my cookbooks in an instance of Chef server, acting as a cookbook repository (I don't connect VMs to this chef server). It is designed to fulfil the same purpose as Nexus (or artifactory) in Java development, a place to hold my development dependencies.

When loading a new chef server I download my cookbook's dependencies using Berkshelf, referencing this chef server using an "chef_api" directive:

  • Provision developer environment with chef server and vagrant without registering node

This will all change with Berkshelf 3.0 (Just released). I want to check out berkshelf-api which I'm hoping will simplify my work-flow. Reportedly Berkshelf-api can serve up cookbooks from:

  • Community cookbook site
  • An instance of chef server (like I do)
  • Cookbooks stored on file-system (This might suit you better)

Hope this helps.



来源:https://stackoverflow.com/questions/23213039/managing-custom-cookbooks-in-a-chef-repo

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