[chef] Re: 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: Dorian Jaminais < >
  • To: " " < >
  • Subject: [chef] Re: 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 14:22:12 +0200

Thank you all for your responses.

@peter : run_context.include_recipe works but only if the LWRP is called once in during the chef_run.

I have included a recipe that installs all the dependencies for the LWRP to work.
This works perfectly, even if still I don't understand why I had this strange behavior with run_context.include_recipe


2013/5/30 Peter Donald < " target="_blank"> >
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



--
Dorian JAMINAIS
System Administrator
+33 6 95 10 95 37






Archive powered by MHonArc 2.6.16.

§