From ca6b879872dcb185e3c0dccbcc76a55b9af6d6df Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 7 Jun 2016 10:51:01 -0600 Subject: [PATCH] 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 --- manifests/keystone/auth.pp | 8 +++----- .../notes/keystone-auth-name-6deb28333b29657e.yaml | 5 +++++ spec/classes/aodh_keystone_auth_spec.rb | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/keystone-auth-name-6deb28333b29657e.yaml diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index d5f83fff..4d507121 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -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, diff --git a/releasenotes/notes/keystone-auth-name-6deb28333b29657e.yaml b/releasenotes/notes/keystone-auth-name-6deb28333b29657e.yaml new file mode 100644 index 00000000..835c883b --- /dev/null +++ b/releasenotes/notes/keystone-auth-name-6deb28333b29657e.yaml @@ -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. diff --git a/spec/classes/aodh_keystone_auth_spec.rb b/spec/classes/aodh_keystone_auth_spec.rb index 457f7f03..381db917 100644 --- a/spec/classes/aodh_keystone_auth_spec.rb +++ b/spec/classes/aodh_keystone_auth_spec.rb @@ -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