]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: provide a way to checkhost connection without /etc/hosts passed the shell
authorDaniel Pivonka <dpivonka@redhat.com>
Mon, 19 Apr 2021 21:18:55 +0000 (17:18 -0400)
committerDaniel Pivonka <dpivonka@redhat.com>
Mon, 19 Apr 2021 21:18:55 +0000 (17:18 -0400)
Signed-off-by: Daniel Pivonka <dpivonka@redhat.com>
src/cephadm/cephadm
src/pybind/mgr/cephadm/serve.py

index 0a2134a7bb1f76923ef425b706a713ed29463f98..1e86eacd2ed811cd5e9b64819c853c071f4f0034 100755 (executable)
@@ -3167,6 +3167,8 @@ class CephContainer:
 
         if self.host_network:
             cmd_args.append('--net=host')
+        if self.ctx.no_hosts:
+            cmd_args.append('--no-hosts')
         if self.privileged:
             cmd_args.extend([
                 '--privileged',
@@ -7517,6 +7519,10 @@ def _get_parser():
     parser_shell.add_argument(
         'command', nargs=argparse.REMAINDER,
         help='command (optional)')
+    parser_shell.add_argument(
+        '--no-hosts',
+        action='store_true',
+        help='dont pass /etc/hosts through to the container')
 
     parser_enter = subparsers.add_parser(
         'enter', help='run an interactive shell inside a running daemon container')
index e76d347b287155ce828765736acf1b2d4cdad867..5da998eb4b5ae52b5c2391930ead88f60275c7d8 100644 (file)
@@ -1172,7 +1172,10 @@ To add the cephadm SSH key to the host:
 > ceph cephadm get-pub-key > ~/ceph.pub
 > ssh-copy-id -f -i ~/ceph.pub {user}@{addr}
 
-To check that the host is reachable:
+To check that the host is reachable open a new shell with the --no-hosts flag:
+> cephadm shell --no-hosts
+
+Then run the following:
 > ceph cephadm get-ssh-config > ssh_config
 > ceph config-key get mgr/cephadm/ssh_identity_key > ~/cephadm_private_key
 > chmod 0600 ~/cephadm_private_key