Merge "Adds ability to override service name for service catalog"

This commit is contained in:
Jenkins 2015-03-30 18:55:08 +00:00 committed by Gerrit Code Review
commit 6b68e9ba9e
2 changed files with 22 additions and 1 deletions

View File

@ -16,6 +16,10 @@
# [*configure_endpoint*]
# Should designate endpoint be configured? Optional. Defaults to 'true'.
#
# [*service_name*]
# (optional) Name of the service.
# Defaults to the value of auth_name.
#
# [*service_type*]
# Type of service. Optional. Defaults to 'metering'.
#
@ -53,6 +57,7 @@ class designate::keystone::auth (
$password = false,
$email = 'designate@localhost',
$auth_name = 'designate',
$service_name = undef,
$service_type = 'dns',
$public_address = '127.0.0.1',
$admin_address = '127.0.0.1',
@ -67,17 +72,20 @@ class designate::keystone::auth (
$configure_endpoint = true
) {
$real_service_name = pick($service_name, $auth_name)
Keystone_user_role["${auth_name}@${tenant}"] ~>
Service <| name == 'designate-api' |>
keystone::resource::service_identity { $auth_name:
keystone::resource::service_identity { 'designate':
configure_user => true,
configure_user_role => true,
configure_endpoint => $configure_endpoint,
service_name => $real_service_name,
service_type => $service_type,
service_description => 'Openstack DNSaas Service',
region => $region,
auth_name => $auth_name,
password => $password,
email => $email,
tenant => $tenant,

View File

@ -80,4 +80,17 @@ describe 'designate::keystone::auth' do
it { is_expected.to contain_keystone_service('designate1') }
it { is_expected.to contain_keystone_endpoint('RegionOne/designate1') }
end
describe 'when overriding service name' do
let :params do
{ :service_name => 'designate_service',
:password => 'foo',
:auth_name => 'designate1' }
end
it { is_expected.to contain_keystone_user('designate1') }
it { is_expected.to contain_keystone_user_role('designate1@services') }
it { is_expected.to contain_keystone_service('designate_service') }
it { is_expected.to contain_keystone_endpoint('RegionOne/designate_service') }
end
end