From d9d6f2ae3860dd8353dec423d6717b51dcc7c37f Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Thu, 2 Jul 2015 16:12:46 -0500 Subject: [PATCH] Add ability to specify auth_region This change adds the ability to specify auth_region in neutron.conf. Change-Id: I475ba151a1fe841b3f84e301a9e68fdf05f5afa4 Closes-Bug: 1471018 --- manifests/server.pp | 12 ++++++++++++ spec/classes/neutron_server_spec.rb | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/manifests/server.pp b/manifests/server.pp index d159aa747..1ca854970 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -52,6 +52,11 @@ # (where '/keystone' is the admin prefix) # Defaults to false for empty. If defined, should be a string with a leading '/' and no trailing '/'. # +# [*auth_region*] +# (optional) The authentication region. Note this value is case-sensitive and +# must match the endpoint region defined in Keystone. +# Defaults to undef +# # [*auth_tenant*] # (optional) The tenant of the auth user # Defaults to services @@ -196,6 +201,7 @@ class neutron::server ( $manage_service = true, $service_name = $::neutron::params::server_service, $auth_password = false, + $auth_region = undef, $auth_type = 'keystone', $auth_tenant = 'services', $auth_user = 'neutron', @@ -471,6 +477,12 @@ class neutron::server ( 'filter:authtoken/auth_uri': value => $auth_uri_real; } + if $auth_region { + neutron_config { + 'keystone_authtoken/auth_region': value => $auth_region; + } + } + if $identity_uri { neutron_config { 'keystone_authtoken/identity_uri': value => $identity_uri; diff --git a/spec/classes/neutron_server_spec.rb b/spec/classes/neutron_server_spec.rb index 0e256aae1..ad0fbe1fa 100644 --- a/spec/classes/neutron_server_spec.rb +++ b/spec/classes/neutron_server_spec.rb @@ -316,6 +316,20 @@ describe 'neutron::server' do end end + describe "with custom auth region" do + let :facts do + default_facts.merge({ :osfamily => 'RedHat' }) + end + before do + params.merge!({ + :auth_region => 'MyRegion', + }) + end + it 'configures auth_region' do + is_expected.to contain_neutron_config('keystone_authtoken/auth_region').with_value('MyRegion'); + end + end + context 'on Debian platforms' do let :facts do default_facts.merge(