[chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: run_context.include_recipe in a recipe within a role


Chronological Thread 
  • From: Peter Donald < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: run_context.include_recipe in a recipe within a role
  • Date: Thu, 30 May 2013 20:54:40 +1000

Hi,

On Thu, May 30, 2013 at 8:43 AM, Daniel DeLeo 
< >
 wrote:
> Bringing this back to the OP's issue, I think including a recipe (the normal
> way) to install prerequisites of a LWRP is the right way to go about it. If
> you are doing wizardry with chef internals, either 1) you're making
> something more complicated than it should be, 2) chef is making something
> more complicated than it should be, or 3) you're a wizard. So far, I'm
> inclined to think that including recipes from a provider falls into category
> #1, since you can just as easily and elegantly solve the problem with a role
> (or role cookbook if that's your thing). Am I missing something?

I think it is more useful to see it as a failure of chef rather than a
failure of the user. i.e. Option 2.

In my mind LWRPs  are a mechanism for creating composable
abstractions. Anything you can do in a recipe should be possible to do
in a LWRP. Where this is not true I would consider it a bug.

For this specific scenario I can easily see a use for it. In our
environment, many of our recipes are data driven. Data is collected
from search + rules + external systems (ldap/db etc) and then this is
interpreted and resources defined based on the data. So often we will
not know which LWRPs will be active (and thus which precursor recipes
should be included) until the data is interpreted.

That said I thought include_recipe worked from within LWRPs...


-- 
Cheers,

Peter Donald



Archive powered by MHonArc 2.6.16.

§