From 6bb922b140f6f1dbac39729eae4c4ec0669900be Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Fri, 9 Dec 2016 18:00:56 +0100 Subject: [PATCH] Add the enable_new_services option to nova::conductor Adds the enable_new_services parameter to the nova::conductor class. When a new nova services is started the conductor will create the services. If enable_new_services is set to False it will set them to disabled when they are added. Default value for the enable_new_services option is True which is the default in the nova code. Change-Id: I91bfc7a04071025a58629641b5da4f8347cfc133 --- manifests/conductor.pp | 22 ++++++++++++++----- ...w_services_parameter-0174ea25ea8b5de7.yaml | 3 +++ spec/classes/nova_conductor_spec.rb | 12 ++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/add_enable_new_services_parameter-0174ea25ea8b5de7.yaml diff --git a/manifests/conductor.pp b/manifests/conductor.pp index e56c87732..822622e7a 100644 --- a/manifests/conductor.pp +++ b/manifests/conductor.pp @@ -20,6 +20,13 @@ # (optional) Number of workers for OpenStack Conductor service # Defaults to undef (i.e. parameter will not be present) # +# [*enable_new_services*] +# (optional) When a new service (for example "nova-compute") start up, it gets +# registered in the database as an enabled service. Setting this to false will +# cause new services to be disabled when added. This config option is only used +# by the conductor service which is responsible for creating the service entries. +# Defaults to $::os_service_default +# # DEPRECATED PARAMETERS # # [*use_local*] @@ -27,12 +34,13 @@ # Defaults to undef # class nova::conductor( - $enabled = true, - $manage_service = true, - $ensure_package = 'present', - $workers = undef, + $enabled = true, + $manage_service = true, + $ensure_package = 'present', + $workers = undef, + $enable_new_services = $::os_service_default, # DEPREACTED PARAMETERS - $use_local = undef, + $use_local = undef, ) { if $use_local { @@ -56,4 +64,8 @@ class nova::conductor( 'conductor/workers': value => $workers; } } + + nova_config { + 'DEFAULT/enable_new_services': value => $enable_new_services + } } diff --git a/releasenotes/notes/add_enable_new_services_parameter-0174ea25ea8b5de7.yaml b/releasenotes/notes/add_enable_new_services_parameter-0174ea25ea8b5de7.yaml new file mode 100644 index 000000000..6e2405dae --- /dev/null +++ b/releasenotes/notes/add_enable_new_services_parameter-0174ea25ea8b5de7.yaml @@ -0,0 +1,3 @@ +--- +features: + - Adds the enable_new_services config parameter to nova conductor diff --git a/spec/classes/nova_conductor_spec.rb b/spec/classes/nova_conductor_spec.rb index 1828f963d..d81104166 100644 --- a/spec/classes/nova_conductor_spec.rb +++ b/spec/classes/nova_conductor_spec.rb @@ -46,6 +46,18 @@ describe 'nova::conductor' do it { is_expected.to contain_nova_config('conductor/workers').with_value('5') } end + context 'with default enable_new_services parameter' do + it { is_expected.to contain_nova_config('DEFAULT/enable_new_services').with_value('') } + end + + context 'with enable_new_services parameter set to false' do + let :params do + { :enable_new_services => false } + end + + it { is_expected.to contain_nova_config('DEFAULT/enable_new_services').with_value(false) } + end + context 'with default database parameters' do let :pre_condition do "include nova"