Given a Roles & Profiles pattern set up with site.pp matching nodes to roles, and roles then including profiles, is there a way to do conditional logic in my custom classes based on the assigned Role?
My specific use case has to do with Splunk. I have three Splunk servers (given the role "splunkserver") that should NOT include the Splunk Universal Forwarder. However, *every other system* should include the Splunk Universal Forwarder. I have a base profile that includes specifications that are essentially global, and I'd like to be able to essentially say:
if ! (the splunkserver role is defined in site.pp) {
include profile::splunkuf
} # Else don't include the splunk universal forwarder
I'm currently defining an "exclude" parameter to the `splunkuf` class and setting it to true for the individual splunk servers via hiera, but I feel there should be a better way.
↧