Provide default service_name for keystone endpoint
This change updates the heat::keystone::auth class to include a default service_name of 'heat' so that if a user changes the auth_name, the service is still created as being related to 'heat'. This improves the user experiance when they want to customize the usernames for services. Closes-Bug: #1590040 Change-Id: Iee47e78dbeb269e5fe6c52030de378c13e51c1f3
This commit is contained in:
parent
14d456d875
commit
6f16641c4e
@ -32,7 +32,7 @@
|
|||||||
#
|
#
|
||||||
# [*service_name*]
|
# [*service_name*]
|
||||||
# (Optional) Name of the service.
|
# (Optional) Name of the service.
|
||||||
# Defaults to the value of auth_name.
|
# Defaults to 'heat'.
|
||||||
#
|
#
|
||||||
# [*service_type*]
|
# [*service_type*]
|
||||||
# (Optional) Type of service.
|
# (Optional) Type of service.
|
||||||
@ -97,7 +97,7 @@ class heat::keystone::auth (
|
|||||||
$password = false,
|
$password = false,
|
||||||
$email = 'heat@localhost',
|
$email = 'heat@localhost',
|
||||||
$auth_name = 'heat',
|
$auth_name = 'heat',
|
||||||
$service_name = undef,
|
$service_name = 'heat',
|
||||||
$service_type = 'orchestration',
|
$service_type = 'orchestration',
|
||||||
$service_description = 'Openstack Orchestration Service',
|
$service_description = 'Openstack Orchestration Service',
|
||||||
$region = 'RegionOne',
|
$region = 'RegionOne',
|
||||||
@ -119,17 +119,16 @@ class heat::keystone::auth (
|
|||||||
|
|
||||||
validate_string($password)
|
validate_string($password)
|
||||||
|
|
||||||
$real_service_name = pick($service_name, $auth_name)
|
keystone::resource::service_identity { 'heat':
|
||||||
|
|
||||||
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,
|
||||||
configure_service => $configure_service,
|
configure_service => $configure_service,
|
||||||
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,
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#
|
#
|
||||||
# [*service_name*]
|
# [*service_name*]
|
||||||
# (Optional) Name of the service.
|
# (Optional) Name of the service.
|
||||||
# Defaults to the value of auth_name.
|
# Defaults to 'heat'.
|
||||||
#
|
#
|
||||||
# [*service_type*]
|
# [*service_type*]
|
||||||
# (Optional) Type of service.
|
# (Optional) Type of service.
|
||||||
@ -70,7 +70,7 @@ class heat::keystone::auth_cfn (
|
|||||||
$password = false,
|
$password = false,
|
||||||
$email = 'heat-cfn@localhost',
|
$email = 'heat-cfn@localhost',
|
||||||
$auth_name = 'heat-cfn',
|
$auth_name = 'heat-cfn',
|
||||||
$service_name = undef,
|
$service_name = 'heat-cfn',
|
||||||
$service_type = 'cloudformation',
|
$service_type = 'cloudformation',
|
||||||
$region = 'RegionOne',
|
$region = 'RegionOne',
|
||||||
$tenant = 'services',
|
$tenant = 'services',
|
||||||
@ -87,17 +87,16 @@ class heat::keystone::auth_cfn (
|
|||||||
|
|
||||||
validate_string($password)
|
validate_string($password)
|
||||||
|
|
||||||
$real_service_name = pick($service_name, $auth_name)
|
keystone::resource::service_identity { 'heat-cfn':
|
||||||
|
|
||||||
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,
|
||||||
configure_service => $configure_service,
|
configure_service => $configure_service,
|
||||||
service_type => $service_type,
|
service_type => $service_type,
|
||||||
service_description => 'Openstack Cloudformation Service',
|
service_description => 'Openstack Cloudformation Service',
|
||||||
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.
|
@ -70,23 +70,24 @@ describe 'heat::keystone::auth_cfn' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when overriding service name' do
|
context 'when overriding auth and service name' do
|
||||||
before do
|
before do
|
||||||
params.merge!({
|
params.merge!({
|
||||||
:service_name => 'heat-cfn_service'
|
:auth_name => 'heat-cfny',
|
||||||
|
:service_name => 'heat-cfny'
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
it 'configures correct user name' do
|
it 'configures correct user name' do
|
||||||
is_expected.to contain_keystone_user('heat-cfn')
|
is_expected.to contain_keystone_user('heat-cfny')
|
||||||
end
|
end
|
||||||
it 'configures correct user role' do
|
it 'configures correct user role' do
|
||||||
is_expected.to contain_keystone_user_role('heat-cfn@services')
|
is_expected.to contain_keystone_user_role('heat-cfny@services')
|
||||||
end
|
end
|
||||||
it 'configures correct service name' do
|
it 'configures correct service name' do
|
||||||
is_expected.to contain_keystone_service('heat-cfn_service::cloudformation')
|
is_expected.to contain_keystone_service('heat-cfny::cloudformation')
|
||||||
end
|
end
|
||||||
it 'configures correct endpoint name' do
|
it 'configures correct endpoint name' do
|
||||||
is_expected.to contain_keystone_endpoint('RegionOne/heat-cfn_service::cloudformation')
|
is_expected.to contain_keystone_endpoint('RegionOne/heat-cfny::cloudformation')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -77,23 +77,24 @@ describe 'heat::keystone::auth' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when overriding service name' do
|
context 'when overriding auth and service name' do
|
||||||
before do
|
before do
|
||||||
params.merge!({
|
params.merge!({
|
||||||
:service_name => 'heat_service'
|
:auth_name => 'heaty',
|
||||||
|
:service_name => 'heaty'
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
it 'configures correct user name' do
|
it 'configures correct user name' do
|
||||||
is_expected.to contain_keystone_user('heat')
|
is_expected.to contain_keystone_user('heaty')
|
||||||
end
|
end
|
||||||
it 'configures correct user role' do
|
it 'configures correct user role' do
|
||||||
is_expected.to contain_keystone_user_role('heat@services')
|
is_expected.to contain_keystone_user_role('heaty@services')
|
||||||
end
|
end
|
||||||
it 'configures correct service name' do
|
it 'configures correct service name' do
|
||||||
is_expected.to contain_keystone_service('heat_service::orchestration')
|
is_expected.to contain_keystone_service('heaty::orchestration')
|
||||||
end
|
end
|
||||||
it 'configures correct endpoint name' do
|
it 'configures correct endpoint name' do
|
||||||
is_expected.to contain_keystone_endpoint('RegionOne/heat_service::orchestration')
|
is_expected.to contain_keystone_endpoint('RegionOne/heaty::orchestration')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user