From 79983f1bb5f4730d76bcd71d8bf42b198d49a894 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Mon, 24 Sep 2018 18:29:27 +0200 Subject: [PATCH] Add enable_new_services config option Adds the enable_new_services config option to the DEFAULT section which can be used to set if newly created cinder services should be enabled by default. Change-Id: I60bd4adbf319b8c83b6c089ad788add3ea443378 --- manifests/init.pp | 6 ++++++ .../add-enable-new-services-config-0dffaadac7fa49ea.yaml | 5 +++++ spec/classes/cinder_init_spec.rb | 8 ++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/add-enable-new-services-config-0dffaadac7fa49ea.yaml diff --git a/manifests/init.pp b/manifests/init.pp index e1a5f664..0c29521f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -248,6 +248,10 @@ # not necessarily a host name, FQDN, or IP address. # Defaults to $::os_service_default. # +# [*enable_new_services*] +# (optional) Services to be added to the available pool on create. +# Defaults to $::os_service_default +# # [*purge_config*] # (optional) Whether to set only the specified config options # in the cinder config. @@ -312,6 +316,7 @@ class cinder ( $lock_path = $::cinder::params::lock_path, $image_conversion_dir = $::os_service_default, $host = $::os_service_default, + $enable_new_services = $::os_service_default, $purge_config = false, $backend_host = $::os_service_default, ) inherits cinder::params { @@ -385,6 +390,7 @@ class cinder ( 'DEFAULT/allow_availability_zone_fallback': value => $allow_availability_zone_fallback; 'DEFAULT/image_conversion_dir': value => $image_conversion_dir; 'DEFAULT/host': value => $host; + 'DEFAULT/enable_new_services': value => $enable_new_services; # NOTE(abishop): $backend_host is not written here because it is not a valid # DEFAULT option. It is only recognized in the backend sections. Instead, diff --git a/releasenotes/notes/add-enable-new-services-config-0dffaadac7fa49ea.yaml b/releasenotes/notes/add-enable-new-services-config-0dffaadac7fa49ea.yaml new file mode 100644 index 00000000..84df697a --- /dev/null +++ b/releasenotes/notes/add-enable-new-services-config-0dffaadac7fa49ea.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added new parameter cinder::enable_new_services that can be used to set + the enable_new_services configuration option in the DEFAULT section. diff --git a/spec/classes/cinder_init_spec.rb b/spec/classes/cinder_init_spec.rb index 487c5fc8..4ea5ccf1 100644 --- a/spec/classes/cinder_init_spec.rb +++ b/spec/classes/cinder_init_spec.rb @@ -47,6 +47,8 @@ describe 'cinder' do is_expected.to contain_cinder_config('DEFAULT/default_availability_zone').with(:value => 'nova') is_expected.to contain_cinder_config('DEFAULT/allow_availability_zone_fallback').with(:value => '') is_expected.to contain_cinder_config('DEFAULT/api_paste_config').with(:value => '/etc/cinder/api-paste.ini') + is_expected.to contain_cinder_config('DEFAULT/host').with_value('') + is_expected.to contain_cinder_config('DEFAULT/enable_new_services').with_value('') is_expected.to contain_cinder_config('oslo_concurrency/lock_path').with(:value => '/var/lock/cinder') # backend_host should not be written to DEFAULT section @@ -237,14 +239,16 @@ describe 'cinder' do it { is_expected.to contain_cinder_config('DEFAULT/image_conversion_dir').with_value('/tmp/foo') } end - describe 'with host' do + describe 'with host and enable_new_services' do let :params do req_params.merge({ - :host => 'mystring', + :host => 'mystring', + :enable_new_services => true, }) end it { is_expected.to contain_cinder_config('DEFAULT/host').with_value('mystring') } + it { is_expected.to contain_cinder_config('DEFAULT/enable_new_services').with_value(true) } end describe 'with transport_url' do