]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: update zonegroup w/ zonegroup_hostnames from rgw spec 56458/head
authorAdam King <adking@redhat.com>
Mon, 25 Mar 2024 17:47:12 +0000 (13:47 -0400)
committerAdam King <adking@redhat.com>
Mon, 25 Mar 2024 17:51:00 +0000 (13:51 -0400)
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 <adking@redhat.com>
src/pybind/mgr/cephadm/services/cephadmservice.py

index d211bbaa309f483763371e58b4c74b6b38a60d05..b786255ee1e00b782884d3c3989a04b604f14eea 100644 (file)
@@ -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()))