Change default service_name to 'barbican'
While we were already able to pick an independent auth_name and service_name; the service_name was defaulting to auth_name. Now it has a value of its own to be consistent with other modules. Related-Bug: #1590040 Change-Id: Ied45e546667b7c04e9b511a3ae23c529ad78e7df
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
#
|
#
|
||||||
# [*service_name*]
|
# [*service_name*]
|
||||||
# (optional) Name of the service.
|
# (optional) Name of the service.
|
||||||
# Defaults to the value of auth_name.
|
# Defaults to 'barbican'.
|
||||||
#
|
#
|
||||||
# [*public_url*]
|
# [*public_url*]
|
||||||
# (optional) The endpoint's public url. (Defaults to 'http://127.0.0.1:9311')
|
# (optional) The endpoint's public url. (Defaults to 'http://127.0.0.1:9311')
|
||||||
@@ -57,7 +57,7 @@ class barbican::keystone::auth (
|
|||||||
$configure_endpoint = true,
|
$configure_endpoint = true,
|
||||||
$configure_user = true,
|
$configure_user = true,
|
||||||
$configure_user_role = true,
|
$configure_user_role = true,
|
||||||
$service_name = undef,
|
$service_name = 'barbican',
|
||||||
$service_type = 'key-manager',
|
$service_type = 'key-manager',
|
||||||
$region = 'RegionOne',
|
$region = 'RegionOne',
|
||||||
$public_url = 'http://127.0.0.1:9311',
|
$public_url = 'http://127.0.0.1:9311',
|
||||||
@@ -65,18 +65,16 @@ class barbican::keystone::auth (
|
|||||||
$admin_url = 'http://127.0.0.1:9311',
|
$admin_url = 'http://127.0.0.1:9311',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$real_service_name = pick($service_name, $auth_name)
|
|
||||||
|
|
||||||
if $configure_user_role {
|
if $configure_user_role {
|
||||||
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'barbican-api' |>
|
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'barbican-api' |>
|
||||||
}
|
}
|
||||||
Keystone_endpoint["${region}/${real_service_name}::${service_type}"] ~> Service <| name == 'barbican-api' |>
|
Keystone_endpoint["${region}/${service_name}::${service_type}"] ~> Service <| name == 'barbican-api' |>
|
||||||
|
|
||||||
keystone::resource::service_identity { 'barbican':
|
keystone::resource::service_identity { 'barbican':
|
||||||
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_name => $real_service_name,
|
service_name => $service_name,
|
||||||
service_type => $service_type,
|
service_type => $service_type,
|
||||||
service_description => 'Key management Service',
|
service_description => 'Key management Service',
|
||||||
region => $region,
|
region => $region,
|
||||||
|
@@ -63,8 +63,8 @@ describe 'barbican::keystone::auth' do
|
|||||||
|
|
||||||
it { is_expected.to contain_keystone_user('barbicany') }
|
it { is_expected.to contain_keystone_user('barbicany') }
|
||||||
it { is_expected.to contain_keystone_user_role('barbicany@services') }
|
it { is_expected.to contain_keystone_user_role('barbicany@services') }
|
||||||
it { is_expected.to contain_keystone_service('barbicany::key-manager') }
|
it { is_expected.to contain_keystone_service('barbican::key-manager') }
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/barbicany::key-manager') }
|
it { is_expected.to contain_keystone_endpoint('RegionOne/barbican::key-manager') }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when overriding service name' do
|
describe 'when overriding service name' do
|
||||||
|
Reference in New Issue
Block a user