----- Original Message -----
> From: llow...@oreillyauto.com
> To: puppet-users@googlegroups.com
> Sent: Thursday, June 28, 2012 7:59:50 PM
> Subject: [Puppet Users] hiera questions
> 
> I'm starting to use hiera more, to try to clean up and better
> modularize some of our stuff.
> 
> I know you can use various facts (such as $::hostname) when defining
> the hierarchy and where to look.
> 
> We have a few variables that are set based on patterns of hostname,
> and currently we have a selector that matches the hostname against a
> regex.
> 
> Is there a clean way to move this to hiera? A straight %{hostname} in
> the hiera.yaml won't work, since then I'd have to create a .yaml per
> hostname and it'd be a hassle to
> 
> Say I have the hostnames setup like: "prefix-purpose-[A-Z]-[0-9]+"
> where prefix is a fixed value across all names, purpose describes
> whether it is a web server, app server etc.
> 
> I'd like to be able to specify things for a given
> "prefix-purpose-[A-Z]" range as well as on a "prefix-purpose" basis.
> 
> I do hope what I am asking is clear, if not I apologize.

I would make facts on the nodes for these.  Let say $role and $subrole
and then just use those in your hierarchy with %{role} and %{subrole} 
thus allowing you to set variable for all those machines there.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to