From 992a153fa2ea918c4a6495cfeac6f42416fcdc19 Mon Sep 17 00:00:00 2001 From: Christoph Maser Date: Wed, 5 Jun 2024 07:36:32 +0200 Subject: [PATCH] drop RHEL 7, CentOS 7&8, VirtuozzoLinux 6&7 --- .github/CONTRIBUTING.md | 24 ++++++++-------- manifests/package/redhat.pp | 55 ++++++++++++++----------------------- manifests/params.pp | 2 +- metadata.json | 10 ------- spec/classes/nginx_spec.rb | 7 +---- 5 files changed, 34 insertions(+), 64 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 880932740..e3a012395 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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 @@ -251,8 +253,6 @@ The following strings are known to work: * ubuntu2004 * ubuntu2204 * debian11 -* centos7 -* centos8 * centos9 * almalinux8 * almalinux9 diff --git a/manifests/package/redhat.pp b/manifests/package/redhat.pp index f6e221109..f65d706d4 100644 --- a/manifests/package/redhat.pp +++ b/manifests/package/redhat.pp @@ -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': { @@ -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 { @@ -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 { @@ -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: { diff --git a/manifests/params.pp b/manifests/params.pp index a017e8b83..761b81cd1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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', diff --git a/metadata.json b/metadata.json index 2d5a4803f..b07968114 100644 --- a/metadata.json +++ b/metadata.json @@ -36,7 +36,6 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "7", "8", "9" ] @@ -58,18 +57,9 @@ { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "7", - "8", "9" ] }, - { - "operatingsystem": "VirtuozzoLinux", - "operatingsystemrelease": [ - "6", - "7" - ] - }, { "operatingsystem": "SLES" }, diff --git a/spec/classes/nginx_spec.rb b/spec/classes/nginx_spec.rb index b0ba21406..91fe846a1 100644 --- a/spec/classes/nginx_spec.rb +++ b/spec/classes/nginx_spec.rb @@ -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',