Provide default service_name for keystone endpoint

This change updates the aodh::keystone::auth class to include a default
service_name of 'aodh' so that if a user changes the auth_name, the
service is still created as being related to 'aodh'.  This improves the
user experiance when they want to customize the usernames for services.

Change-Id: I9de75cbe7947282739e13e2f397ee7e919f7dc9f
Closes-Bug: #1590040
This commit is contained in:
Alex Schultz 2016-06-07 10:51:01 -06:00
parent b04fb50639
commit ca6b879872
3 changed files with 10 additions and 7 deletions

View File

@ -35,7 +35,7 @@
#
# [*service_name*]
# (optional) Name of the service.
# Defaults to the value of auth_name.
# Defaults to 'aodh'.
#
# [*public_url*]
# (optional) The endpoint's public url. (Defaults to 'http://127.0.0.1:8042')
@ -57,7 +57,7 @@ class aodh::keystone::auth (
$configure_endpoint = true,
$configure_user = true,
$configure_user_role = true,
$service_name = undef,
$service_name = 'aodh',
$service_type = 'alarming',
$region = 'RegionOne',
$public_url = 'http://127.0.0.1:8042',
@ -65,13 +65,11 @@ class aodh::keystone::auth (
$admin_url = 'http://127.0.0.1:8042',
) {
$real_service_name = pick($service_name, $auth_name)
keystone::resource::service_identity { 'aodh':
configure_user => $configure_user,
configure_user_role => $configure_user_role,
configure_endpoint => $configure_endpoint,
service_name => $real_service_name,
service_name => $service_name,
service_type => $service_type,
service_description => 'OpenStack Alarming Service',
region => $region,

View File

@ -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.

View File

@ -63,8 +63,8 @@ describe 'aodh::keystone::auth' do
it { is_expected.to contain_keystone_user('aodhany') }
it { is_expected.to contain_keystone_user_role('aodhany@services') }
it { is_expected.to contain_keystone_service('aodhany::alarming') }
it { is_expected.to contain_keystone_endpoint('RegionOne/aodhany::alarming') }
it { is_expected.to contain_keystone_service('aodh::alarming') }
it { is_expected.to contain_keystone_endpoint('RegionOne/aodh::alarming') }
end
describe 'when overriding service name' do