diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 5af43f08..a8a106d8 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -49,7 +49,7 @@ # # [*service_name*] # (optional) Name of the service. -# Defaults to the value of auth_name. +# Defaults to 'trove'. # # [*service_description*] # (optional) Description for keystone service. @@ -86,7 +86,7 @@ class trove::keystone::auth ( $configure_user = true, $configure_user_role = true, $configure_endpoint = true, - $service_name = undef, + $service_name = 'trove', $service_type = 'database', $service_description = 'Trove Database Service', $region = 'RegionOne', @@ -97,18 +97,16 @@ class trove::keystone::auth ( include ::trove::deps - $real_service_name = pick($service_name, $auth_name) - Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| tag == 'trove-server' |> - Keystone_endpoint<| title == "${region}/${real_service_name}::${service_type}" |> + Keystone_endpoint<| title == "${region}/${service_name}::${service_type}" |> ~> Service <| tag == 'trove-server' |> keystone::resource::service_identity { 'trove': 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 => $service_description, region => $region, diff --git a/releasenotes/notes/keystone-auth-name-ca9c69995d1eac09.yaml b/releasenotes/notes/keystone-auth-name-ca9c69995d1eac09.yaml new file mode 100644 index 00000000..835c883b --- /dev/null +++ b/releasenotes/notes/keystone-auth-name-ca9c69995d1eac09.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/trove_keystone_auth_spec.rb b/spec/classes/trove_keystone_auth_spec.rb index 2be9f19a..6a51cc45 100644 --- a/spec/classes/trove_keystone_auth_spec.rb +++ b/spec/classes/trove_keystone_auth_spec.rb @@ -90,8 +90,8 @@ describe 'trove::keystone::auth' do it { is_expected.to contain_keystone_user('trovey') } it { is_expected.to contain_keystone_user_role('trovey@services') } - it { is_expected.to contain_keystone_service('trovey::database') } - it { is_expected.to contain_keystone_endpoint('RegionOne/trovey::database') } + it { is_expected.to contain_keystone_service('trove::database') } + it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database') } end describe 'when overriding service name' do