[chef] Re: Re: after_created in LWRPs


Chronological Thread 
  • From: Peter Donald < >
  • To:
  • Subject: [chef] Re: Re: after_created in LWRPs
  • Date: Tue, 7 May 2013 14:35:44 +1000

Hi,

On Mon, May 6, 2013 at 1:53 AM, Daniel DeLeo 
< >
 wrote:
> I'd advise not to rely on callbacks and side-effects like this. Someone
> who's not familiar with this is gonna have a bad time trying to figure out
> where the data comes from.

That's not really a concern. There are plenty of things in our chef
environment that violate the naive phased model (i.e. chef_gem,
use_inline_resources in LWRPs etc). As long as there is clear
documentation I don't see it as an issue.

> Why not use another LWRP or resource definition that wraps both?

We need the LWRP to define the attribute so it is accessible later in
the compile phase (it is used to configure the creation of other
resources during compile). A resource definition would be nice except
that in every case we want to notify if an action is taken.

> Alternatively, you can ask your LWRP resource where it thinks the data
> should go, with something like:
>
>   resources("chef_archive[NAME]").base_directory

Hmm ... that may be an option. We already add methods to the resource
that do the calculation ...

> HTH,

Thanks!

-- 
Cheers,

Peter Donald



Archive powered by MHonArc 2.6.16.

§