diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index ed4461208..f8eaf7136 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -27,7 +27,7 @@ # Defaults to 'true'. # # [*service_name*] -# Name of the service. Defaults to the value of auth_name. +# Name of the service. Defaults 'neutron'. # # [*service_type*] # Type of service. Defaults to 'network'. @@ -68,7 +68,7 @@ class neutron::keystone::auth ( $configure_endpoint = true, $configure_user = true, $configure_user_role = true, - $service_name = undef, + $service_name = 'neutron', $service_type = 'network', $service_description = 'Neutron Networking Service', $region = 'RegionOne', @@ -77,23 +77,22 @@ class neutron::keystone::auth ( $internal_url = 'http://127.0.0.1:9696', ) { - $real_service_name = pick($service_name, $auth_name) - if $configure_endpoint { - Keystone_endpoint["${region}/${real_service_name}::${service_type}"] ~> Service <| title == 'neutron-server' |> + Keystone_endpoint["${region}/${service_name}::${service_type}"] ~> Service <| title == 'neutron-server' |> } if $configure_user_role { Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| title == 'neutron-server' |> } - keystone::resource::service_identity { $auth_name: + keystone::resource::service_identity { 'neutron': 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, diff --git a/releasenotes/notes/keystone-auth-name-8df71412ef6e0cef.yaml b/releasenotes/notes/keystone-auth-name-8df71412ef6e0cef.yaml new file mode 100644 index 000000000..835c883b6 --- /dev/null +++ b/releasenotes/notes/keystone-auth-name-8df71412ef6e0cef.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/neutron_keystone_auth_spec.rb b/spec/classes/neutron_keystone_auth_spec.rb index 364c90bd1..d01ead540 100644 --- a/spec/classes/neutron_keystone_auth_spec.rb +++ b/spec/classes/neutron_keystone_auth_spec.rb @@ -92,9 +92,9 @@ describe 'neutron::keystone::auth' do it { is_expected.to contain_keystone_user_role('neutrony@services') } - it { is_expected.to contain_keystone_service('neutrony::network') } + it { is_expected.to contain_keystone_service('neutron::network') } - it { is_expected.to contain_keystone_endpoint('RegionOne/neutrony::network') } + it { is_expected.to contain_keystone_endpoint('RegionOne/neutron::network') } end