- From: AJ Christensen <
>
- To: chef <
>
- Subject: [chef] Re: Re: Injecting a resource into another cookbook's recipe
- Date: Tue, 16 Apr 2013 07:41:18 +1200
A member of Heavy Water Operations (Chris Roberts, spox) just build a
system that allows arbitrary injection of resources at any time in the
recipe life cycle. Chris had noticed a pattern used like this in the
AWS OpsWorks tool and set out to re-implement.
Check it out. I'll endeavor to pass any feedback his way. [0]
Cheers,
AJ
[0]
https://github.com/hw-cookbooks/injector
On 16 April 2013 06:43, steve .
<
>
wrote:
>
I've run defines and used LWRPs in other recipes -- seems to work, as long
>
as the defining cookbook is loaded up earlier in the run list. However, I
>
don't like the idea of leaving it up to the user to figure out whether or
>
not they need to add some_random_cookbook to a run list, so I've adopted the
>
pattern of "include_recipe 'some_random_cookbook::default'" and simply not
>
putting anything of substance in a default recipe that isn't required across
>
the entire cookbook.
>
>
>
On Thu, Apr 11, 2013 at 12:07 PM, Kevin Nuckolls
>
<
>
>
wrote:
>
>
>
> Since it's ruby, I assume it's possible to have a resource run within
>
> another scope as defined at runtime. I basically ran into a situation where
>
> I defined a variable that I used to inject information in a template in a
>
> library cookbook, then found that I also wanted access to that variable
>
> from
>
> the wrapper cookbook.
>
>
>
> I could probably put it in a library, but at this point I'm just curious
>
> if anyone has done this. Can you run a resource in another cookbook's
>
> recipe
>
> if you even wanted to?
>
>
>
> Not saying this is the correct way to do it, just curious if it's actually
>
> possible.
>
>
>
> -Kevin
>
>
Archive powered by MHonArc 2.6.16.