From ee72866fc28d41cb3a83f59fc91b227d9490defa Mon Sep 17 00:00:00 2001 From: Daneyon Hansen Date: Mon, 5 Aug 2013 20:52:40 +0000 Subject: [PATCH] Fix Swift Keystone Authentication Endpoints Previously, the swift admin and internal auth endpoints would default to internal_address. This causes problems where a different IP address is used for the swift public address and a controller address is being used for the internal_address. In this situation, swift admin/internal auth endpoints use the controller address, instead of the swift public address. Change-Id: I903748bf390180c4db9fff4fcb626727f6feb41f --- manifests/controller.pp | 16 ++++++++++++--- spec/classes/openstack_controller_spec.rb | 24 ++++++++++++++--------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/manifests/controller.pp b/manifests/controller.pp index a2d2e4e..c6b11d3 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -108,7 +108,15 @@ # (Optional) Defaults to false. Required if swift is set to true. # # [swift_public_address] -# The swift address used to populate the keystone service catalog. +# The swift public endpoint address used to populate the keystone service catalog. +# (optional). Defaults to false. +# +# [swift_internal_address] +# The swift internal endpoint address used to populate the keystone service catalog. +# (optional). Defaults to false. +# +# [swift_admin_address] +# The swift admin endpoint address used to populate the keystone service catalog. # (optional). Defaults to false. # # === Examples @@ -243,6 +251,8 @@ class openstack::controller ( # swift $swift = false, $swift_public_address = false, + $swift_internal_address = false, + $swift_admin_address = false, $enabled = true ) { @@ -343,8 +353,8 @@ class openstack::controller ( swift => $swift, swift_user_password => $swift_user_password, swift_public_address => $swift_public_address, - swift_internal_address => $internal_address_real, - swift_admin_address => $admin_address_real, + swift_internal_address => $swift_internal_address, + swift_admin_address => $swift_admin_address, enabled => $enabled, bind_host => $keystone_bind_address, } diff --git a/spec/classes/openstack_controller_spec.rb b/spec/classes/openstack_controller_spec.rb index 113fc2d..fa904a3 100644 --- a/spec/classes/openstack_controller_spec.rb +++ b/spec/classes/openstack_controller_spec.rb @@ -183,9 +183,11 @@ describe 'openstack::controller' do it 'should configure default keystone configuration' do should contain_class('openstack::keystone').with( - :swift => false, - :swift_user_password => false, - :swift_public_address => false + :swift => false, + :swift_user_password => false, + :swift_public_address => false, + :swift_internal_address => false, + :swift_admin_address => false ) should contain_class('keystone').with( @@ -228,16 +230,20 @@ describe 'openstack::controller' do context 'when configuring swift' do before :each do params.merge!( - :swift => true, - :swift_user_password => 'foo', - :swift_public_address => '10.0.0.2' + :swift => true, + :swift_user_password => 'foo', + :swift_public_address => '10.0.0.2', + :swift_internal_address => '10.0.0.2', + :swift_admin_address => '10.0.0.2' ) end it 'should configure swift auth in keystone' do should contain_class('openstack::keystone').with( - :swift => true, - :swift_user_password => 'foo', - :swift_public_address => '10.0.0.2' + :swift => true, + :swift_user_password => 'foo', + :swift_public_address => '10.0.0.2', + :swift_internal_address => '10.0.0.2', + :swift_admin_address => '10.0.0.2' ) end end