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.
|
||||||
@@ -169,38 +185,40 @@
|
|||||||
# Copyright 2013 eNovance <licensing@enovance.com>
|
# Copyright 2013 eNovance <licensing@enovance.com>
|
||||||
#
|
#
|
||||||
class keystone::wsgi::apache (
|
class keystone::wsgi::apache (
|
||||||
$servername = $::fqdn,
|
$servername = $::fqdn,
|
||||||
$servername_admin = undef,
|
$servername_admin = undef,
|
||||||
$public_port = 5000,
|
$public_port = 5000,
|
||||||
$admin_port = 35357,
|
$admin_port = 35357,
|
||||||
$bind_host = undef,
|
$bind_host = undef,
|
||||||
$admin_bind_host = undef,
|
$admin_bind_host = undef,
|
||||||
$public_path = '/',
|
$public_path = '/',
|
||||||
$admin_path = '/',
|
$admin_path = '/',
|
||||||
$ssl = true,
|
$ssl = true,
|
||||||
$workers = 1,
|
$workers = 1,
|
||||||
$ssl_cert = undef,
|
$ssl_cert = undef,
|
||||||
$ssl_key = undef,
|
$ssl_key = undef,
|
||||||
$ssl_cert_admin = undef,
|
$ssl_cert_admin = undef,
|
||||||
$ssl_key_admin = undef,
|
$ssl_key_admin = undef,
|
||||||
$ssl_chain = undef,
|
$ssl_chain = undef,
|
||||||
$ssl_ca = undef,
|
$ssl_ca = undef,
|
||||||
$ssl_crl_path = undef,
|
$ssl_crl_path = undef,
|
||||||
$ssl_crl = undef,
|
$ssl_crl = undef,
|
||||||
$ssl_certs_dir = undef,
|
$ssl_certs_dir = undef,
|
||||||
$threads = $::os_workers,
|
$threads = $::os_workers,
|
||||||
$priority = '10',
|
$priority = '10',
|
||||||
$wsgi_application_group = '%{GLOBAL}',
|
$wsgi_application_group = '%{GLOBAL}',
|
||||||
$wsgi_pass_authorization = 'On',
|
$wsgi_pass_authorization = 'On',
|
||||||
$wsgi_chunked_request = undef,
|
$wsgi_chunked_request = undef,
|
||||||
$wsgi_admin_script_source = $::keystone::params::keystone_wsgi_admin_script_path,
|
$wsgi_admin_script_source = $::keystone::params::keystone_wsgi_admin_script_path,
|
||||||
$wsgi_public_script_source = $::keystone::params::keystone_wsgi_public_script_path,
|
$wsgi_public_script_source = $::keystone::params::keystone_wsgi_public_script_path,
|
||||||
$wsgi_script_ensure = undef,
|
$wsgi_script_ensure = undef,
|
||||||
$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 {
|
||||||
|
|
||||||
include ::keystone::deps
|
include ::keystone::deps
|
||||||
@@ -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',
|
{
|
||||||
group => 'keystone',
|
user => 'keystone',
|
||||||
processes => $workers,
|
group => 'keystone',
|
||||||
threads => $threads,
|
processes => $workers,
|
||||||
display-name => 'keystone-main',
|
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',
|
user => 'keystone',
|
||||||
processes => $workers,
|
group => 'keystone',
|
||||||
threads => $threads,
|
processes => $workers,
|
||||||
display-name => 'keystone-admin',
|
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_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