support platforms that don't supply lsbmajdistrelease fact

This commit is contained in:
Brett Porter 2012-09-03 11:31:40 -07:00
parent f2a14b9961
commit b9afd221a3

View file

@ -22,8 +22,14 @@ class nginx::package::redhat {
$os_type = downcase($::operatingsystem)
}
if $::lsbmajdistrelease == undef {
$os_rel = regsubst($::operatingsystemrelease, '\..*$', '')
} else {
$os_rel = $::lsbmajdistrelease
}
yumrepo { "nginx-release":
baseurl => "http://nginx.org/packages/${os_type}/${::lsbmajdistrelease}/\$basearch/",
baseurl => "http://nginx.org/packages/${os_type}/${os_rel}/\$basearch/",
descr => 'nginx repo',
enabled => '1',
gpgcheck => '0',