diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index d16cd6a..1f08864 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -43,7 +43,7 @@ # # [*service_name*] # (optional) Name of the service. -# Defaults to the value of auth_name. +# Defaults to 'mistral'. # # [*configure_service*] # Should mistral service be configured? Defaults to 'true'. @@ -60,7 +60,7 @@ class mistral::keystone::auth( $password, $email = 'mistral@localhost', $auth_name = 'mistral', - $service_name = undef, + $service_name = 'mistral', $service_type = 'workflowv2', $public_url = 'http://127.0.0.1:8989/v2', $admin_url = 'http://127.0.0.1:8989/v2', @@ -76,20 +76,15 @@ class mistral::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 { 'mistral': 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, region => $region, + auth_name => $auth_name, password => $password, email => $email, tenant => $tenant, diff --git a/releasenotes/notes/keystone-auth-name-6717f5018361ef99.yaml b/releasenotes/notes/keystone-auth-name-6717f5018361ef99.yaml new file mode 100644 index 0000000..835c883 --- /dev/null +++ b/releasenotes/notes/keystone-auth-name-6717f5018361ef99.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/mistral_keystone_auth_spec.rb b/spec/classes/mistral_keystone_auth_spec.rb index 7a5763f..c936e33 100644 --- a/spec/classes/mistral_keystone_auth_spec.rb +++ b/spec/classes/mistral_keystone_auth_spec.rb @@ -39,10 +39,11 @@ describe 'mistral::keystone::auth' do ) } end - describe 'when overriding auth name' do + describe 'when overriding auth and service name' do let :params do - { :password => 'foo', - :auth_name => 'mistraly' } + { :service_name => 'mistraly', + :auth_name => 'mistraly', + :password => 'mistral_password' } end it { is_expected.to contain_keystone_user('mistraly') } @@ -51,19 +52,6 @@ describe 'mistral::keystone::auth' do it { is_expected.to contain_keystone_endpoint('RegionOne/mistraly::workflowv2') } end - describe 'when overriding service name' do - let :params do - { :service_name => 'mistral_service', - :auth_name => 'mistral', - :password => 'mistral_password' } - end - - it { is_expected.to contain_keystone_user('mistral') } - it { is_expected.to contain_keystone_user_role('mistral@services') } - it { is_expected.to contain_keystone_service('mistral_service::workflowv2') } - it { is_expected.to contain_keystone_endpoint('RegionOne/mistral_service::workflowv2') } - end - describe 'when disabling user configuration' do let :params do