From 95a0fe37dab5d88cafd5fb1d5de180160bdea84f Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 5 Jul 2017 09:42:04 -0500 Subject: [PATCH] UserKnownHostsFile=/dev/null when verify_host: false This is a new fix to replace #20361 due to the synchronize module changing sufficiently to make that commit no longer merge cleanly. Fixes #20361 Related to #20311 --- lib/ansible/modules/files/synchronize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/files/synchronize.py b/lib/ansible/modules/files/synchronize.py index c4fba95272..bd444d2a5b 100644 --- a/lib/ansible/modules/files/synchronize.py +++ b/lib/ansible/modules/files/synchronize.py @@ -483,7 +483,7 @@ def main(): if dest_port is not None: ssh_cmd.extend(['-o', 'Port=%s' % dest_port]) if not verify_host: - ssh_cmd.extend(['-o', 'StrictHostKeyChecking=no']) + ssh_cmd.extend(['-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null']) ssh_cmd_str = ' '.join(shlex_quote(arg) for arg in ssh_cmd) if ssh_args: ssh_cmd_str += ' %s' % ssh_args