Change default service_name to 'cinder'

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.

Change-Id: I76bd088d48f702ecb1f57818475e759bce1a6bb0
Related-Bug: #1590040
This commit is contained in:
Marcellin Fom Tchassem 2016-06-07 19:35:28 -05:00
parent a4aafb9a7d
commit b2a1ce63f3
2 changed files with 17 additions and 23 deletions

View File

@ -64,18 +64,15 @@
#
# [*service_name*]
# (optional) Name of the service.
# Defaults to the value of auth_name, but must differ from the value
# of service_name_v2.
# Defaults to 'cinder'.
#
# [*service_name_v2*]
# (optional) Name of the v2 service.
# Defaults to the value of auth_name_v2, but must differ from the value
# of service_name.
# Defaults to 'cinderv2'.
#
# [*service_name_v3*]
# (optional) Name of the v3 service.
# Defaults to the value of auth_name_v3, but must differ from the value
# of service_name.
# Defaults to 'cinderv3'.
#
# [*service_type*]
# Type of service. Optional. Defaults to 'volume'.
@ -185,9 +182,9 @@ class cinder::keystone::auth (
$configure_user_role = true,
$configure_user_role_v2 = false,
$configure_user_role_v3 = false,
$service_name = undef,
$service_name_v2 = undef,
$service_name_v3 = undef,
$service_name = 'cinder',
$service_name_v2 = 'cinderv2',
$service_name_v3 = 'cinderv3',
$service_type = 'volume',
$service_type_v2 = 'volumev2',
$service_type_v3 = 'volumev3',
@ -197,22 +194,14 @@ class cinder::keystone::auth (
$region = 'RegionOne',
) {
$real_service_name = pick($service_name, $auth_name)
$real_service_name_v2 = pick($service_name_v2, $auth_name_v2)
$real_service_name_v3 = pick($service_name_v3, $auth_name_v3)
if $real_service_name == $real_service_name_v2 {
fail('cinder::keystone::auth parameters service_name and service_name_v2 must be different.')
}
if $configure_endpoint {
Keystone_endpoint["${region}/${real_service_name}::${service_type}"] -> Cinder_type<||>
Keystone_endpoint["${region}/${service_name}::${service_type}"] -> Cinder_type<||>
}
if $configure_endpoint_v2 {
Keystone_endpoint["${region}/${real_service_name_v2}::${service_type_v2}"] -> Cinder_type<||>
Keystone_endpoint["${region}/${service_name_v2}::${service_type_v2}"] -> Cinder_type<||>
}
if $configure_endpoint_v3 {
Keystone_endpoint["${region}/${real_service_name_v3}::${service_type_v3}"] -> Cinder_type<||>
Keystone_endpoint["${region}/${service_name_v3}::${service_type_v3}"] -> Cinder_type<||>
}
keystone::resource::service_identity { 'cinder':
@ -221,7 +210,7 @@ class cinder::keystone::auth (
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,
@ -238,7 +227,7 @@ class cinder::keystone::auth (
configure_endpoint => $configure_endpoint_v2,
service_type => $service_type_v2,
service_description => $service_description_v2,
service_name => $real_service_name_v2,
service_name => $service_name_v2,
region => $region,
auth_name => $auth_name_v2,
password => $password_user_v2,
@ -255,7 +244,7 @@ class cinder::keystone::auth (
configure_endpoint => $configure_endpoint_v3,
service_type => $service_type_v3,
service_description => $service_description_v3,
service_name => $real_service_name_v3,
service_name => $service_name_v3,
region => $region,
auth_name => $auth_name_v3,
password => $password_user_v3,

View File

@ -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.