Provide default service_name for keystone endpoint
This change updates the zaqar::keystone::auth class to include a default service_name of 'zaqar' so that if a user changes the auth_name, the service is still created as being related to 'zaqar'. This improves the user experiance when they want to customize the usernames for services. Change-Id: I2977790c3558732c2a1773aa3ede834c1d62ca16 Closes-Bug: #1590040
This commit is contained in:
parent
3c49546f0a
commit
c2acaba000
@ -43,7 +43,7 @@
|
||||
#
|
||||
# [*service_name*]
|
||||
# (optional) Name of the service.
|
||||
# Defaults to the value of auth_name.
|
||||
# Defaults to 'zaqar'
|
||||
#
|
||||
# [*configure_service*]
|
||||
# Should zaqar service be configured? Defaults to 'true'.
|
||||
@ -60,7 +60,7 @@ class zaqar::keystone::auth(
|
||||
$password,
|
||||
$email = 'zaqar@localhost',
|
||||
$auth_name = 'zaqar',
|
||||
$service_name = undef,
|
||||
$service_name = 'zaqar',
|
||||
$service_type = 'messaging',
|
||||
$public_url = 'http://127.0.0.1:8888',
|
||||
$admin_url = 'http://127.0.0.1:8888',
|
||||
@ -76,19 +76,14 @@ class zaqar::keystone::auth(
|
||||
|
||||
validate_string($password)
|
||||
|
||||
if $service_name == undef {
|
||||
$real_service_name = $auth_name
|
||||
} else {
|
||||
$real_service_name = $service_name
|
||||
}
|
||||
|
||||
keystone::resource::service_identity { $auth_name:
|
||||
keystone::resource::service_identity { 'zaqar':
|
||||
configure_user => $configure_user,
|
||||
configure_user_role => $configure_user_role,
|
||||
configure_endpoint => $configure_endpoint,
|
||||
service_type => $service_type,
|
||||
service_description => $service_description,
|
||||
service_name => $real_service_name,
|
||||
service_name => $service_name,
|
||||
auth_name => $auth_name,
|
||||
region => $region,
|
||||
password => $password,
|
||||
email => $email,
|
||||
|
@ -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.
|
@ -62,8 +62,8 @@ describe 'zaqar::keystone::auth' do
|
||||
|
||||
it { is_expected.to contain_keystone_user('zaqary') }
|
||||
it { is_expected.to contain_keystone_user_role('zaqary@services') }
|
||||
it { is_expected.to contain_keystone_service('zaqary::messaging') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/zaqary::messaging') }
|
||||
it { is_expected.to contain_keystone_service('zaqar::messaging') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/zaqar::messaging') }
|
||||
end
|
||||
|
||||
describe 'when overriding service name' do
|
||||
|
Loading…
Reference in New Issue
Block a user