On Thursday, October 27, 2016 at 11:45:06 AM UTC-4, Thomas Müller wrote:
>
>
>
> Am 27.10.2016 um 15:43 schrieb Ugo Bellavance:
> > That looks great, thanks!
> >
> > However, I just realized that my server roles are somewhat related to
> > the server names. For example, I could call my webservers something
> > like www1, www2, www3. If all those 3 servers have the same config,
> > is there a way to create a file that would apply to all of them?
> > Something like /hiera/hosts/www?.yaml ?
> no there is no wildcard option. If your hostnames contain the role, you
> could do something like this:
>
>
> if $trusted['certname'] =~ /^([a-z]+)[0-9]+\./) {
> $role = $1
> } else {
> fail('Could not determine role')
> # or set some default role? or call $role = hiera('role'), ... whatever
> you like
> }
>
> I really only would do it by hostname if you are sure your dns names
> reflect the roles now and forever (or if you are in position to decide
> that it will be that way forever).
>
> or like Rob has written, creating a custom fact works too.
>
>
> >
> > If not, could I use a hard or soft link?
> This should work IMHO.
>
Considering our size, I think I'll go that way.
Thanks everyone for all your help!
Ugo
--
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/dfe0f2ad-c800-4ab2-8bc3-e6f2bcedc68d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.