From 250d9b29b36db28d982f45a5e5d8142e6087daf6 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 26 Jun 2018 11:20:56 +0100 Subject: [PATCH] MNAIO: Disable SSH key checks on host When accessing the VM's on an MNAIO host and doing multiple rebuilds, the SSH keys are constantly changing. This creates a situation where keys constantly have to be deleted and accepted which isn't very user-friendly. Given that this tooling is used for test purposes, we can disable the host key checks without being too concerned. Change-Id: I3dd1221c4789b0ab8e895b22b05906456fc1fc8f --- multi-node-aio/playbooks/setup-host.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/multi-node-aio/playbooks/setup-host.yml b/multi-node-aio/playbooks/setup-host.yml index eaa501ad..23a9368e 100644 --- a/multi-node-aio/playbooks/setup-host.yml +++ b/multi-node-aio/playbooks/setup-host.yml @@ -110,6 +110,30 @@ user: "root" key: "{{ root_public_key }}" + - name: Setup SSH client to disable strict host key checks + lineinfile: + path: /etc/ssh/ssh_config + regexp: "^.*StrictHostKeyChecking.*$" + line: " StrictHostKeyChecking no" + insertafter: "^Host \\*$" + state: present + + - name: Setup SSH client to have a non-persistant known hosts file + lineinfile: + path: /etc/ssh/ssh_config + regexp: "^.*UserKnownHostsFile.*$" + line: " UserKnownHostsFile=/dev/null" + insertafter: "^Host \\*$" + state: present + + - name: Setup SSH client to disable DNS host key checks + lineinfile: + path: /etc/ssh/ssh_config + regexp: "^.*VerifyHostKeyDNS.*$" + line: " VerifyHostKeyDNS no" + insertafter: "^Host \\*$" + state: present + - name: Add sysctl options sysctl: name: net.ipv4.ip_forward