[chef] Re: Re: Re: RE: Re: RE: Re: Re: Conditional execution for custom resources


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: Re: RE: Re: RE: Re: Re: Conditional execution for custom resources
  • Date: Tue, 19 Mar 2013 14:11:08 -0700


On Tuesday, March 19, 2013 at 12:05 PM, Jay Feldblum wrote:

Daniel,

Lightweight resources & providers take two files which must be kept in sync. (You could do it in one file in a library, but then you lose the DSL. The fact that it's easy is not in dispute. The point is that it's unnecessary.) The interface and the implementation are forcibly separated, regardless of whether you actually need that separation.

The inline-resources feature is certainly helpful in this context. But that introduces another problem: notifications. Recipe-level resources can't notify inline-resources declared in a provider action. Sometimes what one needs is for the recipe to notify a resource declared from within a macro (or subscribe to one).

When something requires the convenience of grouping but does not require the wall of abstraction, then resources & providers do too much.

Cheers,
Jay

Thanks for the feedback.

The bit about having two files and such seems like just an interface issue. This can be solved with a little bit of design effort.

As for notifying resources that are defined by a macro, that feels a bit ugly because you're crossing the abstraction layers. Can you explain a bit more about how you're using this profitably? Would it be a huge burden to implement this in a hypothetical "extra lightweight RP" that defined the resource and provider in a single file?

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§