intrepid_atom
intrepid_atom

Reputation: 37

How are chef cookbook versions mapped to application versions?

What are the general best practices around managing chef cookbook versions with respect to alignment to application versions that the cookbooks target to provision and configure?

If I am building my cookbooks for configuration automation of a specific application version - Do I need to bring some relevance of the application version into my cookbook version? If not, how are the cookbook versions associate with application versions?

Applications when upgraded, may include additional components or configuration changes that would need a change to existing cookbooks. Without a mechanism to map the cookbook versions to the application version, it would be a challenge to provision a given application version.

All ideas on how it is managed are appreciated?

Upvotes: 0

Views: 90

Answers (1)

kellyb
kellyb

Reputation: 1371

When we started our Chef journey we had similar concerns. Our applications are built via a Jenkins based pipeline where build numbers are assigned by Jenkins. In other words, we don't use SemVer for our apps. Moving to SemVer would be a very large effort for us. The chef cookbooks that deliver these apps and their hosting environment needed to have a clean an intuitive mapping for the reasons you pointed out. We found that managing cookbooks with a SemVer scheme and having the apps they deliver/configure use a non-SemVer scheme was confusing for our users. In an ideal world we'd move everything to SemVer, but we just not an option for us now. We decided to have our cookbooks going through the same Jenkins pipeline and be collocated with the app code and have the same automated process stamp the metadata.rb file w/ the Jenkins build number. The jury is still out on how well this will work long term, but we've been doing this for almost a year and despite some rough edges, it seems to be working fine.

I'm sharing our approach simply as a way to do this. I'm not sure I love it enough to advocate doing this as a general best practice, but I think it was the lesser of evils for us. If you decide to go down this path, take the time to understand how berks (or policyfiles) cookbook version resolution as well as Chef Server version resolution works - that will save you some pain making this work.

Upvotes: 0

Related Questions