Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

How can I do conditional logic based on a Role?

$
0
0
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.

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>