From f5c1cf3ad5760d55cdefe38011ae7785d3c054fa Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 30 Jul 2023 01:46:29 +0900 Subject: [PATCH] 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 --- manifests/rgw/keystone/auth.pp | 53 ++++++++++++++----- .../notes/bug-2029009-ea8a684cb50372b9.yaml | 18 +++++++ 2 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 releasenotes/notes/bug-2029009-ea8a684cb50372b9.yaml diff --git a/manifests/rgw/keystone/auth.pp b/manifests/rgw/keystone/auth.pp index 0702c7e4..42b0f8f5 100644 --- a/manifests/rgw/keystone/auth.pp +++ b/manifests/rgw/keystone/auth.pp @@ -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, diff --git a/releasenotes/notes/bug-2029009-ea8a684cb50372b9.yaml b/releasenotes/notes/bug-2029009-ea8a684cb50372b9.yaml new file mode 100644 index 00000000..7ca43463 --- /dev/null +++ b/releasenotes/notes/bug-2029009-ea8a684cb50372b9.yaml @@ -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.