Fix ineffective rgw_service parameter

... and introduces a few new parameters to customize keystone service,
so that we can replace it by the generic interfaces.

Closes-Bug: #2029009
Change-Id: Ia91560a0948257c7a7801aaca9f43bfde2a573fb
This commit is contained in:
Takashi Kajinami 2023-07-30 01:46:29 +09:00
parent d716b57bfa
commit f5c1cf3ad5
2 changed files with 57 additions and 14 deletions

View File

@ -40,31 +40,56 @@
# Tenant for user. Optional.
# Defaults to ceph::profile::params::rgw_keystone_admin_project
#
# [*service_description*]
# (Optional) Description of the service.
# Default to 'Ceph RGW Service'
#
# [*service_name*]
# (Optional) Name of the service.
# Defaults to 'swift'.
#
# [*service_type*]
# (Optional) Type of service.
# Defaults to 'object-store'.
#
# DEPRECATED PARAMETERS
#
# [*rgw_service*]
# Name of the keystone service used by RGW
# Defaults to 'swift::object-store'
# Defaults to undef
#
class ceph::rgw::keystone::auth (
$password = $ceph::profile::params::rgw_keystone_admin_password,
$user = $ceph::profile::params::rgw_keystone_admin_user,
$email = 'rgwuser@localhost',
$roles = ['admin', 'Member'],
$public_url = 'http://127.0.0.1:8080/swift/v1',
$admin_url = 'http://127.0.0.1:8080/swift/v1',
$internal_url = 'http://127.0.0.1:8080/swift/v1',
$region = 'RegionOne',
$tenant = $ceph::profile::params::rgw_keystone_admin_project,
$rgw_service = 'swift::object-store',
$password = $ceph::profile::params::rgw_keystone_admin_password,
$user = $ceph::profile::params::rgw_keystone_admin_user,
$email = 'rgwuser@localhost',
$roles = ['admin', 'Member'],
$public_url = 'http://127.0.0.1:8080/swift/v1',
$admin_url = 'http://127.0.0.1:8080/swift/v1',
$internal_url = 'http://127.0.0.1:8080/swift/v1',
$region = 'RegionOne',
$tenant = $ceph::profile::params::rgw_keystone_admin_project,
$service_description = 'Ceph RGW Service',
$service_name = 'swift',
$service_type = 'object-store',
# DEPRECATED PARAMETERS
$rgw_service = undef,
) {
include openstacklib::openstackclient
ensure_resource('keystone_service', 'swift::object-store', {
if $rgw_service {
warning('The rgw_service parameter is deprecated')
$rgw_service_real = $rgw_service
} else {
$rgw_service_real = "${service_name}::${service_type}"
}
ensure_resource('keystone_service', $rgw_service_real, {
'ensure' => 'present',
'description' => 'Ceph RGW Service',
'description' => $service_description,
} )
ensure_resource('keystone_endpoint', "${region}/swift::object-store", {
ensure_resource('keystone_endpoint', "${region}/${rgw_service_real}", {
'ensure' => 'present',
'public_url' => $public_url,
'admin_url' => $admin_url,

View File

@ -0,0 +1,18 @@
---
features:
- |
The following parameters have been added to
the ``ceph::rgw::keystone::auth`` class
- ``service_description``
- ``service_name``
- ``service_type``
fixes:
- |
Fixed the ignored ``ceph::rgw::keystone::auth::rgw_service`` parameter.
deprecations:
- |
The ``ceph::rgw::keystone::auth::rgw_service`` parameter has been
deprecated in favor of the new service parameters.