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_vhosts = {},
$nginx_upstreams = {}, $nginx_upstreams = {},
$nginx_locations = {}, $nginx_locations = {},
$manage_repo = $nginx::params::manage_repo,
) inherits nginx::params { ) inherits nginx::params {
include stdlib 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/centos appears to be identical to
# http://nginx.org/packages/rhel # http://nginx.org/packages/rhel
# no other dedicated dirs exist for platforms under $::osfamily == redhat # no other dedicated dirs exist for platforms under $::osfamily == redhat
yumrepo { 'nginx-release': if $nginx::manage_repo {
baseurl => "http://nginx.org/packages/rhel/${os_rel}/\$basearch/", yumrepo { 'nginx-release':
descr => 'nginx repo', baseurl => "http://nginx.org/packages/rhel/${os_rel}/\$basearch/",
enabled => '1', descr => 'nginx repo',
gpgcheck => '1', enabled => '1',
priority => '1', gpgcheck => '1',
gpgkey => 'http://nginx.org/keys/nginx_signing.key', 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 if $nginx::manage_repo {
file { '/etc/yum.repos.d/nginx-release.repo': #Define file for nginx-repo so puppet doesn't delete it
ensure => present, file { '/etc/yum.repos.d/nginx-release.repo':
require => Yumrepo['nginx-release'], ensure => present,
require => Yumrepo['nginx-release'],
}
} }
package { $redhat_packages: package { $redhat_packages:

View file

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