diff --git a/manifests/api.pp b/manifests/api.pp index 5c4f98bd..56080f46 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -43,6 +43,11 @@ # (optional) URL used by the plugin to know where to authenticate the service user. # Defaults to $::os_service_default. # +# [*memcached_servers*] +# (optinal) a list of memcached server(s) to use for caching. If left +# undefined, tokens will instead be cached in-process. +# Defaults to $::os_service_default. +# # [*host*] # (optional) The aodh api bind address. # Defaults to 0.0.0.0 @@ -84,6 +89,7 @@ class aodh::api ( $keystone_password = false, $keystone_auth_uri = false, $keystone_auth_url = $::os_service_default, + $memcached_servers = $::os_service_default, $keystone_project_domain_name = 'default', $keystone_user_domain_name = 'default', $keystone_auth_type = 'password', @@ -166,6 +172,7 @@ class aodh::api ( 'keystone_authtoken/auth_type' : value => $keystone_auth_type; 'keystone_authtoken/username' : value => $keystone_user; 'keystone_authtoken/password' : value => $keystone_password, secret => true; + 'keystone_authtoken/memcached_servers' : value => join(any2array($memcached_servers), ','); 'api/host' : value => $host; 'api/port' : value => $port; } diff --git a/releasenotes/notes/keystone-authtoken-memcached-5c6b99784f80be7f.yaml b/releasenotes/notes/keystone-authtoken-memcached-5c6b99784f80be7f.yaml new file mode 100644 index 00000000..affc340c --- /dev/null +++ b/releasenotes/notes/keystone-authtoken-memcached-5c6b99784f80be7f.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - Added the ability to manage the memcached servers + for keystone_authtoken in aodh::api diff --git a/spec/classes/aodh_api_spec.rb b/spec/classes/aodh_api_spec.rb index 9156b1a6..460699aa 100644 --- a/spec/classes/aodh_api_spec.rb +++ b/spec/classes/aodh_api_spec.rb @@ -47,6 +47,7 @@ describe 'aodh::api' do is_expected.to contain_aodh_config('keystone_authtoken/project_domain_name').with_value( params[:keystone_project_domain_name] ) is_expected.to contain_aodh_config('keystone_authtoken/user_domain_name').with_value( params[:keystone_user_domain_name] ) is_expected.to contain_aodh_config('keystone_authtoken/auth_type').with_value( params[:keystone_auth_type] ) + is_expected.to contain_aodh_config('keystone_authtoken/memcached_servers').with_value('') is_expected.to contain_aodh_config('api/host').with_value( params[:host] ) is_expected.to contain_aodh_config('api/port').with_value( params[:port] ) end @@ -146,6 +147,17 @@ describe 'aodh::api' do end end + context "with memcached servers" do + before do + params.merge!({ + :memcached_servers => '1.1.1.1:11211', + }) + end + it 'configures auth_uri but deprecates old auth settings' do + is_expected.to contain_aodh_config('keystone_authtoken/memcached_servers').with_value('1.1.1.1:11211'); + end + end + context "with deprecated keystone auth_uri" do before do params.merge!({