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
This commit is contained in:
Jesse Pretorius 2018-06-26 11:20:56 +01:00
parent 7e94c86084
commit 250d9b29b3

View File

@ -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