From e2b8f05b7979616d799914b4dd9839e70082d508 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 18 Aug 2014 12:59:00 -0500 Subject: [PATCH] Add option to disable ControlPath to ssh options during rsync Fixes #8473 --- library/files/synchronize | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/library/files/synchronize b/library/files/synchronize index 7e9ea8e032..842dd86384 100644 --- a/library/files/synchronize +++ b/library/files/synchronize @@ -303,17 +303,18 @@ def main(): else: private_key = '-i '+ private_key + ssh_opts = '-S none -o StrictHostKeyChecking=no' if dest_port != 22: - cmd += " --rsh '%s %s -o %s -o Port=%s'" % ('ssh', private_key, - 'StrictHostKeyChecking=no', dest_port) + cmd += " --rsh 'ssh %s %s -o Port=%s'" % (private_key, ssh_opts, dest_port) else: - cmd += " --rsh '%s %s -o %s'" % ('ssh', private_key, - 'StrictHostKeyChecking=no') # need ssh param + cmd += " --rsh 'ssh %s %s'" % (private_key, ssh_opts) # need ssh param if rsync_path: cmd = cmd + " --rsync-path=%s" % (rsync_path) + if rsync_opts: cmd = cmd + " " + " ".join(rsync_opts) + changed_marker = '<>' cmd = cmd + " --out-format='" + changed_marker + "%i %n%L'"