I have created a cookbook and I am using manage.chef.io to host and deploy it. I have hosted the cookbook in GitHub private repo.

Consider a scenario:
If I make some changes in the cookbook and knife cookbook upload it, but I forget to push it to Github.

How do I make sure that it does not happen? Not even by mistake. How do I make sure that any time everyone has the latest repo, and can't knife upload it otherwise. Just like you can't git push if you have not git pulled the changes.

My colleague pulls from GitHub but sees no change. Thus he makes his own changes and knife cookbook upload it. But he will replace my changes as he has an old version.

So what is the best practice to manage a cookbook among multiple DevOps ?

  • 1
    There is no such position as a DevOp ^^ :-p You want a CI/CD pipeline or Chef Automate to constraint your workflow a bit. I'll be presenting one at Cfgmgmtcamp, which will be open sourced in the next days (based on this cookbook). Be warned: It's couple of work, but you really have to invest that time. – StephenKing Jan 20 '17 at 6:53

The simplest approach is generally to make the push to the Chef Server be under the control of your CI service like Jenkins. That forces serialization around source control since no human has permissions to run cookbook uploads. You could also just make sure you communicate enough to avoid this, but that's a lot more error prone. Some Chef workflows around policy files don't have this issue by not using normal cookbook uploads at all.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.