Sorry, this is what happens when I'm too tired. I see all the pieces now. The types module is using create_resources() as well as the hiera_hash() function.
I'll read the collectors documentation again. Any idea why R.I. Pienaar thinks that it's a bad idea to use the create_resources() function? Thanks, Alex On Monday, April 28, 2014 1:19:50 PM UTC-7, Alex Scoble wrote: > > I think I get it now. > > The types module is actually a wrapper for tying hiera hash data to the > three built in types, but this pattern could also be used with a defined > type perhaps? > > Thanks, > > Alex > > On Monday, April 28, 2014 1:05:55 PM UTC-7, Alex Scoble wrote: >> >> Hi Garrett, >> >> Thanks for the response. The module you posted does indeed help as it >> shows how to deal with hashes of hiera data without using the >> create_resources() function. >> >> Thanks, >> >> Alex >> >> >>> >>> Hi, >>> >>> The create_resources() function allows you to have a data driven design. >>> This gives you the ability to specify arbitrary data in Hiera and >>> decouple data from modules. It means you can change the data without the >>> code. I would argue that any define in your module should have a >>> corresponding create_resources() function, so that it can be accessed >>> through data in Hiera. >>> >>> As for ordering, your defines should probably take care of that, though >>> you can use collections with chaining to help, such as >>> >>> Virt::Foo <||> -> Virt::Bar <||> >>> >>> When you are using create_resources(), I recommend also specifying an >>> option to use hiera_hash() to collect your hashes. This does a deep hash >>> merge and will return values from all levels of the hierarchy. My types >>> module[1] is an example of this that lets you define file, mount, and >>> cron resources as hashes. >>> >>> [1] - https://github.com/ghoneycutt/puppet-module-types >>> >>> Best regards, >>> -g >>> >>> -- >>> Garrett Honeycutt >>> @learnpuppet >>> Puppet Training with LearnPuppet.com >>> Mobile: +1.206.414.8658 >>> >> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/eca95701-2e41-4c9c-b861-9e3e9a602622%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
