Are there some good practices on using Chef with multiple sources?
Let’s assume I have the following setup:
- Private cookbooks repo
- apt v0.0.1
- apt v0.0.2
- Cookbook mycook depends on apt cookbook.
- Both apt v0.0.1 and v0.0.2 are already installed(as dependencies of some
other cookbooks) in ~/.berkshelf/cookbooks
In such setup
berks install from ‘mycoook’ cookbook will always be using
the highest available version found in ~/.berkshelf/cookbooks, in this case
it’s apt v0.0.2. It doesn’t care about the order of sources in Berksfile. I
understand why it happens but it doesn’t suit me.
To make Berkshelf using apt v.0.0.1 I can:
- remove apt 0.0.2 from ~/.berkshelf/cookbooks
berks vendorcookbook in dir other than ~/.berkshelf/cookbooks
- specify private source for ‘apt’ cookbook in Berksfile
- specify v0.0.1 version for ‘apt’ cookbook in Berksfile
Since I have a lot of private cookbooks intersecting with community’s
cookbooks specifying source or version in Berksfile for each dependent
cookbook is not a great idea.
Options 1 and 2 require extra actions instead of simple
Is there a better way of handling such workflow?