How to apply a set of configurations to a specific host group?

32 views
Skip to first unread message

Sans

unread,
Apr 23, 2014, 6:28:09 AM4/23/14
to puppet...@googlegroups.com

Hi all,

For some historical reason, our hosts are not systematically named nor matches with the service(s) it runs and I don't see it's changing any time soon. So using a Regex in the nodename is not really an option for me. I have four environments - Dev, Int, Stage and Live - and I've just started using hiera to define the nodes like this:

curr_coll_list:
    - mon510.back.local
    - mon507.mgrt.local

curr_db_list:
    - mon512.mgrt.local
    - pdb511.back.local
    - pdb504.back.local
   
Is there any way I can use that to apply a set of configurations to, say curr_coll_list? Or, what are the other options I have?
I know that node can have a comma separated list of host names but that doesn't make things any easier for me.

Best,
San

José Luis Ledesma

unread,
Apr 23, 2014, 7:25:09 AM4/23/14
to puppet...@googlegroups.com

Hi,

You can use a default node definition, checking if the hostname is inside any of your array declarations.

Regards,

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c8369c3a-be6b-4623-add3-a4dfea4da1d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sans

unread,
Apr 23, 2014, 4:42:42 PM4/23/14
to puppet...@googlegroups.com

Thanks Jose!
That trick worked (I've actually used that thing before) but I was wondering if there is a way to do it "properly", like creating  a host-group or something like that.

Best!

Neil - Puppet List

unread,
Apr 23, 2014, 5:03:24 PM4/23/14
to PuppetList

Hello

I think you'd probably be best served by using a sql backend to hiera.

this would allow you to think and configure in terms of host groups but hiera to find that a host has a class of group.

A view or two might be needed to keep things tidy.

Neil

--
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...@googlegroups.com.

Sans

unread,
Apr 23, 2014, 5:09:30 PM4/23/14
to puppet...@googlegroups.com, maillis...@iamafreeman.com
Do you have any example(s) handy, Neil?
I'm trying in google as well. Top of that, I never used SQL with hiera before.

José Luis Ledesma

unread,
Apr 23, 2014, 5:13:44 PM4/23/14
to puppet...@googlegroups.com, maillis...@iamafreeman.com

There is a nice hiera-mysql module. Although from my point of view using a MySQL to resolve this problem seems a bit overkill.

IMO this module is to attack some kind of existing mysql cmdb, but it's just my opinion.

Regards

--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages