Skip to content

Commit

Permalink
backward compatibility with yumrepo in puppet < 3.0, deric#40
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Jan 12, 2016
1 parent 89af31e commit a55e6e0
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,43 @@
$osrel = $::operatingsystemmajrelease
case $osrel {
'6', '7': {
# parameter ensure is not supported before Puppet 3.5
if versioncmp($::puppetversion, '3.5.0') >= 0 {
if versioncmp($::puppetversion, '3.0.0') < 0{
# parameter 'sslverify' is not supported before puppet 3.0
yumrepo { $config['name']:
descr => $config['descr'],
baseurl => $config['url'],
enabled => 1,
gpgcheck => 0
}
} elsif versioncmp($::puppetversion, '3.5.0') >= 0 {
# parameter ensure is not supported before Puppet 3.5
yumrepo { $config['name']:
ensure => $ensure,
descr => $config['descr'],
baseurl => $config['url'],
enabled => 1,
sslverify => 0,
gpgcheck => 0
sslverify => empty($config['sslverify']) ? {
true => 0,
false => $config['sslverify']
},
gpgcheck => empty($config['gpgcheck']) ? {
true => 0,
false => $config['gpgcheck']
},
}
} else {
yumrepo { $config['name']:
descr => $config['descr'],
baseurl => $config['url'],
enabled => 1,
sslverify => 0,
gpgcheck => 0
sslverify => empty($config['sslverify']) ? {
true => 0,
false => $config['sslverify']
},
gpgcheck => empty($config['gpgcheck']) ? {
true => 0,
false => $config['gpgcheck']
},
}
}
}
Expand Down

0 comments on commit a55e6e0

Please sign in to comment.