Skip to content

Commit 6ff55f3

Browse files
committed
Drop support for Debian < 9 and Ubuntu < 16.04
1 parent 1191096 commit 6ff55f3

File tree

3 files changed

+14
-47
lines changed

3 files changed

+14
-47
lines changed

manifests/mpm.pp

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,33 +84,28 @@
8484
}
8585
}
8686

87-
if $mpm == 'itk' {
88-
if ( ( $::operatingsystem == 'Ubuntu' ) or ( ($::operatingsystem == 'Debian') and ( versioncmp($::operatingsystemrelease, '8.0.0') >= 0 ) ) ) {
87+
case $mpm {
88+
'itk': {
8989
include apache::mpm::disable_mpm_event
9090
include apache::mpm::disable_mpm_worker
91-
}
9291

93-
package { 'libapache2-mpm-itk':
94-
ensure => present,
95-
before => [
96-
Class['apache::service'],
97-
File[$apache::mod_enable_dir],
98-
],
92+
package { 'libapache2-mpm-itk':
93+
ensure => present,
94+
before => [
95+
Class['apache::service'],
96+
File[$apache::mod_enable_dir],
97+
],
98+
}
9999
}
100-
}
101-
102-
if $mpm == 'prefork' {
103-
if ( ( $::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease,'18.04') >= 0 ) or ( $::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '8.0.0') >= 0 ) ) {
100+
'prefork': {
104101
include apache::mpm::disable_mpm_event
105102
include apache::mpm::disable_mpm_worker
106103
}
107-
}
108-
109-
if $mpm == 'worker' {
110-
if ( ( $::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease,'18.04') >= 0 ) or ( $::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '8.0.0') >= 0 ) ) {
104+
'worker': {
111105
include apache::mpm::disable_mpm_event
112106
include apache::mpm::disable_mpm_prefork
113107
}
108+
default: {}
114109
}
115110
}
116111

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@
425425
$secpcrematchlimit = 1500
426426
$secpcrematchlimitrecursion = 1500
427427
$modsec_secruleengine = 'On'
428-
if ($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '9') >= 0) or ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '18.04') >= 0) {
428+
if $facts['operatingsystem'] == 'Debian' or ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '18.04') >= 0) {
429429
$modsec_default_rules = [
430430
'crawlers-user-agents.data',
431431
'iis-errors.data',

spec/classes/mod/php_spec.rb

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,6 @@
2020
it { is_expected.to contain_class('apache::mod::prefork') }
2121
end
2222
case facts[:os]['release']['major']
23-
when '8'
24-
context 'on jessie' do
25-
it {
26-
is_expected.to contain_file('php5.load').with(
27-
content: "LoadModule php5_module /usr/lib/apache2/modules/libphp5.so\n",
28-
)
29-
}
30-
context 'with mpm_module => itk on jessie' do
31-
let :pre_condition do
32-
'class { "apache": mpm_module => itk, }'
33-
end
34-
35-
it { is_expected.to contain_class('apache::params') }
36-
it { is_expected.to contain_class('apache::mod::itk') }
37-
it { is_expected.to contain_apache__mod('php5') }
38-
it { is_expected.to contain_package('libapache2-mod-php5') }
39-
it {
40-
is_expected.to contain_file('php5.load').with(
41-
content: "LoadModule php5_module /usr/lib/apache2/modules/libphp5.so\n",
42-
)
43-
}
44-
end
45-
end
4623
when '9'
4724
context 'on stretch' do
4825
it { is_expected.to contain_apache__mod('php7.0') }
@@ -230,12 +207,7 @@
230207
end
231208

232209
# all the following tests are for legacy php/apache versions. They don't work on modern ubuntu and redhat 8
233-
next if (facts[:os]['release']['major'].to_i > 15 && facts[:os]['name'] == 'Ubuntu') ||
234-
(facts[:os]['release']['major'].to_i >= 15 && facts[:os]['name'] == 'SLES') ||
235-
(facts[:os]['release']['major'].to_i >= 9 && facts[:os]['name'] == 'Debian') ||
236-
(facts[:os]['release']['major'].to_i >= 8 && (facts[:os]['name'] == 'RedHat' || facts[:os]['name'] == 'CentOS'))
237-
238-
describe 'OS independent tests' do
210+
describe 'OS independent tests', if: (facts[:os]['family'] == 'Redhat' && facts[:os]['release']['major'].to_i < 8) do
239211
context 'with content param' do
240212
let :params do
241213
{ content: 'somecontent' }

0 commit comments

Comments
 (0)