[Request for Comments] hiera_declare_types

59 views
Skip to first unread message

Nathan Nobbe

unread,
Nov 8, 2013, 1:59:15 AM11/8/13
to puppe...@googlegroups.com
Hi everyone,

I've polished up the code for hiera_declare_types. It's essentially the hiera_include('classes') equivalent for resource types and to me it seems very useful.

What other people tell me they are doing instead is writing one-off modules, for sake of declaration via hiera_include. hiera_declare_types on the other hand is generic and allows resource type declaration directly in hiera data sources.

Could some devs take a peek and provide feedback? Is this something that could find it's way into the core?


thanks,

-nathan

Andy Parker

unread,
Nov 8, 2013, 12:00:30 PM11/8/13
to puppe...@googlegroups.com
Hi Nathan,


On Thu, Nov 7, 2013 at 10:59 PM, Nathan Nobbe <quicks...@gmail.com> wrote:
Hi everyone,

I've polished up the code for hiera_declare_types. It's essentially the hiera_include('classes') equivalent for resource types and to me it seems very useful.


Interesting. Is your function different from https://github.com/reliantsecurity/hiera-resources ? It might be good to work them them to get this onto the forge as a module. If it catches on there, then it could be a candidate for inclusion into the core.
 
What other people tell me they are doing instead is writing one-off modules, for sake of declaration via hiera_include. hiera_declare_types on the other hand is generic and allows resource type declaration directly in hiera data sources.

Could some devs take a peek and provide feedback? Is this something that could find it's way into the core?


thanks,

-nathan

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/9b19716d-2a3b-4a7b-afe7-51777f5f37c3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Andrew Parker
Freenode: zaphod42
Twitter: @aparker42
Software Developer

Join us at PuppetConf 2014September 23-24 in San Francisco

Nathan Nobbe

unread,
Nov 8, 2013, 1:10:06 PM11/8/13
to puppe...@googlegroups.com

Andrew,

Thanks for your reply!

Interesting. Is your function different from https://github.com/reliantsecurity/hiera-resources ?

Thanks for sharing this, good to know somebody else has had this thought and I'm not alone.

Fundamentally they are the same. Looking at this hiera_resources the main difference is the way things are defined in the data sources. Whereas hiera_resources would have you group all the resource definitions into a single block, hiera_declare_types asks you to sprinkle them throughout the file, so for built-in types you would have

hiera_file:
# file definitions...

hiera_cron:
# cron definitions...

For user-space resource types like mysql databases, there's two steps, 1. define the user-space resource types to look for, 2. provide the definition e.g.

types:
 - mysq::db

hiera_mysql_db:
# db definitions...

Six and a half dozen the other I suppose, but I'd argue the syntax of hiera_declare_types is more congruent with the way hiera_include('classes') works. What do you think?
 
It might be good to work them them to get this onto the forge as a module. If it catches on there, then it could be a candidate for inclusion into the core.

I'll work on getting something onto the forge.

thanks,

-nathan
Reply all
Reply to author
Forward
0 new messages