From 4ec2f4e0d23d453045c9e0cb2ce735bcaee6a0c1 Mon Sep 17 00:00:00 2001 From: Tim 'bastelfreak' Meusel Date: Tue, 10 Oct 2023 12:59:46 +0200 Subject: [PATCH] Drop EoL Ubuntu code This deletes Ubuntu 16 and older code. Those versions are already gone from metadata.json. --- REFERENCE.md | 2 +- manifests/mod/md.pp | 2 +- spec/classes/mod/php_spec.rb | 5 ++-- spec/classes/mod/security_spec.rb | 48 ------------------------------- spec/defines/vhost_spec.rb | 2 +- 5 files changed, 5 insertions(+), 54 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index ab025770fc..6e678449e0 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -3602,7 +3602,7 @@ Installs `mod_macro`. Installs and configures `mod_md`. -* **Note** Unsupported platforms: CentOS: 6, 7; OracleLinux: all; RedHat: 6, 7; Scientific: all; SLES: all; Ubuntu: 14, 16, 18 +* **Note** Unsupported platforms: CentOS: 6, 7; OracleLinux: all; RedHat: 6, 7; Scientific: all; SLES: all; Ubuntu: 18 * **See also** * https://httpd.apache.org/docs/current/mod/mod_md.html diff --git a/manifests/mod/md.pp b/manifests/mod/md.pp index ef3194cc4d..7cb12f5888 100644 --- a/manifests/mod/md.pp +++ b/manifests/mod/md.pp @@ -91,7 +91,7 @@ # # @see https://httpd.apache.org/docs/current/mod/mod_md.html for additional documentation. # -# @note Unsupported platforms: CentOS: 6, 7; OracleLinux: all; RedHat: 6, 7; Scientific: all; SLES: all; Ubuntu: 14, 16, 18 +# @note Unsupported platforms: CentOS: 6, 7; OracleLinux: all; RedHat: 6, 7; Scientific: all; SLES: all; Ubuntu: 18 class apache::mod::md ( Optional[String] $md_activation_delay = undef, Optional[Apache::OnOff] $md_base_server = undef, diff --git a/spec/classes/mod/php_spec.rb b/spec/classes/mod/php_spec.rb index 0db6bb57cb..8c4e774d63 100644 --- a/spec/classes/mod/php_spec.rb +++ b/spec/classes/mod/php_spec.rb @@ -290,9 +290,8 @@ end # all the following tests are for legacy php/apache versions. They don't work on modern ubuntu and redhat 8 - next if (facts[:os]['release']['major'].to_i > 15 && facts[:os]['name'] == 'Ubuntu') || - (facts[:os]['release']['major'].to_i >= 15 && facts[:os]['name'] == 'SLES') || - (facts[:os]['name'] == 'Debian') || + next if (facts[:os]['release']['major'].to_i >= 15 && facts[:os]['name'] == 'SLES') || + (facts[:os]['family'] == 'Debian') || (facts[:os]['release']['major'].to_i >= 8 && (facts[:os]['name'] == 'RedHat' || facts[:os]['name'] == 'CentOS' || facts[:os]['name'] == 'Rocky' || facts[:os]['name'] == 'AlmaLinux')) diff --git a/spec/classes/mod/security_spec.rb b/spec/classes/mod/security_spec.rb index af54c0bb2c..ec41852199 100644 --- a/spec/classes/mod/security_spec.rb +++ b/spec/classes/mod/security_spec.rb @@ -286,54 +286,6 @@ ) } - if facts[:os]['release']['major'].to_i < 18 && facts[:os]['name'] == 'Ubuntu' - it { is_expected.to contain_apache__security__rule_link('base_rules/modsecurity_35_bad_robots.data') } - - it { - expect(subject).to contain_file('modsecurity_35_bad_robots.data').with( - path: '/etc/modsecurity/activated_rules/modsecurity_35_bad_robots.data', - target: '/usr/share/modsecurity-crs/base_rules/modsecurity_35_bad_robots.data', - ) - } - end - - describe 'with parameters' do - let :params do - { - activated_rules: [ - '/tmp/foo/bar.conf', - ], - audit_log_relevant_status: '^(?:5|4(?!01|04))', - audit_log_parts: 'ABCDZ', - audit_log_type: 'Concurrent', - audit_log_storage_dir: '/var/log/httpd/audit', - secdefaultaction: 'deny,status:406,nolog,auditlog', - secrequestbodyaccess: 'Off', - secresponsebodyaccess: 'On', - secrequestbodylimitaction: 'ProcessPartial', - secresponsebodylimitaction: 'Reject' - } - end - - if facts[:os]['release']['major'].to_i < 18 && facts[:os]['name'] == 'Ubuntu' - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogRelevantStatus "\^\(\?:5\|4\(\?!01\|04\)\)"$} } - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogParts ABCDZ$} } - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecAuditLogStorageDir /var/log/httpd/audit$} } - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecRequestBodyAccess Off$} } - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecResponseBodyAccess On$} } - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecRequestBodyLimitAction ProcessPartial$} } - it { is_expected.to contain_file('security.conf').with_content %r{^\s+SecResponseBodyLimitAction Reject$} } - it { is_expected.to contain_file('/etc/modsecurity/security_crs.conf').with_content %r{^\s*SecDefaultAction "phase:2,deny,status:406,nolog,auditlog"$} } - - it { - expect(subject).to contain_file('bar.conf').with( - path: '/etc/modsecurity/activated_rules/bar.conf', - target: '/tmp/foo/bar.conf', - ) - } - end - end - describe 'with custom parameters' do let :params do { diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index 5f6172e21a..96eec3239d 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -593,7 +593,7 @@ 'notify' => 'Class[Apache::Service]') } - if os_facts[:os]['release']['major'].to_i >= 18 && os_facts[:os]['name'] == 'Ubuntu' + if os_facts[:os]['name'] == 'Ubuntu' it { expect(subject).to contain_file('30-rspec.example.com.conf symlink').with('ensure' => 'link', 'path' => "/etc/#{apache_name}/sites-enabled/30-rspec.example.com.conf")