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.
|
# is copied to the apache cgi-bin path as keystone-admin.
|
||||||
# Defaults to undef.
|
# 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*]
|
# [*access_log_format*]
|
||||||
# The log format for the virtualhost.
|
# The log format for the virtualhost.
|
||||||
# Optional. Defaults to false.
|
# Optional. Defaults to false.
|
||||||
@@ -199,6 +215,8 @@ class keystone::wsgi::apache (
|
|||||||
$access_log_format = false,
|
$access_log_format = false,
|
||||||
$headers = undef,
|
$headers = undef,
|
||||||
$vhost_custom_fragment = undef,
|
$vhost_custom_fragment = undef,
|
||||||
|
$custom_wsgi_process_options_main = {},
|
||||||
|
$custom_wsgi_process_options_admin = {},
|
||||||
#DEPRECATED
|
#DEPRECATED
|
||||||
$wsgi_script_source = undef,
|
$wsgi_script_source = undef,
|
||||||
) inherits ::keystone::params {
|
) inherits ::keystone::params {
|
||||||
@@ -299,21 +317,27 @@ class keystone::wsgi::apache (
|
|||||||
|
|
||||||
create_resources('file', $wsgi_files, $wsgi_file_defaults)
|
create_resources('file', $wsgi_files, $wsgi_file_defaults)
|
||||||
|
|
||||||
$wsgi_daemon_process_options_main = {
|
$wsgi_daemon_process_options_main = merge(
|
||||||
|
{
|
||||||
user => 'keystone',
|
user => 'keystone',
|
||||||
group => 'keystone',
|
group => 'keystone',
|
||||||
processes => $workers,
|
processes => $workers,
|
||||||
threads => $threads,
|
threads => $threads,
|
||||||
display-name => 'keystone-main',
|
display-name => 'keystone-main',
|
||||||
}
|
},
|
||||||
|
$custom_wsgi_process_options_main
|
||||||
|
)
|
||||||
|
|
||||||
$wsgi_daemon_process_options_admin = {
|
$wsgi_daemon_process_options_admin = merge(
|
||||||
|
{
|
||||||
user => 'keystone',
|
user => 'keystone',
|
||||||
group => 'keystone',
|
group => 'keystone',
|
||||||
processes => $workers,
|
processes => $workers,
|
||||||
threads => $threads,
|
threads => $threads,
|
||||||
display-name => 'keystone-admin',
|
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_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"])
|
$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
|
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
|
describe 'when overriding parameters using same port' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user