[chef] Re: Re: Re: Re: Re: More on Cookbook Design Patterns


Chronological Thread 
  • From: Jay Perry < >
  • To: Lamont Granquist < >
  • Cc: Tom Duffield < >, " " < >
  • Subject: [chef] Re: Re: Re: Re: Re: More on Cookbook Design Patterns
  • Date: Thu, 3 Apr 2014 14:48:08 -0400

Tom/Lamont,
Both of your recommendations are very helpful which I think will help give us a baseline of where we want our cookbooks to go.  We have our work cut out for us but I think it's necessary for us to get to be more flexible with the size of our organization.

@Lamont - Just to clarify when you state "your base role" I think you mean "base" cookbook right?  I picture all my application cookbooks including the "base" cookbook using 'include_recipe' considering when I'm doing testing with test kitchen I don't have to worry about using a role and just calling the recipe will include/configure the necessary pieces (dns, ldap, yum, apt, etc).  The application cookbook would have a depends on the base cookbook via the metadata.rb.

One more thing where would you guys see the decision making happen for deciding what recipes to run based on platform?  Say for example configuring yum or apt with our repository endpoints.  I was thinking of creating a cookbook called "platform" and this would include an acme_yum or acme_apt based on what platform the node is running under.  Is this too much abstraction or would you just create a base::platform and move the decision making there?

Thanks,
Jay




On Thu, Apr 3, 2014 at 1:04 PM, Lamont Granquist < " target="_blank"> > wrote:
On Thu Apr  3 08:33:44 2014, Tom Duffield wrote:
In your acme_tomcat cookbook you could have a recipes that handle
Acme, Co specific tomcat user implementation (acme_tomcat::users),
security (acme_tomcat::security), or monitoring
(acme_tomcat::monitoring).

yeah, i do like this model.

then your base role includes the appropriate recipes to give you LWRPs for adding users and setting up monitoring, and you get good locality so that your tomcat config isn't scattered across separate security, monitoring and users cookbooks.  its appropriate to extract this stuff because its just not base role stuff, its all about what it means to be a generic tomcat server in your infrastructure.  ideally acme_tomcat would then expose LWRPs that you'd then use in recipes for application instances.







Archive powered by MHonArc 2.6.16.

§