Skip to content

Instantly share code, notes, and snippets.

@Sharpie
Created January 25, 2016 20:07
Show Gist options
  • Save Sharpie/4acf188d8223e354d537 to your computer and use it in GitHub Desktop.
Save Sharpie/4acf188d8223e354d537 to your computer and use it in GitHub Desktop.
Puppet manifest version detection code
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