Adds ability to override service name for service catalog
Instead of forcing the name of the service in the service catalog to match auth_name, this allows the ability to explicitly set the service name, spearately from auth_name. If service_name is not specified, it's value defaults to the value of auth_name (which maintains the current behavior.) Change-Id: Ibd44ddf46478a19f92c98e721a3fa04804d0d40d Closes-bug: #1359755
This commit is contained in:
parent
53d52c929a
commit
3aba7229b2
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue