From cabf6d6b6cedf71629bd8c9379959b63440adb78 Mon Sep 17 00:00:00 2001 From: Michael Chapman Date: Wed, 30 Oct 2013 15:45:21 +1100 Subject: [PATCH] Ensure keystone endpoint set before service starts This patch ensures that in the case where keystone and glance-api are on the same node, nova-api is not started until the keystone catalog contains the image service and endpoint required to use glance. Change-Id: I48ae07b2d7789d549a4412a21e842a1222a48caa --- manifests/keystone/auth.pp | 1 + spec/classes/glance_keystone_auth_spec.rb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 84c16156..5b22aaa4 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -31,6 +31,7 @@ class glance::keystone::auth( Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'glance-registry' |> Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'glance-api' |> + Keystone_endpoint["${region}/${auth_name}"] ~> Service <| name == 'glance-api' |> keystone_user { $auth_name: ensure => present, diff --git a/spec/classes/glance_keystone_auth_spec.rb b/spec/classes/glance_keystone_auth_spec.rb index 14cd957a..c6e8fbfa 100644 --- a/spec/classes/glance_keystone_auth_spec.rb +++ b/spec/classes/glance_keystone_auth_spec.rb @@ -95,4 +95,22 @@ describe 'glance::keystone::auth' do it { should_not contain_keystone_endpoint('glance') } end + describe 'when configuring glance-api and the keystone endpoint' do + let :pre_condition do + "class { 'glance::api': keystone_password => 'test' }" + end + + let :facts do + { :osfamily => 'Debian' } + end + + let :params do + { + :password => 'test', + :configure_endpoint => true + } + end + + it { should contain_keystone_endpoint('RegionOne/glance').with_notify('Service[glance-api]') } + end end