[chef] Re: Re: Re: Re: Re: Chained dependencies management


Chronological Thread 
  • From: Kevin Nuckolls < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Chained dependencies management
  • Date: Mon, 13 Aug 2012 13:11:03 -0500

>> Does that apply to internal cookbooks as well?  

In my opinion yes. I don't use include_recipe anywhere and I feel like I'm better for it. Everything's dependencies are encapsulated in roles.

On Sun, Aug 12, 2012 at 2:11 PM, Jay Levitt < " target="_blank"> > wrote:
Kevin Nuckolls wrote:
My opinion (and I don't know if it's a very popular one), is that
include_recipe is an anti-pattern when used between cookbooks. It deeply
couples the implementation details of two separate cookbooks. When using
open sourced cookbooks that use include_recipe, you often are required to
use the specific cookbooks that one was written against.

Does that apply to internal cookbooks as well?  I've found that I'm increasingly refactoring, say, role[base] into a single run-list item that calls recipe[mysite::role-base]. This lets me use the Ruby DSL, LWRPs, normal-level attributes, and anything other API the "real" cookbook provides.

I hate the un-DRYness of specifying both include_recipe('postgresql') in mysite/roles/role-base.rb and depends('postgresql') in mysite/metadata.rb, but the purely declarative role syntax just doesn't let me do a lot of things...

Jay




Archive powered by MHonArc 2.6.16.

§