Added class param to disable YUM repo management on RedHat platforms

This commit is contained in:
Rytis Sileika 2013-09-26 13:32:59 +00:00
parent 315d7e109f
commit 9db6a82ad1
3 changed files with 18 additions and 13 deletions

View file

@ -53,6 +53,7 @@ class nginx (
$nginx_vhosts = {},
$nginx_upstreams = {},
$nginx_locations = {},
$manage_repo = $nginx::params::manage_repo,
) inherits nginx::params {
include stdlib

View file

@ -42,23 +42,26 @@ class nginx::package::redhat {
# http://nginx.org/packages/centos appears to be identical to
# http://nginx.org/packages/rhel
# no other dedicated dirs exist for platforms under $::osfamily == redhat
yumrepo { 'nginx-release':
baseurl => "http://nginx.org/packages/rhel/${os_rel}/\$basearch/",
descr => 'nginx repo',
enabled => '1',
gpgcheck => '1',
priority => '1',
gpgkey => 'http://nginx.org/keys/nginx_signing.key',
if $nginx::manage_repo {
yumrepo { 'nginx-release':
baseurl => "http://nginx.org/packages/rhel/${os_rel}/\$basearch/",
descr => 'nginx repo',
enabled => '1',
gpgcheck => '1',
priority => '1',
gpgkey => 'http://nginx.org/keys/nginx_signing.key',
before => Package[$redhat_packages],
}
}
Yumrepo['nginx-release'] -> Package[$redhat_packages]
}
}
#Define file for nginx-repo so puppet doesn't delete it
file { '/etc/yum.repos.d/nginx-release.repo':
ensure => present,
require => Yumrepo['nginx-release'],
if $nginx::manage_repo {
#Define file for nginx-repo so puppet doesn't delete it
file { '/etc/yum.repos.d/nginx-release.repo':
ensure => present,
require => Yumrepo['nginx-release'],
}
}
package { $redhat_packages:

View file

@ -89,4 +89,5 @@ class nginx::params {
$nx_http_access_log = "${nx_logdir}/access.log"
$package_ensure = 'present'
$manage_repo = true
}