Chef Cookbook Pinning


#1

Hi

We are looking to version control cookbook releases through pinning against these org environments. We have 4 different orgs and each or has a dev, uat and prod environment against these.

Would anyone have any practical examples of implementing cookbook versioning pinning against environments?

Thanks


#2

I am not really sure what you mean. You can simply pin cookbook versions in an environment JSON file and then upload it via knife [1]. Uploading it do different organizations just means calling knife 3 times.
And of course you can (and in my eyes should) alternatively use Berkshelf to collect all dependent cookbook versions and apply [2] them to an environment. This approach does not tackle environment attributes if done correctly [3].

[1] https://docs.chef.io/environments.html
[2] https://docs.chef.io/berkshelf.html#berks-apply
[3] https://github.com/berkshelf/berkshelf/issues/846


#3

Hi Joerg

Thanks for your reply and the links. What we are trying to achieve is to implement automatic cookbook version pinning based on Chef Automate outcome. We have dev, prod and uat environments here for a group of orgs and and we need to look into pinning the specific versions of the cookbooks to these orgs.

Thanks


#4

Oh, this is about Automate or specifically workflow. Sorry, but I have never used this. But maybe you will find some hints and help in the deliver-sugar cookbook. https://github.com/chef-cookbooks/delivery-sugar