From 95d0af7ec87399f89a0628b415fe8b7a819afa17 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Thu, 30 Jun 2016 12:43:53 -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 ironic::api Change-Id: I43af512ffd7662366534128ef2e5836d5a506252 --- manifests/api.pp | 7 +++++++ ...ne-authtoken-memcached-d1cf897d37c4f1ce.yaml | 5 +++++ spec/classes/ironic_api_spec.rb | 17 ++++++++++------- 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/keystone-authtoken-memcached-d1cf897d37c4f1ce.yaml diff --git a/manifests/api.pp b/manifests/api.pp index 1046ea20..f3a28ecb 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -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; } diff --git a/releasenotes/notes/keystone-authtoken-memcached-d1cf897d37c4f1ce.yaml b/releasenotes/notes/keystone-authtoken-memcached-d1cf897d37c4f1ce.yaml new file mode 100644 index 00000000..799c7e0a --- /dev/null +++ b/releasenotes/notes/keystone-authtoken-memcached-d1cf897d37c4f1ce.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Added the ability to manage the memcached servers + for keystone_authtoken in ironic::api + diff --git a/spec/classes/ironic_api_spec.rb b/spec/classes/ironic_api_spec.rb index f6581cf6..15438ea2 100644 --- a/spec/classes/ironic_api_spec.rb +++ b/spec/classes/ironic_api_spec.rb @@ -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('') 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