Skip to content

Commit

Permalink
drop RHEL 7, CentOS 7&8, VirtuozzoLinux 6
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeier committed Jun 5, 2024
1 parent f3d1758 commit e53b4e0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 64 deletions.
24 changes: 12 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

## Table of contents

* [Contributing](#contributing)
* [Writing proper commits - short version](#writing-proper-commits-short-version)
* [Writing proper commits - long version](#writing-proper-commits-long-version)
* [Dependencies](#dependencies)
* [Note for OS X users](#note-for-os-x-users)
* [The test matrix](#the-test-matrix)
* [Syntax and style](#syntax-and-style)
* [Running the unit tests](#running-the-unit-tests)
* [Unit tests in docker](#unit-tests-in-docker)
* [Integration tests](#integration-tests)
- [Contribution guidelines](#contribution-guidelines)
- [Table of contents](#table-of-contents)
- [Contributing](#contributing)
- [Writing proper commits - short version](#writing-proper-commits---short-version)
- [Writing proper commits - long version](#writing-proper-commits---long-version)
- [Dependencies](#dependencies)
- [Note for OS X users](#note-for-os-x-users)
- [The test matrix](#the-test-matrix)
- [Syntax and style](#syntax-and-style)
- [Running the unit tests](#running-the-unit-tests)
- [Unit tests in docker](#unit-tests-in-docker)
- [Integration tests](#integration-tests)

This module has grown over time based on a range of contributions from
people using it. If you follow these contributing guidelines your patch
Expand Down Expand Up @@ -251,8 +253,6 @@ The following strings are known to work:
* ubuntu2004
* ubuntu2204
* debian11
* centos7
* centos8
* centos9
* almalinux8
* almalinux9
Expand Down
55 changes: 20 additions & 35 deletions manifests/package/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
default => 'rhel'
}

$want_module_hotfixes = if versioncmp(fact('os.release.full'), '8.0') >= 0 {
'1'
} else {
'absent'
}

if $manage_repo {
case $package_source {
'nginx', 'nginx-stable': {
Expand All @@ -36,7 +30,7 @@
priority => '1',
gpgkey => 'https://nginx.org/keys/nginx_signing.key',
before => Package['nginx'],
module_hotfixes => $want_module_hotfixes,
module_hotfixes => '1',
}

if $purge_passenger_repo {
Expand All @@ -55,7 +49,7 @@
priority => '1',
gpgkey => 'https://nginx.org/keys/nginx_signing.key',
before => Package['nginx'],
module_hotfixes => $want_module_hotfixes,
module_hotfixes => '1',
}

if $purge_passenger_repo {
Expand All @@ -66,35 +60,26 @@
}
}
'passenger': {
if ($facts['os']['name'] in ['RedHat', 'CentOS', 'VirtuozzoLinux', 'Rocky', 'AlmaLinux']) and ($facts['os']['release']['major'] in ['6', '7', '8', '9']) {
# 2019-11: Passenger changed their gpg key from: `https://packagecloud.io/phusion/passenger/gpgkey`
# to: `https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt`
# Find the latest key by opening: https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo

# Also note: Since 6.0.5 there are no nginx packages in the phusion EL7 repository, and nginx packages are expected to come from epel instead
yumrepo { 'passenger':
baseurl => "https://oss-binaries.phusionpassenger.com/yum/passenger/el/${facts['os']['release']['major']}/\$basearch",
descr => 'passenger repo',
enabled => '1',
gpgcheck => '0',
repo_gpgcheck => '1',
priority => '1',
gpgkey => 'https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt',
before => Package['nginx'],
module_hotfixes => $want_module_hotfixes,
}
yumrepo { 'passenger':
baseurl => "https://oss-binaries.phusionpassenger.com/yum/passenger/el/${facts['os']['release']['major']}/\$basearch",
descr => 'passenger repo',
enabled => '1',
gpgcheck => '0',
repo_gpgcheck => '1',
priority => '1',
gpgkey => 'https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt',
before => Package['nginx'],
module_hotfixes => '1',
}

yumrepo { 'nginx-release':
ensure => absent,
before => Package['nginx'],
}
yumrepo { 'nginx-release':
ensure => absent,
before => Package['nginx'],
}

package { $passenger_package_name:
ensure => $passenger_package_ensure,
require => Yumrepo['passenger'],
}
} else {
fail("${facts['os']['name']} version ${facts['os']['release']['major']} is unsupported with \$package_source 'passenger'")
package { $passenger_package_name:
ensure => $passenger_package_ensure,
require => Yumrepo['passenger'],
}
}
default: {
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
}
}
'RedHat': {
if ($facts['os']['name'] in ['RedHat', 'CentOS', 'Oracle', 'virtuozzolinux', 'Rocky', 'AlmaLinux'] and $facts['os']['release']['major'] in ['6', '7', '8', '9']) {
if $facts['os']['name'] in ['RedHat', 'CentOS', 'Oracle', 'virtuozzolinux', 'Rocky', 'AlmaLinux'] {
$_module_os_overrides = {
'manage_repo' => true,
'log_group' => 'nginx',
Expand Down
10 changes: 0 additions & 10 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8",
"9"
]
Expand All @@ -58,18 +57,9 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7",
"8",
"9"
]
},
{
"operatingsystem": "VirtuozzoLinux",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "SLES"
},
Expand Down
7 changes: 1 addition & 6 deletions spec/classes/nginx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,8 @@
let(:params) { { package_source: 'passenger' } }

it { is_expected.to contain_package('nginx') }
it { is_expected.to contain_package('libnginx-mod-http-passenger') }

if (facts.dig(:os, 'name') == 'Debian' && %w[11].include?(facts.dig(:os, 'release', 'major'))) ||
(facts.dig(:os, 'name') == 'Ubuntu' && %w[bionic focal jammy].include?(facts.dig(:os, 'distro', 'codename')))
it { is_expected.to contain_package('libnginx-mod-http-passenger') }
else
it { is_expected.to contain_package('passenger') }
end
it do
is_expected.to contain_apt__source('nginx').with(
'location' => 'https://oss-binaries.phusionpassenger.com/apt/passenger',
Expand Down

0 comments on commit e53b4e0

Please sign in to comment.