From: Adam King Date: Mon, 25 Mar 2024 17:47:12 +0000 (-0400) Subject: mgr/cephadm: update zonegroup w/ zonegroup_hostnames from rgw spec X-Git-Tag: v20.0.0~2289^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3ba87243edb811033d15dcd95322f0517d701f12;p=ceph.git mgr/cephadm: update zonegroup w/ zonegroup_hostnames from rgw spec If users provide this field to the rgw spec, we need to modify the zonegroup to includes these hostnames. This most just makes use of another commit that added the `ceph rgw zonegroup modify` command to the rgw module for this specific purpose. Signed-off-by: Adam King --- diff --git a/src/pybind/mgr/cephadm/services/cephadmservice.py b/src/pybind/mgr/cephadm/services/cephadmservice.py index d211bbaa309f4..b786255ee1e00 100644 --- a/src/pybind/mgr/cephadm/services/cephadmservice.py +++ b/src/pybind/mgr/cephadm/services/cephadmservice.py @@ -965,6 +965,17 @@ class RgwService(CephService): 'val': cert_data, }) + if spec.zonegroup_hostnames: + zg_update_cmd = { + 'prefix': 'rgw zonegroup modify', + 'realm_name': spec.rgw_realm, + 'zonegroup_name': spec.rgw_zonegroup, + 'zone_name': spec.rgw_zone, + 'hostnames': spec.zonegroup_hostnames, + } + logger.debug(f'rgw cmd: {zg_update_cmd}') + ret, out, err = self.mgr.check_mon_command(zg_update_cmd) + # TODO: fail, if we don't have a spec logger.info('Saving service %s spec with placement %s' % ( spec.service_name(), spec.placement.pretty_str()))