From 770f8ac0f8f7e518f750b359a1c221eb306f13a4 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 11 May 2018 00:03:09 +0200 Subject: [PATCH] allow people to not purge passenger yumrepo The idea is that people can switch between the different available nginx repos. in case somebody switched from the passenger one to the upstream repo we want to purge the passenger repo. However this gets us intro trouble if the person never switched, but another module declares a resource with this name. --- manifests/init.pp | 1 + manifests/package/redhat.pp | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 45c4f9783..67fda1d9b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -168,6 +168,7 @@ $nginx_upstreams = {}, $nginx_servers = {}, $nginx_servers_defaults = {}, + Boolean $purge_passenger_repo = true, ### END Hiera Lookups ### ) inherits nginx::params { diff --git a/manifests/package/redhat.pp b/manifests/package/redhat.pp index b19e95e86..af87bf6e6 100644 --- a/manifests/package/redhat.pp +++ b/manifests/package/redhat.pp @@ -21,6 +21,7 @@ $package_flavor = $nginx::package_flavor $passenger_package_ensure = $nginx::passenger_package_ensure $manage_repo = $nginx::manage_repo + $purge_passenger_repo = $nginx::purge_passenger_repo #Install the CentOS-specific packages on that OS, otherwise assume it's a RHEL #clone and provide the Red Hat-specific package. This comes into play when not @@ -43,11 +44,12 @@ before => Package['nginx'], } - yumrepo { 'passenger': - ensure => absent, - before => Package['nginx'], + if $purge_passenger_repo { + yumrepo { 'passenger': + ensure => absent, + before => Package['nginx'], + } } - } 'nginx-mainline': { yumrepo { 'nginx-release': @@ -60,11 +62,12 @@ before => Package['nginx'], } - yumrepo { 'passenger': - ensure => absent, - before => Package['nginx'], + if $purge_passenger_repo { + yumrepo { 'passenger': + ensure => absent, + before => Package['nginx'], + } } - } 'passenger': { if ($facts['os']['name'] in ['RedHat', 'CentOS']) and ($facts['os']['release']['major'] in ['6', '7']) {