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
lease enter the commit message for your changes. Lines starting

Change-Id: I477745910b2f03e75d5faa280825c5ca45daae27
This commit is contained in:
ZhongShengping 2017-10-23 14:09:27 +08:00 committed by zhongshengping
parent 4eb6e9b75f
commit 0ef4004e85
3 changed files with 108 additions and 87 deletions

View File

@ -83,6 +83,14 @@
# 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
#
# requires Class['apache'] & Class['vitrage']
@ -113,6 +121,7 @@ class vitrage::wsgi::apache (
$access_log_file = false,
$access_log_format = false,
$error_log_file = undef,
$custom_wsgi_process_options = {},
) {
include ::vitrage::deps
@ -150,5 +159,6 @@ class vitrage::wsgi::apache (
access_log_file => $access_log_file,
access_log_format => $access_log_format,
error_log_file => $error_log_file,
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

@ -24,6 +24,7 @@ describe 'vitrage::wsgi::apache' do
:wsgi_script_source => platform_params[:wsgi_script_source],
:access_log_file => false,
:access_log_format => false,
:custom_wsgi_process_options => {},
)}
end
@ -38,7 +39,10 @@ describe 'vitrage::wsgi::apache' do
:workers => 37,
:access_log_file => '/var/log/httpd/access_log',
:access_log_format => 'some format',
:error_log_file => '/var/log/httpd/error_log'
:error_log_file => '/var/log/httpd/error_log',
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},
}
end
it { is_expected.to contain_class('vitrage::params') }
@ -64,6 +68,9 @@ describe 'vitrage::wsgi::apache' do
:access_log_file => '/var/log/httpd/access_log',
:access_log_format => 'some format',
:error_log_file => '/var/log/httpd/error_log',
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},
)}
end
end