- From: Brad Knowles <
>
- To:
- Cc: Brad Knowles <
>
- Subject: [chef] Re: Multiple versions of same cookbook in one chef git repo
- Date: Thu, 15 Aug 2013 10:04:39 -0500
On Aug 15, 2013, at 6:31 AM, "Kadel-Garcia, Nico"
<
>
wrote:
>
I’d love to be able to use cookbook versions, specified for each
>
environment as needed, to load or change the version of the cookbook. So
>
“example” cookbook 1.0.0 gets loaded on most hosts, for example, but on
>
testing hosts for the same server “example” cookbook “0.0.9” is specified
>
and used. The difficulty is being able to record and load the distinct
>
cookbooks from the same working git repository. If I try publishing them as
>
“cookbooks/example-0.0.9” and “cookbooks/example-0.1.0”, they get uploaded
>
as “example-0.0.9”, with version “0.0.9”, and that breaks things seriously.
>
>
Does anyone know how to publish and automatically upload distinct versions
>
cookbooks of the same name in a working chef server environment, under git?
What you describe should "just work" by pinning versions in your environments
or roles, and then uploading whatever versions are appropriate with "knife
cookbook upload". The chef-server will keep track of what versions of the
cookbook have been uploaded, and which versions are associated with which
environments and roles.
The only way that git factors into this equation is as the basic source code
management system, and you update versions of the cookbook as specified in
metadata.rb, check that code into git, and then upload that to the server.
IMO, the "spork" plugin for knife makes this kind of workflow a lot easier --
it can automate the git commit, the knife cookbook upload, etc.... It might
even be able to auto-increment cookbook versions, but I'm not sure about that.
--
Brad Knowles
<
>
LinkedIn Profile: <
http://tinyurl.com/y8kpxu>
Archive powered by MHonArc 2.6.16.