Skip to content

Commit edbdb65

Browse files
committed
(GH-cat-12) Fixes for RedHat 9
1 parent 801e0d8 commit edbdb65

File tree

13 files changed

+66
-36
lines changed

13 files changed

+66
-36
lines changed

manifests/mod/authnz_ldap.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# The name of the ldap package.
99
#
1010
# @see https://httpd.apache.org/docs/current/mod/mod_authnz_ldap.html for additional documentation.
11-
# @note Unsupported platforms: RedHat: 6, 8; CentOS: 6, 8; OracleLinux: 6, 8; Ubuntu: all; Debian: all; SLES: all
11+
# @note Unsupported platforms: RedHat: 6, 8, 9; CentOS: 6, 8; OracleLinux: 6, 8; Ubuntu: all; Debian: all; SLES: all
1212
class apache::mod::authnz_ldap (
1313
Boolean $verify_server_cert = true,
1414
Optional[String] $package_name = undef,

manifests/mod/itk.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# Used to verify that the Apache version you have requested is compatible with the module.
2929
#
3030
# @see http://mpm-itk.sesse.net for additional documentation.
31-
# @note Unsupported platforms: CentOS: 8; RedHat: 8; SLES: all
31+
# @note Unsupported platforms: CentOS: 8; RedHat: 8, 9; SLES: all
3232
class apache::mod::itk (
3333
Variant[String,Integer] $startservers = '8',
3434
Variant[String,Integer] $minspareservers = '5',

manifests/mod/ldap.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
# }
4848
#
4949
# @see https://httpd.apache.org/docs/current/mod/mod_ldap.html for additional documentation.
50-
# @note Unsupported platforms: CentOS: 8; RedHat: 8
50+
# @note Unsupported platforms: CentOS: 8; RedHat: 8, 9
5151
class apache::mod::ldap (
5252
Optional[String] $apache_version = undef,
5353
Optional[String] $package_name = undef,

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@
204204
$suphp_engine = 'off'
205205
$suphp_configpath = undef
206206
$php_version = $facts['os']['release']['major'] ? {
207+
'9' => '8', # RedHat9
207208
'8' => '7', # RedHat8
208209
default => '5', # RedHat5, RedHat6, RedHat7
209210
}

spec/acceptance/apache_parameters_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,10 @@ class { 'apache':
430430
pp = <<-MANIFEST
431431
if $::osfamily == 'RedHat' and "$::selinux" == "true" {
432432
$semanage_package = $::operatingsystemmajrelease ? {
433-
'5' => 'policycoreutils',
434-
'8' => 'policycoreutils-python-utils',
435-
default => 'policycoreutils-python',
433+
'6' => 'policycoreutils-python',
434+
'7' => 'policycoreutils-python',
435+
default => 'policycoreutils-python-utils',
436436
}
437-
438437
package { $semanage_package: ensure => installed }
439438
exec { 'set_apache_defaults':
440439
command => 'semanage fcontext -a -t httpd_log_t "/apache_spec(/.*)?"',

spec/acceptance/apache_ssl_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class { 'apache':
2323

2424
describe file("#{apache_hash['mod_ssl_dir']}/ssl.conf") do
2525
it { is_expected.to be_file }
26-
if os[:family].include?('redhat') && os[:release].to_i == 8
26+
if os[:family].include?('redhat') && os[:release].to_i >= 8
2727
it { is_expected.to contain 'SSLProtocol all' }
2828
else
2929
it { is_expected.to contain 'SSLProtocol all -SSLv2 -SSLv3' }

spec/acceptance/class_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@
4343
<<-MANIFEST
4444
if $::osfamily == 'RedHat' and "$::selinux" == "true" {
4545
$semanage_package = $::operatingsystemmajrelease ? {
46-
'5' => 'policycoreutils',
47-
'8' => 'policycoreutils-python-utils',
48-
default => 'policycoreutils-python',
46+
'6' => 'policycoreutils-python',
47+
'7' => 'policycoreutils-python',
48+
default => 'policycoreutils-python-utils',
4949
}
50-
5150
package { $semanage_package: ensure => installed }
5251
exec { 'set_apache_defaults':
5352
command => 'semanage fcontext -a -t httpd_sys_content_t "/apache_spec(/.*)?"',

spec/acceptance/default_mods_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
apache_hash = apache_settings_hash
55
describe 'apache::default_mods class' do
66
describe 'no default mods' do
7-
# Using puppet_apply as a helper
87
let(:pp) do
98
<<-MANIFEST
109
class { 'apache':
@@ -23,7 +22,6 @@ class { 'apache':
2322
end
2423

2524
describe 'alternative default mods' do
26-
# Using puppet_apply as a helper
2725
let(:pp) do
2826
<<-MANIFEST
2927
class { 'apache':

spec/acceptance/mod_php_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ class { 'apache::mod::php': }
4444
describe file("#{apache_hash['mod_dir']}/php7.4.conf") do
4545
it { is_expected.to contain 'DirectoryIndex index.php' }
4646
end
47-
elsif os[:family] == 'redhat' && os[:release] =~ %r{^8\b}
47+
elsif os[:family] == 'redhat' && os[:release] =~ %r{^(9)\b}
48+
describe file("#{apache_hash['mod_dir']}/php.conf") do
49+
it { is_expected.to contain 'DirectoryIndex index.php' }
50+
end
51+
elsif os[:family] == 'redhat' && os[:release] =~ %r{^(8)\b}
4852
describe file("#{apache_hash['mod_dir']}/php7.conf") do
4953
it { is_expected.to contain 'DirectoryIndex index.php' }
5054
end

spec/acceptance/prefork_worker_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class { 'apache':
4747

4848
describe 'apache::mod::prefork class' do
4949
describe 'running puppet code' do
50-
# Using puppet_apply as a helper
5150
let(:pp) do
5251
<<-MANIFEEST
5352
class { 'apache':

spec/acceptance/vhost_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class { 'apache': }
5151
end
5252
end
5353

54-
context 'default vhost with ssl', unless: (os[:family].include?('redhat') && os[:release].to_i == 8) do
54+
context 'default vhost with ssl', unless: (os[:family].include?('redhat') && os[:release].to_i >= 8) do
5555
pp = <<-MANIFEST
5656
file { '#{apache_hash['run_dir']}':
5757
ensure => 'directory',
@@ -1188,9 +1188,9 @@ class { 'apache::mod::wsgi': }
11881188
pp = <<-MANIFEST
11891189
if $::osfamily == 'RedHat' and "$::selinux" == "true" {
11901190
$semanage_package = $::operatingsystemmajrelease ? {
1191-
'5' => 'policycoreutils',
1192-
'8' => 'policycoreutils-python-utils',
1193-
default => 'policycoreutils-python',
1191+
'6' => 'policycoreutils-python',
1192+
'7' => 'policycoreutils-python',
1193+
default => 'policycoreutils-python-utils',
11941194
}
11951195
package { $semanage_package: ensure => installed }
11961196
exec { 'set_apache_defaults':

spec/classes/mod/php_spec.rb

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,17 @@
100100
end
101101

102102
it { is_expected.to contain_class('apache::params') }
103-
it { is_expected.to contain_apache__mod('php5') } if facts[:os]['release']['major'].to_i < 8
104-
it { is_expected.to contain_package('php') } if facts[:os]['release']['major'].to_i > 5
105-
it { is_expected.to contain_file('php5.load').with(content: "LoadModule php5_module modules/libphp5.so\n") } if facts[:os]['release']['major'].to_i < 8
106-
it { is_expected.to contain_file('php7.load').with(content: "LoadModule php7_module modules/libphp7.so\n") } if facts[:os]['release']['major'].to_i >= 8
103+
it { is_expected.to contain_package('php') }
104+
if facts[:os]['release']['major'].to_i < 8
105+
it { is_expected.to contain_apache__mod('php5') }
106+
it { is_expected.to contain_file('php5.load').with(content: "LoadModule php5_module modules/libphp5.so\n") }
107+
elsif facts[:os]['release']['major'].to_i == 8
108+
it { is_expected.to contain_apache__mod('php7') }
109+
it { is_expected.to contain_file('php7.load').with(content: "LoadModule php7_module modules/libphp7.so\n") }
110+
elsif facts[:os]['release']['major'].to_i >= 9
111+
it { is_expected.to contain_apache__mod('php') }
112+
it { is_expected.to contain_file('php.load').with(content: "LoadModule php_module modules/libphp.so\n") }
113+
end
107114
end
108115
context 'with alternative package name' do
109116
let :pre_condition do
@@ -123,8 +130,17 @@
123130
{ path: 'alternative-path' }
124131
end
125132

126-
it { is_expected.to contain_file('php5.load').with(content: "LoadModule php5_module alternative-path\n") } if facts[:os]['release']['major'].to_i < 8
127-
it { is_expected.to contain_file('php7.load').with(content: "LoadModule php7_module alternative-path\n") } if facts[:os]['release']['major'].to_i >= 8
133+
it { is_expected.to contain_package('php') }
134+
if facts[:os]['release']['major'].to_i < 8
135+
it { is_expected.to contain_apache__mod('php5') }
136+
it { is_expected.to contain_file('php5.load').with(content: "LoadModule php5_module alternative-path\n") }
137+
elsif facts[:os]['release']['major'].to_i == 8
138+
it { is_expected.to contain_apache__mod('php7') }
139+
it { is_expected.to contain_file('php7.load').with(content: "LoadModule php7_module alternative-path\n") }
140+
elsif facts[:os]['release']['major'].to_i >= 9
141+
it { is_expected.to contain_apache__mod('php') }
142+
it { is_expected.to contain_file('php.load').with(content: "LoadModule php_module alternative-path\n") }
143+
end
128144
end
129145
context 'with alternative extensions' do
130146
let :pre_condition do
@@ -157,10 +173,17 @@
157173
context 'with mpm_module => prefork' do
158174
it { is_expected.to contain_class('apache::params') }
159175
it { is_expected.to contain_class('apache::mod::prefork') }
160-
it { is_expected.to contain_apache__mod('php5') } if facts[:os]['release']['major'].to_i < 8
161-
it { is_expected.to contain_package('php') } if facts[:os]['release']['major'].to_i > 5
162-
it { is_expected.to contain_file('php5.load').with(content: "LoadModule php5_module modules/libphp5.so\n") } if facts[:os]['release']['major'].to_i < 8
163-
it { is_expected.to contain_file('php7.load').with(content: "LoadModule php7_module modules/libphp7.so\n") } if facts[:os]['release']['major'].to_i >= 8
176+
it { is_expected.to contain_package('php') }
177+
if facts[:os]['release']['major'].to_i < 8
178+
it { is_expected.to contain_apache__mod('php5') }
179+
it { is_expected.to contain_file('php5.load').with(content: "LoadModule php5_module modules/libphp5.so\n") }
180+
elsif facts[:os]['release']['major'].to_i == 8
181+
it { is_expected.to contain_apache__mod('php7') }
182+
it { is_expected.to contain_file('php7.load').with(content: "LoadModule php7_module modules/libphp7.so\n") }
183+
elsif facts[:os]['release']['major'].to_i >= 9
184+
it { is_expected.to contain_apache__mod('php') }
185+
it { is_expected.to contain_file('php.load').with(content: "LoadModule php_module modules/libphp.so\n") }
186+
end
164187
end
165188
context 'with mpm_module => itk' do
166189
let :pre_condition do
@@ -169,10 +192,17 @@
169192

170193
it { is_expected.to contain_class('apache::params') }
171194
it { is_expected.to contain_class('apache::mod::itk') }
172-
it { is_expected.to contain_apache__mod('php5') } if facts[:os]['release']['major'].to_i < 8
173-
it { is_expected.to contain_package('php') } if facts[:os]['release']['major'].to_i > 5
174-
it { is_expected.to contain_file('php5.load').with(content: "LoadModule php5_module modules/libphp5.so\n") } if facts[:os]['release']['major'].to_i < 8
175-
it { is_expected.to contain_file('php7.load').with(content: "LoadModule php7_module modules/libphp7.so\n") } if facts[:os]['release']['major'].to_i >= 8
195+
it { is_expected.to contain_package('php') }
196+
if facts[:os]['release']['major'].to_i < 8
197+
it { is_expected.to contain_apache__mod('php5') }
198+
it { is_expected.to contain_file('php5.load').with(content: "LoadModule php5_module modules/libphp5.so\n") }
199+
elsif facts[:os]['release']['major'].to_i == 8
200+
it { is_expected.to contain_apache__mod('php7') }
201+
it { is_expected.to contain_file('php7.load').with(content: "LoadModule php7_module modules/libphp7.so\n") }
202+
elsif facts[:os]['release']['major'].to_i >= 9
203+
it { is_expected.to contain_apache__mod('php') }
204+
it { is_expected.to contain_file('php.load').with(content: "LoadModule php_module modules/libphp.so\n") }
205+
end
176206
end
177207
end
178208
when 'FreeBSD'

spec/defines/fastcgi_server_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
end
1212

1313
on_supported_os.each do |os, facts|
14-
next if facts[:os]['release']['major'] == '18.04' || facts[:os]['release']['major'] == '20.04'
15-
next if (facts[:os]['release']['major'] == '7' || facts[:os]['release']['major'] == '8') && facts[:os]['family']['RedHat']
14+
next if facts[:os]['name'] == 'Ubuntu'
15+
next if facts[:os]['release']['major'] != '6' && facts[:os]['family']['RedHat']
1616
context "on #{os} " do
1717
let :facts do
1818
facts

0 commit comments

Comments
 (0)