]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: Adding support to configure public_network cfg section
authorRedouane Kachach <rkachach@redhat.com>
Mon, 22 May 2023 09:15:07 +0000 (11:15 +0200)
committerAdam King <adking@redhat.com>
Wed, 23 Aug 2023 20:02:59 +0000 (16:02 -0400)
Fixes: https://tracker.ceph.com/issues/61330
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit 50811d114ec91a3e5e340f6845870597ea498b35)

src/cephadm/cephadm.py

index 593a08f009e9a5bd9a709505333598e4346f010b..1b85df1ab39a80505d1a9ea8cd0154a60bc94374 100755 (executable)
@@ -5649,8 +5649,10 @@ def finish_bootstrap_config(
         cli(['config', 'set', 'global', 'container_image', f'{ctx.image}'])
 
     if mon_network:
-        logger.info(f'Setting mon public_network to {mon_network}')
-        cli(['config', 'set', 'mon', 'public_network', mon_network])
+        cp = read_config(ctx.config)
+        cfg_section = 'global' if cp.has_option('global', 'public_network') else 'mon'
+        logger.info(f'Setting public_network to {mon_network} in {cfg_section} config section')
+        cli(['config', 'set', cfg_section, 'public_network', mon_network])
 
     if cluster_network:
         logger.info(f'Setting cluster_network to {cluster_network}')