From 1ae57a6e789b0bb2f4abe01c8d2314cca776edb9 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Thu, 30 Jun 2016 11:09:01 -0600 Subject: [PATCH] Add memcached_servers for keystone authtoken This change adds the abiltity to manage the memcached servers for the keystone authtoken configuration in ceilometer::api Change-Id: I5fe1ec35630a67fe08b5c7b475593c34044110e8 --- manifests/api.pp | 7 +++++++ ...keystone-authtoken-memcached-ab13c488a438804d.yaml | 4 ++++ spec/classes/ceilometer_api_spec.rb | 11 +++++++++++ 3 files changed, 22 insertions(+) create mode 100644 releasenotes/notes/keystone-authtoken-memcached-ab13c488a438804d.yaml diff --git a/manifests/api.pp b/manifests/api.pp index 4297bf8e..f833f6f5 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -27,6 +27,11 @@ # [*keystone_password*] # (Required) Password to authenticate with. # +# [*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. +# # [*auth_uri*] # (Optional) Public Identity API endpoint. # Defaults to 'http://127.0.0.1:5000/'. @@ -77,6 +82,7 @@ class ceilometer::api ( $keystone_user = 'ceilometer', $keystone_tenant = 'services', $keystone_password = false, + $memcached_servers = $::os_service_default, $auth_uri = 'http://127.0.0.1:5000/', $identity_uri = 'http://127.0.0.1:35357/', $host = '0.0.0.0', @@ -145,6 +151,7 @@ class ceilometer::api ( 'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant; 'keystone_authtoken/admin_user' : value => $keystone_user; 'keystone_authtoken/admin_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-ab13c488a438804d.yaml b/releasenotes/notes/keystone-authtoken-memcached-ab13c488a438804d.yaml new file mode 100644 index 00000000..a136f7de --- /dev/null +++ b/releasenotes/notes/keystone-authtoken-memcached-ab13c488a438804d.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - Added the ability to manage the memcached servers + for keystone_authtoken in ceilometer::api diff --git a/spec/classes/ceilometer_api_spec.rb b/spec/classes/ceilometer_api_spec.rb index 27b70e8e..34a56dfd 100644 --- a/spec/classes/ceilometer_api_spec.rb +++ b/spec/classes/ceilometer_api_spec.rb @@ -44,6 +44,7 @@ describe 'ceilometer::api' do is_expected.to contain_ceilometer_config('keystone_authtoken/admin_password').with_value( params[:keystone_password] ).with_secret(true) is_expected.to contain_ceilometer_config('keystone_authtoken/auth_uri').with_value("http://127.0.0.1:5000/") is_expected.to contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("http://127.0.0.1:35357/") + is_expected.to contain_ceilometer_config('keystone_authtoken/memcached_servers').with_value('') is_expected.to contain_ceilometer_config('api/host').with_value( params[:host] ) is_expected.to contain_ceilometer_config('api/port').with_value( params[:port] ) is_expected.to contain_ceilometer_config('api/workers').with_value('') @@ -69,6 +70,16 @@ describe 'ceilometer::api' do end end + context 'with memcached servers' do + before do + params.merge!({ :memcached_servers => '1.1.1.1:11211', }) + end + + it 'configures ceilometer-api service' do + is_expected.to contain_ceilometer_config('keystone_authtoken/memcached_servers').with_value('1.1.1.1:11211') + end + end + context 'with disabled service managing' do before do params.merge!({