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: I3df74ddc4a258083ccfe4e47180f022742655ba6
(cherry picked from commit 10a7db8463)
This commit is contained in:
Benedikt Trefzer 2017-06-26 15:28:32 +02:00 committed by zhongshengping
parent 1700009949
commit 8cd2771f75
7 changed files with 216 additions and 173 deletions

View File

@ -69,6 +69,14 @@
# [*vhost_custom_fragment*]
# (optional) Additional vhost configuration, if applicable.
#
# [*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['heat']
@ -96,6 +104,7 @@ define heat::wsgi::apache (
$threads = $::os_workers,
$priority = '10',
$vhost_custom_fragment = undef,
$custom_wsgi_process_options = {},
) {
if $title !~ /^api(|_cfn|_cloudwatch)$/ {
fail('The valid options are api, api_cfn, api_cloudwatch')
@ -131,6 +140,7 @@ define heat::wsgi::apache (
wsgi_script_dir => $::heat::params::heat_wsgi_script_path,
wsgi_script_file => "heat_${title}",
wsgi_script_source => getvar("::heat::params::heat_${title}_wsgi_script_source"),
custom_wsgi_process_options => $custom_wsgi_process_options,
allow_encoded_slashes => 'on',
require => Anchor['heat::install::end'],
vhost_custom_fragment => $vhost_custom_fragment,

View File

@ -61,6 +61,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['heat']
@ -87,6 +95,7 @@ class heat::wsgi::apache_api (
$ssl_certs_dir = undef,
$threads = $::os_workers,
$priority = '10',
$custom_wsgi_process_options = {},
) {
heat::wsgi::apache { 'api':
port => $port,
@ -103,6 +112,7 @@ class heat::wsgi::apache_api (
ssl_crl => $ssl_crl,
ssl_certs_dir => $ssl_certs_dir,
threads => $threads,
custom_wsgi_process_options => $custom_wsgi_process_options,
priority => $priority,
}
}

View File

@ -61,6 +61,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['heat']
@ -87,6 +95,7 @@ class heat::wsgi::apache_api_cfn (
$ssl_certs_dir = undef,
$threads = $::os_workers,
$priority = '10',
$custom_wsgi_process_options = {},
) {
# See custom fragment below
@ -122,5 +131,6 @@ class heat::wsgi::apache_api_cfn (
priority => $priority,
# Enforce content-type, see https://bugs.launchpad.net/tripleo/+bug/1641589
vhost_custom_fragment => 'RequestHeader set Content-Type "application/json"',
custom_wsgi_process_options => $custom_wsgi_process_options,
}
}

View File

@ -61,6 +61,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['heat']
@ -87,6 +95,7 @@ class heat::wsgi::apache_api_cloudwatch (
$ssl_certs_dir = undef,
$threads = $::os_workers,
$priority = '10',
$custom_wsgi_process_options = {},
) {
heat::wsgi::apache { 'api_cloudwatch':
port => $port,
@ -104,5 +113,6 @@ class heat::wsgi::apache_api_cloudwatch (
ssl_certs_dir => $ssl_certs_dir,
threads => $threads,
priority => $priority,
custom_wsgi_process_options => $custom_wsgi_process_options,
}
}

View File

@ -19,7 +19,8 @@ describe 'heat::wsgi::apache_api_cfn' do
:ssl_crl_path => nil,
:ssl_certs_dir => nil,
:threads => facts[:os_workers],
:priority => 10, )
:priority => 10,
:custom_wsgi_process_options => {}, )
}
end
end

View File

@ -19,7 +19,8 @@ describe 'heat::wsgi::apache_api_cloudwatch' do
:ssl_crl_path => nil,
:ssl_certs_dir => nil,
:threads => facts[:os_workers],
:priority => 10, )
:priority => 10,
:custom_wsgi_process_options => {}, )
}
end
end

View File

@ -19,7 +19,8 @@ describe 'heat::wsgi::apache_api' do
:ssl_crl_path => nil,
:ssl_certs_dir => nil,
:threads => facts[:os_workers],
:priority => 10, )
:priority => 10,
:custom_wsgi_process_options => {}, )
}
end
end