[chef] Re: Idioms: role run_list+attributes vs role-specific recipe?


Chronological Thread 
  • From: Peter Donald < >
  • To:
  • Subject: [chef] Re: Idioms: role run_list+attributes vs role-specific recipe?
  • Date: Wed, 1 Aug 2012 07:51:05 +1000

Hi,

On Wed, Aug 1, 2012 at 3:23 AM, Jay Levitt < " target="_blank"> > wrote:
Does anyone have a good philosophy or idiomatic advice as to what goes where?  So far, I'm thinking:

- There are some cookbooks that are controlled purely through node/role attributes. I'm not sure it's kosher to set those from my own recipe.
- If it's not kosher, I've now arbitrarily split up cookbooks based on their API. That feels icky.
- OTOH, for cookbooks with LWRPs, I do like the idea of keeping the attributes near the provider call; in the sudo example, I was actually using the run_list+attribute syntax, and when I moved the recipe to a different role, I forgot to move the attributes with it.
- On the gripping hand, the second syntax means that I have not only a run_list per role, but a recipe per role.  That doesn't seem DRY.

We started with putting most configuration on the role. However this got harder over time as attribute data differed between environments or we wanted to started to synthesise attribute configuration data. It got even harder when we moved to an "attribute_driven" [1] approach. So now we mostly have a "policy" cookbook in which we do all the configuration and then include the appropriate worker cookbooks. Not all of our roles have a 1-to-1 relationship with a cookbook/recipe but most of the complex/bespoke/customized roles do. As always YMMV



--
Cheers,

Peter Donald



Archive powered by MHonArc 2.6.16.

§