Puppet Class: pe_upgrade::validation
- Defined in:
- manifests/validation.pp
Overview
This class exists to fail.
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'manifests/validation.pp', line 2
class pe_upgrade::validation(
$version,
$allow_downgrade,
$upgrade_master,
) {
if $::osfamily == 'Windows' {
fail("osfamily 'Windows' is not currently supported")
}
if $::fact_is_puppetmaster == 'true' and ! $upgrade_master {
fail("Refusing to upgrade Puppet master ${::clientcert} without 'upgrade_master' set")
}
# If someone really really wants to force a downgrade, I respect their
# decisions and trust they understand the implication of their actions.
if $pe_version and ! $allow_downgrade {
$errmsg = "Refusing to downgrade from ${::pe_version} to ${version} without 'force_upgrade' set"
$compare = versioncmp($pe_version, $version)
if $compare == '1' {
fail($errmsg)
}
}
}
|