Created
January 25, 2016 20:07
-
-
Save Sharpie/4acf188d8223e354d537 to your computer and use it in GitHub Desktop.
Puppet manifest version detection code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if versioncmp($::puppetversion, '4') > 0 { | |
notify {'Puppet 4.0.0 or newer': } | |
# Use AIO paths, puppet_gem and puppetserver_gem providers, | |
# multiple providers for a single package, etc. | |
} else { | |
case $::puppetversion { | |
/Puppet Enterprise/: { | |
notify {'PE 3.x': } | |
# Use PE paths, pe_gem and pe_puppetserver_gem providers. | |
} | |
default: { | |
notify {'Puppet 3.x Open Source': } | |
# Use system paths and puppetserver_gem provider. | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment