Provide default service_name for keystone endpoint
This change updates the mistral::keystone::auth class to include a default service_name of 'mistral' so that if a user changes the auth_name, the service is still created as being related to 'mistral'. This improves the user experiance when they want to customize the usernames for services. Closes-bug: #1590040 Change-Id: I94d5429a21acea5d9fe8812f85fb65cfeb3094a3
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
#
|
#
|
||||||
# [*service_name*]
|
# [*service_name*]
|
||||||
# (optional) Name of the service.
|
# (optional) Name of the service.
|
||||||
# Defaults to the value of auth_name.
|
# Defaults to 'mistral'.
|
||||||
#
|
#
|
||||||
# [*configure_service*]
|
# [*configure_service*]
|
||||||
# Should mistral service be configured? Defaults to 'true'.
|
# Should mistral service be configured? Defaults to 'true'.
|
||||||
@@ -60,7 +60,7 @@ class mistral::keystone::auth(
|
|||||||
$password,
|
$password,
|
||||||
$email = 'mistral@localhost',
|
$email = 'mistral@localhost',
|
||||||
$auth_name = 'mistral',
|
$auth_name = 'mistral',
|
||||||
$service_name = undef,
|
$service_name = 'mistral',
|
||||||
$service_type = 'workflowv2',
|
$service_type = 'workflowv2',
|
||||||
$public_url = 'http://127.0.0.1:8989/v2',
|
$public_url = 'http://127.0.0.1:8989/v2',
|
||||||
$admin_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)
|
validate_string($password)
|
||||||
|
|
||||||
if $service_name == undef {
|
keystone::resource::service_identity { 'mistral':
|
||||||
$real_service_name = $auth_name
|
|
||||||
} else {
|
|
||||||
$real_service_name = $service_name
|
|
||||||
}
|
|
||||||
|
|
||||||
keystone::resource::service_identity { $auth_name:
|
|
||||||
configure_user => $configure_user,
|
configure_user => $configure_user,
|
||||||
configure_user_role => $configure_user_role,
|
configure_user_role => $configure_user_role,
|
||||||
configure_endpoint => $configure_endpoint,
|
configure_endpoint => $configure_endpoint,
|
||||||
service_type => $service_type,
|
service_type => $service_type,
|
||||||
service_description => $service_description,
|
service_description => $service_description,
|
||||||
service_name => $real_service_name,
|
service_name => $service_name,
|
||||||
region => $region,
|
region => $region,
|
||||||
|
auth_name => $auth_name,
|
||||||
password => $password,
|
password => $password,
|
||||||
email => $email,
|
email => $email,
|
||||||
tenant => $tenant,
|
tenant => $tenant,
|
||||||
|
@@ -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.
|
@@ -39,10 +39,11 @@ describe 'mistral::keystone::auth' do
|
|||||||
) }
|
) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when overriding auth name' do
|
describe 'when overriding auth and service name' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :password => 'foo',
|
{ :service_name => 'mistraly',
|
||||||
:auth_name => 'mistraly' }
|
:auth_name => 'mistraly',
|
||||||
|
:password => 'mistral_password' }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user('mistraly') }
|
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') }
|
it { is_expected.to contain_keystone_endpoint('RegionOne/mistraly::workflowv2') }
|
||||||
end
|
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
|
describe 'when disabling user configuration' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
|
Reference in New Issue
Block a user