Provide default service_name for keystone endpoint

This change updates the monasca::keystone::auth class to include a
default service_name of 'monasca' so that if a user changes the
auth_name, the service is still created as being related to
'monasca'.

Change-Id: Id973e70d27072c0478aae68f288ee5d638037b36
Closes-Bug: #1590040
This commit is contained in:
Sharat Sharma 2016-10-02 12:29:51 +05:30
parent 91466b45ac
commit d8859186cd
2 changed files with 10 additions and 11 deletions

View File

@ -44,7 +44,7 @@
# Should roles be configured on Monasca service user? Optional. Defaults to 'true'.
#
# [*service_name*]
# Name of the service. Optional. Defaults to value of auth_name.
# Name of the service. Optional. Defaults to 'monasca'.
#
# [*service_type*]
# Type of service. Optional. Defaults to 'monitoring'.
@ -126,7 +126,7 @@ class monasca::keystone::auth (
$user_email = 'monasca@localhost',
$configure_user = true,
$configure_user_role = true,
$service_name = undef,
$service_name = 'monasca',
$service_type = 'monitoring',
$service_description = 'Openstack Monitoring Service',
$public_address = '127.0.0.1',
@ -177,12 +177,6 @@ class monasca::keystone::auth (
$internal_url_real = "${internal_protocol}://${internal_address}:${port}/${api_version}"
}
if $service_name {
$real_service_name = $service_name
} else {
$real_service_name = $auth_name
}
if $configure_user {
keystone_user { $agent_name:
ensure => present,
@ -250,13 +244,13 @@ class monasca::keystone::auth (
}
}
keystone::resource::service_identity { 'Monasca Service':
keystone::resource::service_identity { 'monasca':
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,
roles => $real_user_roles_admin,
auth_name => $admin_name,
@ -269,7 +263,7 @@ class monasca::keystone::auth (
}
if $configure_endpoint {
Keystone_endpoint["${region}/${real_service_name}::${service_type}"] ~>
Keystone_endpoint["${region}/${service_name}::${service_type}"] ~>
Service <| name == 'monasca-api' |>
}
}

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.