Add customization for wsgi process display name

Change-Id: I08ef3c9c863f3ea9bd4f9170b28b5cc23b416cf0
Related-Bug: #1626550
This commit is contained in:
Xing Zhou 2016-12-21 13:36:31 +08:00
parent 8c99d97afe
commit 30d7e3d85a
2 changed files with 64 additions and 43 deletions

View File

@ -52,6 +52,10 @@
# (optional) The number of threads for the vhost.
# Defaults to $::os_workers
#
# [*wsgi_process_display_name*]
# (optional) Name of the WSGI process display-name.
# Defaults to undef
#
# [*ssl_cert*]
# [*ssl_key*]
# [*ssl_chain*]
@ -73,21 +77,22 @@
# class { 'cinder::wsgi::apache': }
#
class cinder::wsgi::apache (
$servername = $::fqdn,
$port = 8776,
$bind_host = undef,
$path = '/',
$ssl = true,
$workers = 1,
$ssl_cert = undef,
$ssl_key = undef,
$ssl_chain = undef,
$ssl_ca = undef,
$ssl_crl_path = undef,
$ssl_crl = undef,
$ssl_certs_dir = undef,
$threads = $::os_workers,
$priority = '10',
$servername = $::fqdn,
$port = 8776,
$bind_host = undef,
$path = '/',
$ssl = true,
$workers = 1,
$ssl_cert = undef,
$ssl_key = undef,
$ssl_chain = undef,
$ssl_ca = undef,
$ssl_crl_path = undef,
$ssl_crl = undef,
$ssl_certs_dir = undef,
$wsgi_process_display_name = undef,
$threads = $::os_workers,
$priority = '10',
) {
include ::cinder::deps
@ -99,28 +104,29 @@ class cinder::wsgi::apache (
}
::openstacklib::wsgi::apache { 'cinder_wsgi':
bind_host => $bind_host,
bind_port => $port,
group => 'cinder',
path => $path,
priority => $priority,
servername => $servername,
ssl => $ssl,
ssl_ca => $ssl_ca,
ssl_cert => $ssl_cert,
ssl_certs_dir => $ssl_certs_dir,
ssl_chain => $ssl_chain,
ssl_crl => $ssl_crl,
ssl_crl_path => $ssl_crl_path,
ssl_key => $ssl_key,
threads => $threads,
user => 'cinder',
workers => $workers,
wsgi_daemon_process => 'cinder-api',
wsgi_process_group => 'cinder-api',
wsgi_script_dir => $::cinder::params::cinder_wsgi_script_path,
wsgi_script_file => 'cinder-api',
wsgi_script_source => $::cinder::params::cinder_wsgi_script_source,
require => Anchor['cinder::install::end'],
bind_host => $bind_host,
bind_port => $port,
group => 'cinder',
path => $path,
priority => $priority,
servername => $servername,
ssl => $ssl,
ssl_ca => $ssl_ca,
ssl_cert => $ssl_cert,
ssl_certs_dir => $ssl_certs_dir,
ssl_chain => $ssl_chain,
ssl_crl => $ssl_crl,
ssl_crl_path => $ssl_crl_path,
ssl_key => $ssl_key,
threads => $threads,
user => 'cinder',
workers => $workers,
wsgi_daemon_process => 'cinder-api',
wsgi_process_display_name => $wsgi_process_display_name,
wsgi_process_group => 'cinder-api',
wsgi_script_dir => $::cinder::params::cinder_wsgi_script_path,
wsgi_script_file => 'cinder-api',
wsgi_script_source => $::cinder::params::cinder_wsgi_script_source,
require => Anchor['cinder::install::end'],
}
}

View File

@ -37,6 +37,13 @@ describe 'cinder::wsgi::apache' do
'docroot_group' => 'cinder',
'ssl' => 'true',
'wsgi_daemon_process' => 'cinder-api',
'wsgi_daemon_process_options' => {
'user' => 'cinder',
'group' => 'cinder',
'processes' => 1,
'threads' => '42',
'display-name' => 'cinder_wsgi',
},
'wsgi_process_group' => 'cinder-api',
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/cinder-api" },
'require' => 'File[cinder_wsgi]'
@ -47,11 +54,12 @@ describe 'cinder::wsgi::apache' do
describe 'when overriding parameters using different ports' do
let :params do
{
:servername => 'dummy.host',
:bind_host => '10.42.51.1',
:port => 12345,
:ssl => false,
:workers => 37,
:servername => 'dummy.host',
:bind_host => '10.42.51.1',
:port => 12345,
:ssl => false,
:wsgi_process_display_name => 'cinder-api',
:workers => 37,
}
end
@ -64,6 +72,13 @@ describe 'cinder::wsgi::apache' do
'docroot_group' => 'cinder',
'ssl' => 'false',
'wsgi_daemon_process' => 'cinder-api',
'wsgi_daemon_process_options' => {
'user' => 'cinder',
'group' => 'cinder',
'processes' => '37',
'threads' => '42',
'display-name' => 'cinder-api',
},
'wsgi_process_group' => 'cinder-api',
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/cinder-api" },
'require' => 'File[cinder_wsgi]'