Add workers to magnum api and conductor
This patch adds two new parameters that can be used to specify the number of workers for the api and conductor services. Change-Id: I71dcfba1f162b395c3d9e68513dfcf9a099800df
This commit is contained in:
parent
1c219c60e9
commit
d59bd32b1d
@ -47,6 +47,10 @@
|
|||||||
# Required when $enabled_ssl is set to 'true'.
|
# Required when $enabled_ssl is set to 'true'.
|
||||||
# Defaults to $::os_service_default.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
|
# [*workers*]
|
||||||
|
# (Optional) Number of API workers.
|
||||||
|
# Defaults to $::os_workers
|
||||||
|
#
|
||||||
class magnum::api(
|
class magnum::api(
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$enabled = true,
|
$enabled = true,
|
||||||
@ -58,6 +62,7 @@ class magnum::api(
|
|||||||
$enabled_ssl = false,
|
$enabled_ssl = false,
|
||||||
$ssl_cert_file = $::os_service_default,
|
$ssl_cert_file = $::os_service_default,
|
||||||
$ssl_key_file = $::os_service_default,
|
$ssl_key_file = $::os_service_default,
|
||||||
|
$workers = $::os_workers,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::magnum::deps
|
include ::magnum::deps
|
||||||
@ -85,6 +90,7 @@ class magnum::api(
|
|||||||
'api/enabled_ssl': value => $enabled_ssl;
|
'api/enabled_ssl': value => $enabled_ssl;
|
||||||
'api/ssl_cert_file': value => $ssl_cert_file;
|
'api/ssl_cert_file': value => $ssl_cert_file;
|
||||||
'api/ssl_key_file': value => $ssl_key_file;
|
'api/ssl_key_file': value => $ssl_key_file;
|
||||||
|
'api/workers': value => $workers;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install package
|
# Install package
|
||||||
|
@ -25,12 +25,17 @@
|
|||||||
# (optional) Type of authentication to be used.
|
# (optional) Type of authentication to be used.
|
||||||
# Defaults to 'keystone'
|
# Defaults to 'keystone'
|
||||||
#
|
#
|
||||||
|
# [*workers*]
|
||||||
|
# (optional) Number of conductor workers.
|
||||||
|
# Defaults to $::os_workers
|
||||||
|
#
|
||||||
class magnum::conductor(
|
class magnum::conductor(
|
||||||
$enabled = true,
|
$enabled = true,
|
||||||
$manage_service = true,
|
$manage_service = true,
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$conductor_life_check_timeout = $::os_service_default,
|
$conductor_life_check_timeout = $::os_service_default,
|
||||||
$auth_strategy = 'keystone',
|
$auth_strategy = 'keystone',
|
||||||
|
$workers = $::os_workers,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::magnum::db
|
include ::magnum::db
|
||||||
@ -63,6 +68,7 @@ class magnum::conductor(
|
|||||||
|
|
||||||
magnum_config {
|
magnum_config {
|
||||||
'conductor/conductor_life_check_timeout': value => $conductor_life_check_timeout;
|
'conductor/conductor_life_check_timeout': value => $conductor_life_check_timeout;
|
||||||
|
'conductor/workers': value => $workers;
|
||||||
}
|
}
|
||||||
|
|
||||||
if $auth_strategy == 'keystone' {
|
if $auth_strategy == 'keystone' {
|
||||||
|
5
releasenotes/notes/add-workers-1ae88b14d0638a82.yaml
Normal file
5
releasenotes/notes/add-workers-1ae88b14d0638a82.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Added magnum::api::workers and magnum::conductor::workers which can be used
|
||||||
|
to specify the number of worker processes.
|
@ -59,6 +59,7 @@ describe 'magnum::api' do
|
|||||||
is_expected.to contain_magnum_config('api/enabled_ssl').with_value(p[:enabled_ssl])
|
is_expected.to contain_magnum_config('api/enabled_ssl').with_value(p[:enabled_ssl])
|
||||||
is_expected.to contain_magnum_config('api/ssl_cert_file').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_magnum_config('api/ssl_cert_file').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_magnum_config('api/ssl_key_file').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_magnum_config('api/ssl_key_file').with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_magnum_config('api/workers').with_value(facts[:os_workers])
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when overriding parameters' do
|
context 'when overriding parameters' do
|
||||||
@ -67,6 +68,7 @@ describe 'magnum::api' do
|
|||||||
:port => '1234',
|
:port => '1234',
|
||||||
:host => '0.0.0.0',
|
:host => '0.0.0.0',
|
||||||
:max_limit => '10',
|
:max_limit => '10',
|
||||||
|
:workers => 10,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -74,6 +76,7 @@ describe 'magnum::api' do
|
|||||||
is_expected.to contain_magnum_config('api/port').with_value(p[:port])
|
is_expected.to contain_magnum_config('api/port').with_value(p[:port])
|
||||||
is_expected.to contain_magnum_config('api/host').with_value(p[:host])
|
is_expected.to contain_magnum_config('api/host').with_value(p[:host])
|
||||||
is_expected.to contain_magnum_config('api/max_limit').with_value(p[:max_limit])
|
is_expected.to contain_magnum_config('api/max_limit').with_value(p[:max_limit])
|
||||||
|
is_expected.to contain_magnum_config('api/workers').with_value(p[:workers])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -23,7 +23,10 @@ describe 'magnum::conductor' do
|
|||||||
:ensure => 'running'
|
:ensure => 'running'
|
||||||
) }
|
) }
|
||||||
|
|
||||||
it { is_expected.to contain_magnum_config('conductor/conductor_life_check_timeout').with_value('<SERVICE DEFAULT>') }
|
it {
|
||||||
|
is_expected.to contain_magnum_config('conductor/conductor_life_check_timeout').with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_magnum_config('conductor/workers').with_value(facts[:os_workers])
|
||||||
|
}
|
||||||
|
|
||||||
context 'with conductor_life_check_timeout specified' do
|
context 'with conductor_life_check_timeout specified' do
|
||||||
let :params do
|
let :params do
|
||||||
@ -42,6 +45,14 @@ describe 'magnum::conductor' do
|
|||||||
it { is_expected.to contain_service('magnum-conductor').without_ensure }
|
it { is_expected.to contain_service('magnum-conductor').without_ensure }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with workers specified' do
|
||||||
|
let :params do
|
||||||
|
{ :workers => 10 }
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_magnum_config('conductor/workers').with_value(10) }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
|
Loading…
Reference in New Issue
Block a user