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: I2bcd2068f2d2968a63c29247d4e65815be33b176
This commit is contained in:
Benedikt Trefzer 2017-09-19 14:22:07 +02:00
parent 6ec650490c
commit dfeb00ade4
3 changed files with 73 additions and 52 deletions

View File

@ -70,6 +70,14 @@
# apache::vhost ssl parameters. # apache::vhost ssl parameters.
# Optional. Default to apache::vhost 'ssl_*' defaults. # 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 # == Dependencies
# #
# requires Class['apache'] & Class['gnocchi'] # requires Class['apache'] & Class['gnocchi']
@ -97,6 +105,7 @@ class gnocchi::wsgi::apache (
$wsgi_process_display_name = undef, $wsgi_process_display_name = undef,
$threads = 1, $threads = 1,
$priority = '10', $priority = '10',
$custom_wsgi_process_options = {},
) { ) {
include ::gnocchi::deps include ::gnocchi::deps
@ -131,5 +140,6 @@ class gnocchi::wsgi::apache (
wsgi_script_dir => $::gnocchi::params::gnocchi_wsgi_script_path, wsgi_script_dir => $::gnocchi::params::gnocchi_wsgi_script_path,
wsgi_script_file => 'app', wsgi_script_file => 'app',
wsgi_script_source => $::gnocchi::params::gnocchi_wsgi_script_source, wsgi_script_source => $::gnocchi::params::gnocchi_wsgi_script_source,
custom_wsgi_process_options => $custom_wsgi_process_options,
} }
} }

View File

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

View File

@ -22,6 +22,7 @@ describe 'gnocchi::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path], :wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app', :wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source], :wsgi_script_source => platform_params[:wsgi_script_source],
:custom_wsgi_process_options => {},
)} )}
end end
@ -35,6 +36,9 @@ describe 'gnocchi::wsgi::apache' do
:workers => 8, :workers => 8,
:wsgi_process_display_name => 'gnocchi', :wsgi_process_display_name => 'gnocchi',
:threads => 2, :threads => 2,
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},
} }
end end
@ -58,6 +62,9 @@ describe 'gnocchi::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path], :wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app', :wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source], :wsgi_script_source => platform_params[:wsgi_script_source],
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},
)} )}
end end
end end