Allow to configure Apache MPM module

Defaults to 'prefork', which ensures there is no upgrade/update impact.

Related-bug: #1829062

Change-Id: I3deb3e944ed4911962d204357bb3134569f153f6
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2019-07-17 17:33:44 +02:00
parent de91989ebc
commit 6fb9d8e6cd
3 changed files with 25 additions and 1 deletions

View File

@ -26,11 +26,15 @@
# [*status_listener*]
# Where should apache listen for status page
# Default to 127.0.0.1:80
#
# [*mpm_module*]
# The MPM module to use.
# Default to prefork.
class tripleo::profile::base::apache(
Boolean $enable_status_listener = false,
String $status_listener = '127.0.0.1:80',
String $mpm_module = 'prefork',
) {
include ::apache::params
# rhel8/fedora will be python3. See LP#1813053
@ -38,6 +42,11 @@ class tripleo::profile::base::apache(
class { '::apache':
mod_packages => merge($::apache::params::mod_packages, { 'wsgi' => 'python3-mod_wsgi' }),
mod_libs => merge($::apache::params::mod_libs, { 'wsgi' => 'mod_wsgi_python3.so' }),
mpm_module => $mpm_module,
}
} else {
class { '::apache':
mpm_module => $mpm_module,
}
}

View File

@ -0,0 +1,6 @@
---
features:
- |
Added new parameter 'mpm_module' for the base Apache profile to configure
the used MPM module. Defaults to 'prefork', which is also the default
value for the config files installed with the package.

View File

@ -21,6 +21,7 @@ describe 'tripleo::profile::base::apache' do
context 'with default params' do
it 'should trigger complete configuration' do
is_expected.to contain_class('apache::mod::prefork')
is_expected.to contain_class('apache::mod::status')
is_expected.to contain_class('apache::mod::ssl')
is_expected.to_not contain_apache__listen('127.0.0.1:80')
@ -51,6 +52,14 @@ describe 'tripleo::profile::base::apache' do
end
end
context 'Change MPM module' do
let(:params) {{
:mpm_module => 'event',
}}
it 'should trigger complete configuration' do
is_expected.to contain_class('apache::mod::event')
end
end
context 'Provide wrong value for ensure_status_listener' do
let(:params) {{