Make Keystone_endpoint match service by name/type

Since a chance in puppet-keystone (1], we now match an endpoint with a
service name/type.
)
[1] http://git.openstack.org/cgit/openstack/puppet-keystone/commit/?id=0a4e06abb0f5b3f324464ff5219d2885816311ce

Also:
require package before config file Before trying to build the guestagent
config file from the template with Puppet, first install the package so
we make sure /etc/trove is ready. Otherwise, Puppet will randomly fail
to create the file, if the package is not installed yet.

We need to squash the two changes otherwise CI will never pass.
Change-Id: I9662c684c83933ffe6ede0337bc1770dd65b0ce7
Closes-Bug: #1528308
This commit is contained in:
Emilien Macchi 2015-12-21 20:50:32 +01:00
parent d87726b6d7
commit c73c228ae7
3 changed files with 12 additions and 12 deletions

View File

@ -202,7 +202,7 @@ class trove::keystone::auth (
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'trove-server' |>
Keystone_endpoint<| title == "${region}/${real_service_name}" |>
Keystone_endpoint<| title == "${region}/${real_service_name}::${service_type}" |>
~> Service <| name == 'trove-server' |>
keystone::resource::service_identity { 'trove':

View File

@ -288,7 +288,8 @@ class trove::taskmanager(
if $guestagent_config_file {
if $use_guestagent_template {
file { $guestagent_config_file:
content => template('trove/trove-guestagent.conf.erb')
content => template('trove/trove-guestagent.conf.erb'),
require => Package[$::trove::params::taskmanager_package_name]
}
} else {
class {'::trove::guestagent':

View File

@ -42,13 +42,12 @@ describe 'trove::keystone::auth' do
:roles => ['admin']
)}
it { is_expected.to contain_keystone_service('trove').with(
it { is_expected.to contain_keystone_service('trove::database').with(
:ensure => 'present',
:type => 'database',
:description => 'Trove Database Service'
) }
it { is_expected.to contain_keystone_endpoint('RegionOne/trove').with(
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
:ensure => 'present',
:public_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s",
:admin_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s",
@ -75,7 +74,7 @@ describe 'trove::keystone::auth' do
:admin_url => 'http://10.10.10.12:81/v1.0/%(tenant_id)s' }
end
it { is_expected.to contain_keystone_endpoint('RegionOne/trove').with(
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
:ensure => 'present',
:public_url => 'https://10.10.10.10:80/v1.0/%(tenant_id)s',
:internal_url => 'http://10.10.10.11:81/v1.0/%(tenant_id)s',
@ -96,7 +95,7 @@ describe 'trove::keystone::auth' do
:admin_address => '10.10.10.12' }
end
it { is_expected.to contain_keystone_endpoint('RegionOne/trove').with(
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
:ensure => 'present',
:public_url => 'https://10.10.10.10:80/v1.0/%(tenant_id)s',
:internal_url => 'https://10.10.10.11:81/v1.0/%(tenant_id)s',
@ -112,8 +111,8 @@ describe 'trove::keystone::auth' do
it { is_expected.to contain_keystone_user('trovey') }
it { is_expected.to contain_keystone_user_role('trovey@services') }
it { is_expected.to contain_keystone_service('trovey') }
it { is_expected.to contain_keystone_endpoint('RegionOne/trovey') }
it { is_expected.to contain_keystone_service('trovey::database') }
it { is_expected.to contain_keystone_endpoint('RegionOne/trovey::database') }
end
describe 'when overriding service name' do
@ -125,8 +124,8 @@ describe 'trove::keystone::auth' do
it { is_expected.to contain_keystone_user('trove') }
it { is_expected.to contain_keystone_user_role('trove@services') }
it { is_expected.to contain_keystone_service('trove_service') }
it { is_expected.to contain_keystone_endpoint('RegionOne/trove_service') }
it { is_expected.to contain_keystone_service('trove_service::database') }
it { is_expected.to contain_keystone_endpoint('RegionOne/trove_service::database') }
end
describe 'when disabling endpoint configuration' do
@ -135,6 +134,6 @@ describe 'trove::keystone::auth' do
:password => 'trove_password' }
end
it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron') }
it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron::database') }
end
end