Skip to content

Commit

Permalink
allow people to not purge passenger yumrepo
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bastelfreak committed May 11, 2018
1 parent a96953b commit 770f8ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
$nginx_upstreams = {},
$nginx_servers = {},
$nginx_servers_defaults = {},
Boolean $purge_passenger_repo = true,
### END Hiera Lookups ###
) inherits nginx::params {

Expand Down
19 changes: 11 additions & 8 deletions manifests/package/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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':
Expand All @@ -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']) {
Expand Down

0 comments on commit 770f8ac

Please sign in to comment.