[chef] 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: Conditional execution for custom resources
  • Date: Tue, 19 Mar 2013 11:41:41 -0700


On Tuesday, March 19, 2013 at 11:29 AM, Adam Jacob wrote:

For the record, I agree with you.

 

Best,

Adam

 

From: [ ">mailto: ] On Behalf Of Jay Feldblum
Sent: Tuesday, March 19, 2013 11:21 AM
To: ">
Subject: [chef] Re: RE: Re: Re: Conditional execution for custom resources

 

Definitions are perfectly fine as macros - functions which, when called, declare resources and add them to the resources-collection. So describe them as macros, not as resources, in the docs. That will stop most of the confusion.

Definitions are useful for when you simply need a lightweight grouping of two or more resource declarations, macro-like, where custom resources & providers (including LWRPs) are too heavyweight.

 

Using custom providers like glorified definitions is poor form. If you have a provider which simply declares some sub-resources, why is that a provider? That should be a definition (macro) instead.

 

Cheers,

Jay

Are they really better for that use case though? The amount of boilerplate is about the same, and the use cases are the same, no?

Can you elaborate on what you mean by LWRPs being too heavyweight? Is it just a matter of having two files? Is it the conceptual overhead of thinking in terms of resources and providers?

IMO, making a group of resources a LWRP makes sense as a conceptual grouping. With the `use_inline_resources` feature in Chef 11, notifications and the like should just work the way a user would expect.


-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§