From 6a91ac0d8293d24c7327b2ab830b4798a0992d2b Mon Sep 17 00:00:00 2001 From: Michael Chapman Date: Wed, 30 Oct 2013 15:10:41 +1100 Subject: [PATCH] Ensure keystone endpoint set before service starts As neutron-server is mostly useless without having the keystone service+endpoint set, in the case where both keystone and neutron-server are on the same machine, this patch adds a soft dependency to ensure that the keystone catalog includes neutron This has a knock on effect of fixing openstack::provisioner, which would sometimes try to create neutron networks, the type for which soft depends on neutron-server, without there being an endpoint set in the keystone catalog Change-Id: I658e1b3e2c448b9a7da9e013c4e105b9ec824893 --- manifests/keystone/auth.pp | 1 + spec/classes/neutron_keystone_auth_spec.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 710dc3ff5..a49571287 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -60,6 +60,7 @@ class neutron::keystone::auth ( ) { Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'neutron-server' |> + Keystone_endpoint["${region}/${auth_name}"] ~> Service <| name == 'neutron-server' |> if ! $public_port { $real_public_port = $port diff --git a/spec/classes/neutron_keystone_auth_spec.rb b/spec/classes/neutron_keystone_auth_spec.rb index c5a6b5f12..9e0111b3f 100644 --- a/spec/classes/neutron_keystone_auth_spec.rb +++ b/spec/classes/neutron_keystone_auth_spec.rb @@ -36,6 +36,25 @@ describe 'neutron::keystone::auth' do end + describe 'when configuring neutron-server' do + let :pre_condition do + "class { 'neutron::server': auth_password => 'test' }" + end + + let :facts do + { :osfamily => 'Debian' } + end + + let :params do + { + :password => 'neutron_password', + :tenant => 'foobar' + } + end + + it { should contain_keystone_endpoint('RegionOne/neutron').with_notify('Service[neutron-server]') } + end + describe 'when overriding public_protocol, public_port and public address' do let :params do