From 57f5853a4e64c6064b0d8aada6362bdf8bcb9290 Mon Sep 17 00:00:00 2001 From: Pranali Deore Date: Fri, 21 Dec 2018 12:53:04 +0530 Subject: [PATCH] Add missing glance cinder store settings In case of cinder backend of glance, for public images, cinder should have dedicated tenant for glance. So adding below conf params for cinder backend, - cinder_store_project_name - cinder_store_user_name - cinder_store_password Closes-Bug: #1809104 Change-Id: I474806d74c2815ca8899b74ee619e5107d81cc24 --- manifests/backend/cinder.pp | 21 +++++++++++++++++++ ...inder-store-settings-f7aef33ec122a39a.yaml | 11 ++++++++++ spec/classes/glance_backend_cinder_spec.rb | 15 +++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 releasenotes/notes/add-missing-cinder-store-settings-f7aef33ec122a39a.yaml diff --git a/manifests/backend/cinder.pp b/manifests/backend/cinder.pp index a8fe7e54..d20ac9c9 100644 --- a/manifests/backend/cinder.pp +++ b/manifests/backend/cinder.pp @@ -52,6 +52,18 @@ # Should be a valid boolean value # Defaults to $::os_service_default. # +# [*cinder_store_project_name*] +# (optional) Project name where the image volume is stored in cinder. +# Defaults to $::os_service_default. +# +# [*cinder_store_user_name*] +# (optional) User name to authenticate against cinder. +# Defaults to $::os_service_default. +# +# [*cinder_store_password*] +# (optional) A valid password for the user specified by `cinder_store_user_name' +# Defaults to $::os_service_default. +# # [*multi_store*] # (optional) Boolean describing if multiple backends will be configured # Defaults to false @@ -63,6 +75,9 @@ class glance::backend::cinder( $cinder_catalog_info = $::os_service_default, $cinder_endpoint_template = $::os_service_default, $cinder_http_retries = $::os_service_default, + $cinder_store_project_name = $::os_service_default, + $cinder_store_user_name = $::os_service_default, + $cinder_store_password = $::os_service_default, $multi_store = false, ) { @@ -78,6 +93,9 @@ class glance::backend::cinder( 'glance_store/cinder_http_retries': value => $cinder_http_retries; 'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template; 'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; + 'glance_store/cinder_store_project_name': value => $cinder_store_project_name; + 'glance_store/cinder_store_user_name': value => $cinder_store_user_name; + 'glance_store/cinder_store_password': value => $cinder_store_password; } if !$multi_store { @@ -90,6 +108,9 @@ class glance::backend::cinder( 'glance_store/cinder_http_retries': value => $cinder_http_retries; 'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template; 'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file; + 'glance_store/cinder_store_project_name': value => $cinder_store_project_name; + 'glance_store/cinder_store_user_name': value => $cinder_store_user_name; + 'glance_store/cinder_store_password': value => $cinder_store_password; } } diff --git a/releasenotes/notes/add-missing-cinder-store-settings-f7aef33ec122a39a.yaml b/releasenotes/notes/add-missing-cinder-store-settings-f7aef33ec122a39a.yaml new file mode 100644 index 00000000..df164b3b --- /dev/null +++ b/releasenotes/notes/add-missing-cinder-store-settings-f7aef33ec122a39a.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + Add new parameter 'cinder_store_project_name', for project + name where the image volume is stored in cinder. + + Add new parameter 'cinder_store_user_name', for user name + to authenticate against cinder. + + Add new parameter 'cinder_store_password', for valid password + for the user specified by 'cinder_store_user_name' diff --git a/spec/classes/glance_backend_cinder_spec.rb b/spec/classes/glance_backend_cinder_spec.rb index 1519cdc1..2b908386 100644 --- a/spec/classes/glance_backend_cinder_spec.rb +++ b/spec/classes/glance_backend_cinder_spec.rb @@ -38,6 +38,9 @@ describe 'glance::backend::cinder' do is_expected.to contain_glance_api_config('glance_store/cinder_http_retries').with_value('') is_expected.to contain_glance_api_config('glance_store/cinder_ca_certificates_file').with_value('') is_expected.to contain_glance_api_config('glance_store/cinder_endpoint_template').with_value('') + is_expected.to contain_glance_api_config('glance_store/cinder_store_project_name').with_value('') + is_expected.to contain_glance_api_config('glance_store/cinder_store_user_name').with_value('') + is_expected.to contain_glance_api_config('glance_store/cinder_store_password').with_value('') end it 'configures glance-cache.conf' do is_expected.to contain_glance_cache_config('glance_store/cinder_api_insecure').with_value('') @@ -45,6 +48,9 @@ describe 'glance::backend::cinder' do is_expected.to contain_glance_cache_config('glance_store/cinder_http_retries').with_value('') is_expected.to contain_glance_cache_config('glance_store/cinder_ca_certificates_file').with_value('') is_expected.to contain_glance_cache_config('glance_store/cinder_endpoint_template').with_value('') + is_expected.to contain_glance_cache_config('glance_store/cinder_store_project_name').with_value('') + is_expected.to contain_glance_cache_config('glance_store/cinder_store_user_name').with_value('') + is_expected.to contain_glance_cache_config('glance_store/cinder_store_password').with_value('') end end @@ -56,6 +62,9 @@ describe 'glance::backend::cinder' do :cinder_catalog_info => 'volume:cinder:internalURL', :cinder_endpoint_template => 'http://srv-foo:8776/v1/%(project_id)s', :cinder_http_retries => '10', + :cinder_store_project_name => 'services', + :cinder_store_user_name => 'glance', + :cinder_store_password => 'glance', } end it 'configures glance-api.conf' do @@ -64,6 +73,9 @@ describe 'glance::backend::cinder' do is_expected.to contain_glance_api_config('glance_store/cinder_catalog_info').with_value('volume:cinder:internalURL') is_expected.to contain_glance_api_config('glance_store/cinder_endpoint_template').with_value('http://srv-foo:8776/v1/%(project_id)s') is_expected.to contain_glance_api_config('glance_store/cinder_http_retries').with_value('10') + is_expected.to contain_glance_api_config('glance_store/cinder_store_project_name').with_value('services') + is_expected.to contain_glance_api_config('glance_store/cinder_store_user_name').with_value('glance') + is_expected.to contain_glance_api_config('glance_store/cinder_store_password').with_value('glance') end it 'configures glance-cache.conf' do is_expected.to contain_glance_cache_config('glance_store/cinder_api_insecure').with_value(true) @@ -71,6 +83,9 @@ describe 'glance::backend::cinder' do is_expected.to contain_glance_cache_config('glance_store/cinder_catalog_info').with_value('volume:cinder:internalURL') is_expected.to contain_glance_cache_config('glance_store/cinder_endpoint_template').with_value('http://srv-foo:8776/v1/%(project_id)s') is_expected.to contain_glance_cache_config('glance_store/cinder_http_retries').with_value('10') + is_expected.to contain_glance_cache_config('glance_store/cinder_store_project_name').with_value('services') + is_expected.to contain_glance_cache_config('glance_store/cinder_store_user_name').with_value('glance') + is_expected.to contain_glance_cache_config('glance_store/cinder_store_password').with_value('glance') end end end