]> git-server-git.apps.pok.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)
committerRedouane Kachach <rkachach@redhat.com>
Mon, 22 May 2023 14:51:59 +0000 (16:51 +0200)
Fixes: https://tracker.ceph.com/issues/61330
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
src/cephadm/cephadm.py

index f23ab08326ad42c9f116b31deadbdc7491f0107c..d1886c4dee43833d80009e5732bda9f9a7da7cb9 100755 (executable)
@@ -5631,8 +5631,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}')