[chef] Re: Re: Role Versioning?


Chronological Thread 
  • From: Senthilvel Rangaswamy < >
  • To:
  • Subject: [chef] Re: Re: Role Versioning?
  • Date: Thu, 14 Feb 2013 08:54:21 -0800

Can we do that in chef 10.x or is it only possible in chef 11.x.


On Thu, Feb 14, 2013 at 5:40 AM, Michael Glenney < " target="_blank"> > wrote:
We accomplish this with what we call "top level" cookbooks (TLC) (I know, lame name).  I was against them at first but it's working out.  We lock down cookbook dependencies with "depends" in metadata.rb.  The cookbooks themselves use the "pessimistic" approach to versioning so it's not so restrictive when developing.

So our tlc_tomcat cookbook would have the following in metadata.rb:

name "tlc_tomcat"
version "1.1.0"
depends "base", "= 1.0.6"
depends "os_patch, "= 1.1.2"
depends "auditing", "= 0.3.3"
depends "security", "= 0.1.1"
depends "backups", "= 0.2.5"
depends "splunkagent", "= 0.4.5"
depends "java", "= 1.0.4"
depends "newrelic", "= 1.0.5"
depends "tomcat", "= 1.0.3"

and then the default recipe of the TLC installs them in the order we want with "include_recipe" statements.  This way, will always install the exact same versions of cookbooks.  I mentioned the pessimistic versioning above because we made the mistake of being rigid with versioning within the lower level cookbooks as well and it made development a PITA.  As an example, here's the metadata.rb of the cookbook in the TLC above:

name "tomcat"
version "1.0.3"
depends  "java", "~> 1.0.3"
depends  "os_patch", "~> 1.1.2"
depends  "newrelic", "~> 1.0.2"

We haven't used roles since we started with this approach and we haven't missed them.

MG


On Thu, Feb 14, 2013 at 5:09 AM, Torben Knerr < " target="_blank"> > wrote:
Hey guys,

there was a recent discussion about "role cookbooks" in IRC where @threescoops posted a link to the wiki where versioning for roles is mentioned as a proposal:


Just wanted to throw in my 5 cents and continue discussion here:

[12:56] <tknerr> zts, threescoops: i would be happy as well if:
[12:56] <tknerr> zts, threescoops: roles could be versioned
[12:56] <tknerr> zts, threescoops: and i could define cookbook version constraints in the roles (want to lock down transitive cookbook dependencies as well)
[12:56] <tknerr> zts, threescoops: and in the environments i would specify the role versions rather than cookbook versions

Does that make any sense, or am I on the wrong path here?

Cheers, Torben






--
..Senthil

"If there's anything more important than my ego around, I want it
 caught and shot now."
                                                    - Douglas Adams.



Archive powered by MHonArc 2.6.16.

§