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. - Thomas -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/66dd5cfa-9680-9568-023b-66d9041a87e3%40chaschperli.ch. For more options, visit https://groups.google.com/d/optout.