add parameter to overwrite/add wsgi process options
Add two parameters to apache wsgi to allow overwrite and/or add additional wsgi process options. Change-Id: I1be0584befbb0ddd2503c124a05d27adcd25ae2e
This commit is contained in:
@@ -122,6 +122,22 @@
|
||||
# is copied to the apache cgi-bin path as keystone-admin.
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*custom_wsgi_process_options_main*]
|
||||
# (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 {}
|
||||
#
|
||||
# [*custom_wsgi_process_options_admin*]
|
||||
# (optional) gives you the oportunity to add custom process options or to
|
||||
# overwrite the default options for the WSGI admin process.
|
||||
# eg. to use a virtual python environment for the WSGI process
|
||||
# you could set it to:
|
||||
# { python-path => '/my/python/virtualenv' }
|
||||
# Defaults to {}
|
||||
#
|
||||
# [*access_log_format*]
|
||||
# The log format for the virtualhost.
|
||||
# Optional. Defaults to false.
|
||||
@@ -199,6 +215,8 @@ class keystone::wsgi::apache (
|
||||
$access_log_format = false,
|
||||
$headers = undef,
|
||||
$vhost_custom_fragment = undef,
|
||||
$custom_wsgi_process_options_main = {},
|
||||
$custom_wsgi_process_options_admin = {},
|
||||
#DEPRECATED
|
||||
$wsgi_script_source = undef,
|
||||
) inherits ::keystone::params {
|
||||
@@ -299,21 +317,27 @@ class keystone::wsgi::apache (
|
||||
|
||||
create_resources('file', $wsgi_files, $wsgi_file_defaults)
|
||||
|
||||
$wsgi_daemon_process_options_main = {
|
||||
$wsgi_daemon_process_options_main = merge(
|
||||
{
|
||||
user => 'keystone',
|
||||
group => 'keystone',
|
||||
processes => $workers,
|
||||
threads => $threads,
|
||||
display-name => 'keystone-main',
|
||||
}
|
||||
},
|
||||
$custom_wsgi_process_options_main
|
||||
)
|
||||
|
||||
$wsgi_daemon_process_options_admin = {
|
||||
$wsgi_daemon_process_options_admin = merge(
|
||||
{
|
||||
user => 'keystone',
|
||||
group => 'keystone',
|
||||
processes => $workers,
|
||||
threads => $threads,
|
||||
display-name => 'keystone-admin',
|
||||
}
|
||||
},
|
||||
$custom_wsgi_process_options_admin
|
||||
)
|
||||
|
||||
$wsgi_script_aliases_main = hash([$public_path_real,"${::keystone::params::keystone_wsgi_script_path}/keystone-public"])
|
||||
$wsgi_script_aliases_admin = hash([$admin_path_real, "${::keystone::params::keystone_wsgi_script_path}/keystone-admin"])
|
||||
|
@@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- Add two parameters to apache wsgi to allow overwrite
|
||||
and/or add additional wsgi process options.
|
@@ -211,6 +211,39 @@ describe 'keystone::wsgi::apache' do
|
||||
|
||||
end
|
||||
|
||||
describe 'when wsgi_daemon_process_options are overriden' do
|
||||
let :params do
|
||||
{
|
||||
:custom_wsgi_process_options_admin => {
|
||||
user => 'keystone-admin',
|
||||
python_path => '/my/python/admin/path',
|
||||
},
|
||||
:custom_wsgi_process_options_main => {
|
||||
user => 'keystone-main',
|
||||
python_path => '/my/python/main/path',
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_apache__vhost('keystone_wsgi_admin').with(
|
||||
'wsgi_daemon_process_options' => {
|
||||
'user' => 'keystone-admin',
|
||||
'group' => 'keystone',
|
||||
'python-path' => '/my/python/admin/path',
|
||||
'display-name' => 'keystone_main',
|
||||
},
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_apache__vhost('keystone_wsgi_main').with(
|
||||
'wsgi_daemon_process_options' => {
|
||||
'user' => 'keystone-main',
|
||||
'group' => 'keystone',
|
||||
'python-path' => '/my/python/main/path',
|
||||
'display-name' => 'keystone-main',
|
||||
},
|
||||
)}
|
||||
end
|
||||
|
||||
describe 'when overriding parameters using same port' do
|
||||
let :params do
|
||||
{
|
||||
|
Reference in New Issue
Block a user