- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Re: Container LWRPs and notifications
- Date: Tue, 15 Feb 2011 08:28:28 -0800
On Monday, February 14, 2011 at 1:33 PM, Mark J. Reed wrote:
On Mon, Feb 14, 2011 at 3:12 PM, Jonathan Matthews
<
">
> wrote:
I'm starting to use LWRPs as simple containers for multiple
"first-class" resources.
It seems our messages passed each other like ships in the night.
I suppose I need the boolean OR of each of the contained resource's
updated_by_last_action? calls, but I don't /have/ a reference to each
resource. Unless I look inside and start manipulating the resources()
collection - and that seems a little low-level for what's touted as a
*higher*-level interface to custom Resources and Providers.
Any thoughts? Have I missed something obvious?
This might be tricky. LWRPs are similar to a mini chef run, in that they create the resources in a compile phase, but then they inject them into the resource collection of the "main" Chef run.
However, you may be able to attach the resources from your LWRP resource to the ones inside your LWRP provider. You can get the list of a resource's notifications via Resource#immediate_notifications and Resource#delayed_notifications. The actual notification objects have Notification#resource, Notification#action and Notification#notifying_resource methods to get at their data.
I realize this isn't quite ideal, if you have any suggestions about what would be a more ideal API (preferably without sacrificing flexibility), I'd be interested to hear about it.
--
Dan DeLeo
Archive powered by MHonArc 2.6.16.