add parameter to overwrite/add wsgi process options

Add parameter to apache_wsgi to allow overwrite
and/or add additional wsgi process options.

This possibility was added to openstacklib
with Change-Id: I41914ce3361988d5db1695f09d21209772fdf548

Change-Id: I93e1d46e1f7c3121f866251620bf88435d4084d1
This commit is contained in:
Benedikt Trefzer 2017-09-19 14:09:02 +02:00
parent 3a7b6f7f0b
commit 5e0be79f84
3 changed files with 79 additions and 58 deletions

View File

@ -69,6 +69,14 @@
# [*ssl_certs_dir*]
# apache::vhost ssl parameters.
# Optional. Default to apache::vhost 'ssl_*' defaults.
# [*custom_wsgi_process_options*]
# (optional) gives you the oportunity to add custom process options or to
# overwrite the default options for the WSGI main process.
# eg. to use a virtual python environment for the WSGI process
# you could set it to:
# { python-path => '/my/python/virtualenv' }
# Defaults to {}
#
#
# == Dependencies
#
@ -97,6 +105,7 @@ class aodh::wsgi::apache (
$wsgi_process_display_name = undef,
$threads = $::os_workers,
$priority = '10',
$custom_wsgi_process_options = {},
) {
include ::aodh::deps
@ -135,5 +144,6 @@ class aodh::wsgi::apache (
wsgi_script_dir => $::aodh::params::aodh_wsgi_script_path,
wsgi_script_file => 'app',
wsgi_script_source => $::aodh::params::aodh_wsgi_script_source,
custom_wsgi_process_options => $custom_wsgi_process_options,
}
}

View File

@ -0,0 +1,4 @@
---
features:
- Add parameter to apache_wsgi to allow overwrite
and/or add additional wsgi process options.

View File

@ -22,6 +22,7 @@ describe 'aodh::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:custom_wsgi_process_options => {},
)}
end
@ -34,6 +35,9 @@ describe 'aodh::wsgi::apache' do
:ssl => false,
:wsgi_process_display_name => 'aodh',
:workers => 37,
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},
}
end
it { is_expected.to contain_class('aodh::params') }
@ -56,6 +60,9 @@ describe 'aodh::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},
)}
end
end