If my server has a subrole, how do i set the effective role so that the correct class gets compiled? Please read through my setup before answering, maybe what i want to do is incorrect for this setup.
The way I setup roles and profiles is like this:
Nodes are given a role and a subrole by custom facts.
role: mail
subrole: relay
I use hiera_include('classes') in my site.pp.
And each role has a file in hieradata. The hiera.yaml looks like this.
:hierarchy:
- "nodes/%{::trusted.certname}"
- "roles/%{::role}"
- common
The profiles for the role are defined in hieradata/roles/mail.yaml which looks like this:
---
classes:
- profile::mail
class profile::mail::internal {
class { 'postfix':
relayhost => '192.168.0.1',
}
}
class profile::mail::relay {
include amavisd
include something_else
class { 'postfix':
relayhost => 'external.mail.com',
mynetworks => '192.168.0.0/16',
}
}
Are subroles implemented as a conditional statement within the profile manifest?
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/886ef534-a8de-454c-93dd-d8fae9c2dcc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.