- From: Andrea Campi <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Include a Recipe in a Provider
- Date: Thu, 29 Dec 2011 23:44:13 +0100
On Thu, Dec 29, 2011 at 11:13 PM, AJ Christensen
<
>
wrote:
>
On 30 December 2011 11:11, Andrea Campi
>
<
>
>
wrote:
>
> On Thu, Dec 29, 2011 at 8:31 PM, Joshua Timberman
>
> <
>
>
> wrote:
>
>> Hello,
>
>>
>
>> On Dec 29, 2011, at 12:04 PM,
>
>> <
>
>
>> wrote:
>
>>
>
>>> Is it possible to include a recipe in a provider? I have tried using the
>
>>> include_recipe function both inside the action definition and outside
>
>>> but it
>
>>> doesn't seem to be available that way.
>
>>
>
>>
>
>> No, include_recipe isn't available in cookbook providers/ directories.
>
>
>
> Actually, there is a way:
>
>
>
> action :create do
>
> run_context.include_recipe "apache2"
>
>
Does this include the recipe in the outer node context, or the new
>
context defined in the LWRP? I had some trouble with this WRT
>
MiniTest, ended up using compile time resources for everything.
Good question, and I'm puzzled: does a new LWRP create a new context?
I would have thought no—if for no other reason, because IIRC a
"sub-run context" cannot notify an "external" run context, and I'm
pretty sure I do.
Anyway, my fork of the application cookbook
(
https://github.com/zephirworks/cookbooks/tree/COOK-634) does exactly
this, and we've been running it in production for months now with no
ill effect.
Granted, MiniTest is probably doing trickier stuff…
Andrea
Archive powered by MHonArc 2.6.16.