I'm doing a refactor of my puppet code with the profiles+roles design pattern. I'm encountering what should be a simple problem, but I'm having trouble finding an answer.
With roles/profiles, you instantiate classes using 'include' and fetch the parameter values from hiera. Then, for each node, you specify one role, which in turn includes all the relevant classes. Right now I have a hiera hierarchy that references the node's OS, environment and host name. However, I also want to provide different data based on the role of a node. For example, a webserver and an email server might run postfix; the webserver uses it to email the admin when something goes wrong, but the email server uses it for much more. However, I still don't want to instantiate the parameters of the postfix class explicitly from any role or profile to avoid resource conflicts. So, I would like to write hiera data that applies to a particular role (or even a particular profile), like in the following hierarchy below, but I have no idea how to do this: :hierarchy: - "fqdn/%{clientcert}" - "env/%{environment}" - "roles/%{role}" - "os/%{osfamily} - common I should add that I'm very comfortable writing ruby code, but for something so basic I don't feel like I should be trying to write custom facts. Even a simple way to just specify, per-node, an extra fact I could use for hiera's hierarchy would be helpful. -- 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/630ccdfe-51fc-42c3-bad9-5ccbc953ac87%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.