diff --git a/manifests/profile/base/apache.pp b/manifests/profile/base/apache.pp index 6cde9462a..ccc16d55e 100644 --- a/manifests/profile/base/apache.pp +++ b/manifests/profile/base/apache.pp @@ -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, } } diff --git a/releasenotes/notes/apache_mpm_tuning-deafdf6610ce57b2.yaml b/releasenotes/notes/apache_mpm_tuning-deafdf6610ce57b2.yaml new file mode 100644 index 000000000..9b3a464fa --- /dev/null +++ b/releasenotes/notes/apache_mpm_tuning-deafdf6610ce57b2.yaml @@ -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. diff --git a/spec/classes/tripleo_profile_base_apache_spec.rb b/spec/classes/tripleo_profile_base_apache_spec.rb index 8b3244faf..b37b8082f 100644 --- a/spec/classes/tripleo_profile_base_apache_spec.rb +++ b/spec/classes/tripleo_profile_base_apache_spec.rb @@ -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) {{