From 118382ca7065314854eafe3418dabfa573ae9b4c Mon Sep 17 00:00:00 2001 From: Ryan Hartkopf Date: Mon, 4 May 2015 08:58:05 -0600 Subject: [PATCH] synchronize: don't add ssh_args to ssh_opts when false or null --- lib/ansible/modules/files/synchronize.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/files/synchronize.py b/lib/ansible/modules/files/synchronize.py index aaa79b69fa4..94feb8b361c 100644 --- a/lib/ansible/modules/files/synchronize.py +++ b/lib/ansible/modules/files/synchronize.py @@ -316,7 +316,11 @@ def main(): else: private_key = '-i '+ private_key - ssh_opts = '-S none -o StrictHostKeyChecking=no %s' % ssh_args + if ssh_args: + ssh_opts = '-S none -o StrictHostKeyChecking=no %s' % ssh_args + else: + ssh_opts = '-S none -o StrictHostKeyChecking=no' + if dest_port != 22: cmd += " --rsh 'ssh %s %s -o Port=%s'" % (private_key, ssh_opts, dest_port) else: