Add customization for wsgi process display name

Change-Id: I09f96ad4e08c9091ffeb4c850e6ec81baa58a5b5
Related-Bug: #1626550
This commit is contained in:
Xing Zhou
2016-12-22 21:00:45 +08:00
parent 8ee6ab2918
commit 6a11af655e
6 changed files with 187 additions and 121 deletions

View File

@@ -57,6 +57,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*]
@@ -93,6 +97,7 @@ class nova::wsgi::apache (
$ssl_crl_path = undef,
$ssl_crl = undef,
$ssl_certs_dir = undef,
$wsgi_process_display_name = undef,
$threads = $::os_workers,
$priority = '10',
) {
@@ -124,6 +129,7 @@ class nova::wsgi::apache (
ssl_crl_path => $ssl_crl_path,
ssl_crl => $ssl_crl,
ssl_certs_dir => $ssl_certs_dir,
wsgi_process_display_name => $wsgi_process_display_name,
threads => $threads,
priority => $priority,
}

View File

@@ -56,6 +56,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*]
@@ -90,6 +94,7 @@ class nova::wsgi::apache_api (
$ssl_crl_path = undef,
$ssl_crl = undef,
$ssl_certs_dir = undef,
$wsgi_process_display_name = undef,
$threads = $::os_workers,
$priority = '10',
) {
@@ -124,6 +129,7 @@ class nova::wsgi::apache_api (
user => 'nova',
workers => $workers,
wsgi_daemon_process => 'nova-api',
wsgi_process_display_name => $wsgi_process_display_name,
wsgi_process_group => 'nova-api',
wsgi_script_dir => $::nova::params::nova_wsgi_script_path,
wsgi_script_file => 'nova-api',

View File

@@ -54,6 +54,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
#
# [*ensure_package*]
# (optional) Control the ensure parameter for the Nova Placement API package ressource.
# Defaults to 'present'
@@ -92,6 +96,7 @@ class nova::wsgi::apache_placement (
$ssl_crl_path = undef,
$ssl_crl = undef,
$ssl_certs_dir = undef,
$wsgi_process_display_name = undef,
$threads = $::os_workers,
$priority = '10',
$ensure_package = 'present',
@@ -135,6 +140,7 @@ class nova::wsgi::apache_placement (
user => 'nova',
workers => $workers,
wsgi_daemon_process => 'placement-api',
wsgi_process_display_name => $wsgi_process_display_name,
wsgi_process_group => 'placement-api',
wsgi_script_dir => $::nova::params::nova_wsgi_script_path,
wsgi_script_file => 'nova-placement-api',

View File

@@ -65,6 +65,13 @@ describe 'nova::wsgi::apache_api' do
'docroot_group' => 'nova',
'ssl' => 'true',
'wsgi_daemon_process' => 'nova-api',
'wsgi_daemon_process_options' => {
'user' => 'nova',
'group' => 'nova',
'processes' => 1,
'threads' => '42',
'display-name' => 'nova_api_wsgi',
},
'wsgi_process_group' => 'nova-api',
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/nova-api" },
'require' => 'File[nova_api_wsgi]'
@@ -101,6 +108,7 @@ describe 'nova::wsgi::apache_api' do
:bind_host => '10.42.51.1',
:api_port => 12345,
:ssl => false,
:wsgi_process_display_name => 'nova-api',
:workers => 37,
}
end
@@ -114,6 +122,13 @@ describe 'nova::wsgi::apache_api' do
'docroot_group' => 'nova',
'ssl' => 'false',
'wsgi_daemon_process' => 'nova-api',
'wsgi_daemon_process_options' => {
'user' => 'nova',
'group' => 'nova',
'processes' => 37,
'threads' => '42',
'display-name' => 'nova-api',
},
'wsgi_process_group' => 'nova-api',
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/nova-api" },
'require' => 'File[nova_api_wsgi]'

View File

@@ -71,6 +71,13 @@ describe 'nova::wsgi::apache_placement' do
'docroot_group' => 'nova',
'ssl' => 'true',
'wsgi_daemon_process' => 'placement-api',
'wsgi_daemon_process_options' => {
'user' => 'nova',
'group' => 'nova',
'processes' => 1,
'threads' => '42',
'display-name' => 'placement_wsgi',
},
'wsgi_process_group' => 'placement-api',
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/nova-placement-api" },
'require' => 'File[placement_wsgi]'
@@ -107,6 +114,7 @@ describe 'nova::wsgi::apache_placement' do
:bind_host => '10.42.51.1',
:api_port => 12345,
:ssl => false,
:wsgi_process_display_name => 'placement-api',
:workers => 37,
}
end
@@ -120,6 +128,13 @@ describe 'nova::wsgi::apache_placement' do
'docroot_group' => 'nova',
'ssl' => 'false',
'wsgi_daemon_process' => 'placement-api',
'wsgi_daemon_process_options' => {
'user' => 'nova',
'group' => 'nova',
'processes' => 37,
'threads' => '42',
'display-name' => 'placement-api',
},
'wsgi_process_group' => 'placement-api',
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/nova-placement-api" },
'require' => 'File[placement_wsgi]'

View File

@@ -58,6 +58,13 @@ describe 'nova::wsgi::apache' do
'docroot_group' => 'nova',
'ssl' => 'true',
'wsgi_daemon_process' => 'nova-api',
'wsgi_daemon_process_options' => {
'user' => 'nova',
'group' => 'nova',
'processes' => 1,
'threads' => '8',
'display-name' => 'nova_api_wsgi',
},
'wsgi_process_group' => 'nova-api',
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/nova-api" },
'require' => 'File[nova_api_wsgi]'
@@ -94,6 +101,7 @@ describe 'nova::wsgi::apache' do
:bind_host => '10.42.51.1',
:api_port => 12345,
:ssl => false,
:wsgi_process_display_name => 'nova-api',
:workers => 37,
}
end
@@ -107,6 +115,13 @@ describe 'nova::wsgi::apache' do
'docroot_group' => 'nova',
'ssl' => 'false',
'wsgi_daemon_process' => 'nova-api',
'wsgi_daemon_process_options' => {
'user' => 'nova',
'group' => 'nova',
'processes' => '37',
'threads' => '8',
'display-name' => 'nova-api',
},
'wsgi_process_group' => 'nova-api',
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/nova-api" },
'require' => 'File[nova_api_wsgi]'
@@ -129,7 +144,10 @@ describe 'nova::wsgi::apache' do
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
facts.merge!(OSDefaults.get_facts({
:os_workers => 8,
:fqdn => 'some.host.tld'
}))
end
let (:platform_params) do