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
This commit is contained in:
Alex Schultz 2016-06-30 11:09:01 -06:00
parent d190eac05d
commit 1ae57a6e78
3 changed files with 22 additions and 0 deletions

View File

@ -27,6 +27,11 @@
# [*keystone_password*] # [*keystone_password*]
# (Required) Password to authenticate with. # (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*] # [*auth_uri*]
# (Optional) Public Identity API endpoint. # (Optional) Public Identity API endpoint.
# Defaults to 'http://127.0.0.1:5000/'. # Defaults to 'http://127.0.0.1:5000/'.
@ -77,6 +82,7 @@ class ceilometer::api (
$keystone_user = 'ceilometer', $keystone_user = 'ceilometer',
$keystone_tenant = 'services', $keystone_tenant = 'services',
$keystone_password = false, $keystone_password = false,
$memcached_servers = $::os_service_default,
$auth_uri = 'http://127.0.0.1:5000/', $auth_uri = 'http://127.0.0.1:5000/',
$identity_uri = 'http://127.0.0.1:35357/', $identity_uri = 'http://127.0.0.1:35357/',
$host = '0.0.0.0', $host = '0.0.0.0',
@ -145,6 +151,7 @@ class ceilometer::api (
'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant; 'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant;
'keystone_authtoken/admin_user' : value => $keystone_user; 'keystone_authtoken/admin_user' : value => $keystone_user;
'keystone_authtoken/admin_password' : value => $keystone_password, secret => true; 'keystone_authtoken/admin_password' : value => $keystone_password, secret => true;
'keystone_authtoken/memcached_servers' : value => join(any2array($memcached_servers), ',');
'api/host' : value => $host; 'api/host' : value => $host;
'api/port' : value => $port; 'api/port' : value => $port;
} }

View File

@ -0,0 +1,4 @@
---
fixes:
- Added the ability to manage the memcached servers
for keystone_authtoken in ceilometer::api

View File

@ -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/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/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/identity_uri').with_value("http://127.0.0.1:35357/")
is_expected.to contain_ceilometer_config('keystone_authtoken/memcached_servers').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ceilometer_config('api/host').with_value( params[:host] ) 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/port').with_value( params[:port] )
is_expected.to contain_ceilometer_config('api/workers').with_value('<SERVICE DEFAULT>') is_expected.to contain_ceilometer_config('api/workers').with_value('<SERVICE DEFAULT>')
@ -69,6 +70,16 @@ describe 'ceilometer::api' do
end end
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 context 'with disabled service managing' do
before do before do
params.merge!({ params.merge!({