Add memcached_servers for keystone authtoken

This change adds the abiltity to manage the memcached servers for the
keystone authtoken configuration in ironic::api

Change-Id: I43af512ffd7662366534128ef2e5836d5a506252
This commit is contained in:
Alex Schultz 2016-06-30 12:43:53 -06:00
parent d81740b4aa
commit 95d0af7ec8
3 changed files with 22 additions and 7 deletions

View File

@ -64,6 +64,11 @@
# (optional) The name of the user to create in keystone for use by the ironic services
# Defaults to 'ironic'
#
# [*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.
#
# [*neutron_url*]
# (optional) The Neutron URL to be used for requests from ironic
# Defaults to 'http://127.0.0.1:9696/'
@ -101,6 +106,7 @@ class ironic::api (
$identity_uri = 'http://127.0.0.1:35357/',
$admin_tenant_name = 'services',
$admin_user = 'ironic',
$memcached_servers = $::os_service_default,
$neutron_url = 'http://127.0.0.1:9696/',
$public_endpoint = $::os_service_default,
$admin_password,
@ -174,6 +180,7 @@ class ironic::api (
'keystone_authtoken/admin_password': value => $admin_password, secret => true;
'keystone_authtoken/auth_uri': value => $auth_uri;
'keystone_authtoken/identity_uri': value => $identity_uri;
'keystone_authtoken/memcached_servers': value => join(any2array($memcached_servers), ',');
'neutron/url': value => $neutron_url;
}

View File

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

View File

@ -72,19 +72,21 @@ describe 'ironic::api' do
is_expected.to contain_ironic_config('keystone_authtoken/admin_user').with_value(p[:admin_user])
is_expected.to contain_ironic_config('keystone_authtoken/auth_uri').with_value('http://127.0.0.1:5000/')
is_expected.to contain_ironic_config('keystone_authtoken/identity_uri').with_value('http://127.0.0.1:35357/')
is_expected.to contain_ironic_config('keystone_authtoken/memcached_servers').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('neutron/url').with_value('http://127.0.0.1:9696/')
end
context 'when overriding parameters' do
before :each do
params.merge!(
:port => '3430',
:host_ip => '127.0.0.1',
:max_limit => '10',
:workers => '8',
:auth_uri => 'https://1.2.3.4:5000/',
:identity_uri => 'https://1.2.3.4:35357/',
:public_endpoint => 'https://1.2.3.4:6385/',
:port => '3430',
:host_ip => '127.0.0.1',
:max_limit => '10',
:workers => '8',
:auth_uri => 'https://1.2.3.4:5000/',
:identity_uri => 'https://1.2.3.4:35357/',
:public_endpoint => 'https://1.2.3.4:6385/',
:memcached_servers => '1.1.1.1:11211',
)
end
it 'should replace default parameter with new value' do
@ -95,6 +97,7 @@ describe 'ironic::api' do
is_expected.to contain_ironic_config('api/public_endpoint').with_value(p[:public_endpoint])
is_expected.to contain_ironic_config('keystone_authtoken/auth_uri').with_value('https://1.2.3.4:5000/')
is_expected.to contain_ironic_config('keystone_authtoken/identity_uri').with_value('https://1.2.3.4:35357/')
is_expected.to contain_ironic_config('keystone_authtoken/memcached_servers').with_value('1.1.1.1:11211')
end
end