Provide default service_name for keystone endpoint
This change updates the designate::keystone::auth class to include a default service_name of 'designate' so that if a user changes the auth_name, the service is still created as being related to 'designate'. This improves the user experiance when they want to customize the usernames for services. Closes-bug: #1590040 Change-Id: I58658de33ba90d2f8d6fbc1aaa0099f1ad024aa6
This commit is contained in:
parent
741eb698ee
commit
d645b1ed88
|
@ -18,7 +18,7 @@
|
|||
#
|
||||
# [*service_name*]
|
||||
# (optional) Name of the service.
|
||||
# Defaults to the value of auth_name.
|
||||
# Defaults to 'designate'.
|
||||
#
|
||||
# [*service_type*]
|
||||
# Type of service. Optional. Defaults to 'metering'.
|
||||
|
@ -56,7 +56,7 @@ class designate::keystone::auth (
|
|||
$password = false,
|
||||
$email = 'designate@localhost',
|
||||
$auth_name = 'designate',
|
||||
$service_name = undef,
|
||||
$service_name = 'designate',
|
||||
$service_type = 'dns',
|
||||
$service_description = 'Openstack DNSaas Service',
|
||||
$region = 'RegionOne',
|
||||
|
@ -67,8 +67,6 @@ class designate::keystone::auth (
|
|||
$internal_url = 'http://127.0.0.1:9001/v1',
|
||||
) {
|
||||
|
||||
$real_service_name = pick($service_name, $auth_name)
|
||||
|
||||
Keystone_user_role["${auth_name}@${tenant}"] ~>
|
||||
Service <| name == 'designate-api' |>
|
||||
|
||||
|
@ -76,7 +74,7 @@ class designate::keystone::auth (
|
|||
configure_user => true,
|
||||
configure_user_role => true,
|
||||
configure_endpoint => $configure_endpoint,
|
||||
service_name => $real_service_name,
|
||||
service_name => $service_name,
|
||||
service_type => $service_type,
|
||||
service_description => $service_description,
|
||||
region => $region,
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
fixes:
|
||||
- The keystone auth class has been updated to provide a default service_name
|
||||
to allow a user to specify a custom auth_name that may not contain the
|
||||
name of the service.
|
|
@ -51,30 +51,19 @@ describe 'designate::keystone::auth' do
|
|||
) }
|
||||
end
|
||||
|
||||
context 'when overriding auth name' do
|
||||
context 'when overriding auth and service name' do
|
||||
let :params do
|
||||
{ :password => 'foo',
|
||||
:auth_name => 'designate1' }
|
||||
:service_name => 'designatey',
|
||||
:auth_name => 'designatey' }
|
||||
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('designate1::dns') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/designate1::dns') }
|
||||
it { is_expected.to contain_keystone_user('designatey') }
|
||||
it { is_expected.to contain_keystone_user_role('designatey@services') }
|
||||
it { is_expected.to contain_keystone_service('designatey::dns') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/designatey::dns') }
|
||||
end
|
||||
|
||||
context '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::dns') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/designate_service::dns') }
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
|
Loading…
Reference in New Issue