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

src/cephadm/cephadm

index 18b02d3bf2f999849eddc6601825d003c1788b5d..7886d832890d753d4a75100eba0e947eb11aa6c6 100755 (executable)
@@ -4697,8 +4697,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}')