[chef] Re: Re: Re: Re: Recipe subset-ing


Chronological Thread 
  • From: andi abes < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Recipe subset-ing
  • Date: Thu, 11 Aug 2011 18:19:03 -0400

hmmm. why can't you control attributes in a role using git? Can't you save the role into a file and manipulate using knife?


On Thu, Aug 11, 2011 at 5:46 PM, Joaquin Casares < "> > wrote:
I went ahead and went with the precendence ordering.

I couldn't do the 'include_attribute' since the first script I ran need the X's attributes already, and it seemed like it would load Y's attributes as soon as it ran.

The idea of roles are great, but I really like being able to git control my attributes file which I can't do natively with the roles.

Thanks a lot for the suggestions though! I'll definitely keep them in mind as I work with Chef further.

Joaquin Casares
DataStax
Software Engineer/Support



On Thu, Aug 11, 2011 at 11:07 AM, andi abes < " target="_blank"> > wrote:
If you're combined set of code involves mostly collating multiple recipes from different cookbooks, you can just create a role, and provide override attributes in it:

given the precedence order (http://wiki.opscode.com/display/chef/Attributes#Attributes-Precedence) that might just do the trick.



On Thu, Aug 11, 2011 at 12:01 PM, Daniel DeLeo < " target="_blank"> > wrote:
On Wednesday, August 10, 2011 at 6:15 PM, Joaquin Casares wrote:
> Hello,
> I have cookbook X that calls many functions off of cookbook Y. But my attributes for cookbook X are a superset of cookbook Y's attributes and of the values that intersect some are different in cookbook X.
> How would I go about doing this correctly?
> Right now I call include_recipe "Y::recipe1" from "X::default", but it seems to overwrite all my X configs that intersect.
> Should I just change cookbook X to use override instead of default settings?
> Thanks for the help!
> Joaquin
If possible, you should structure your recipes and roles to avoid this situation entirely. If that's not an option, you can use `include_attribute` in an attributes file to force one attributes file to load before another.

--
Dan DeLeo







Archive powered by MHonArc 2.6.16.

§