On Sunday, April 27, 2014 8:25:18 AM UTC-5, John Morton wrote:
>
> I made a module called resource_factory:
>
> https://forge.puppetlabs.com/jaydub/resource_factory
>
> It has two parts. One is the resource_factory class, the other is the 
> defined_resource_factory resource type. They both do the same kind of thing 
> — wrap around create_resources with a hiera look up on some key. The 
> difference is that the class creates defined_resource_factory instances by 
> default, and those instances are where you put the resource types and hiera 
> keys for the stuff you really want to create. Everything's configured in 
> hiera without a lot of site specific classes.
>
> Question is: have I just reinvented the wheel on some existing best 
> practice, and if so, how are the grown ups creating resources out of Hiera?
>
>

I think you've reinvented MS Word.  I mean, it looks slick and featureful, 
but the old DOS "edit" program was all I needed or wanted for many tasks.  
It's not as over-the-top as the Enterprise Rules Engine (but thanks, Felix, 
for that reference :-)), but create_resources() is not such a central 
feature of Puppet that dolling it up or wrapping it in additional layers of 
abstraction is a big benefit for most folks.

The grown ups *avoid* modeling resources (as such) in their hiera data.  
Resources are best modeled in Puppet DSL -- that's what it's for.  External 
data are better expressed in more raw form; that makes them easier to 
understand and use.  At times, the natural form of the data lends itself to 
use with create_resources(), or can easily be made to do.  Occasionally, 
intentionally structuring external data for use with create_resources() is 
the best way to approach a problem.  At these times, create_resources() 
already provides a reasonable interface.

If the module serves you well then great.  Thanks for sharing it, and I 
hope others find it useful, too.  Personally, though, I have no use 
whatever for such a thing.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/13a75525-a310-46b3-9831-3f73c66bbcc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to