]> git.apps.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)
committerSage Weil <sage@newdream.net>
Tue, 4 May 2021 16:22:46 +0000 (11:22 -0500)
Signed-off-by: Daniel Pivonka <dpivonka@redhat.com>
(cherry picked from commit 35da4de8ee888d54d74d05a9d16345cd5c112d23)

src/cephadm/cephadm
src/pybind/mgr/cephadm/serve.py

index 305416f0e99d400a2fbedadb5fffba8b05857319..8c3fccc0c4515b47b0caa3017be062ff1ac31a3a 100755 (executable)
@@ -3174,6 +3174,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',
@@ -7589,6 +7591,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 78d7e79569f224520e8a5623b3cc4590f011b453..e92da1f9fbe217b3f56e4c0454c98c5da3497ec2 100644 (file)
@@ -1240,7 +1240,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