]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: skip-ssh flag enables cephadm mgr module
authorcypherean <shreyasharma.ss305@gmail.com>
Sun, 21 Mar 2021 22:13:46 +0000 (03:43 +0530)
committerSage Weil <sage@newdream.net>
Fri, 23 Apr 2021 12:24:14 +0000 (07:24 -0500)
This commit fixes the use of skip-ssh flag. It disables ssh config and enables the cephadm mgr module.

Fixes: http://tracker.ceph.com/issues/49737
Signed-off-by: Shreyaa Sharma <shreyasharma.ss305@gmail.com>
(cherry picked from commit 777f236ad885b03b551dd820f41a00b9c89761eb)

src/cephadm/cephadm

index 4bd39a2a8039a322ef1d054f87b87c3b226cad88..849c696888c7f0ddec88f61c00ce16daf2af7dc6 100755 (executable)
@@ -3670,14 +3670,7 @@ def prepare_ssh(
     cli: Callable, wait_for_mgr_restart: Callable
 ) -> None:
 
-    cli(['config-key', 'set', 'mgr/cephadm/ssh_user', ctx.ssh_user])
-
-    logger.info('Enabling cephadm module...')
-    cli(['mgr', 'module', 'enable', 'cephadm'])
-    wait_for_mgr_restart()
-
-    logger.info('Setting orchestrator backend to cephadm...')
-    cli(['orch', 'set', 'backend', 'cephadm'])
+    cli(['cephadm', 'set-user', ctx.ssh_user])
 
     if ctx.ssh_config:
         logger.info('Using provided ssh config...')
@@ -3763,6 +3756,17 @@ def prepare_ssh(
             cli(['orch', 'apply', t])
 
 
+def enable_cephadm_mgr_module(
+    cli: Callable, wait_for_mgr_restart: Callable
+) -> None:
+
+    logger.info('Enabling cephadm module...')
+    cli(['mgr', 'module', 'enable', 'cephadm'])
+    wait_for_mgr_restart()
+    logger.info('Setting orchestrator backend to cephadm...')
+    cli(['orch', 'set', 'backend', 'cephadm'])
+
+
 def prepare_dashboard(
     ctx: CephadmContext,
     uid: int, gid: int,
@@ -4055,6 +4059,8 @@ def command_bootstrap(ctx):
                 return False
         is_available(ctx, 'mgr epoch %d' % epoch, mgr_has_latest_epoch)
 
+    enable_cephadm_mgr_module(cli, wait_for_mgr_restart)
+
     # ssh
     if not ctx.skip_ssh:
         prepare_ssh(ctx, cli, wait_for_mgr_restart)