From d5eb4df23ee7fd8086eae988a85c42204832777d Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 3 Apr 2015 09:42:20 -0500 Subject: [PATCH] Add ability to specify using ssh_args in synchronize --- lib/ansible/runner/action_plugins/synchronize.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/runner/action_plugins/synchronize.py b/lib/ansible/runner/action_plugins/synchronize.py index f8e57ae314..fb82194b00 100644 --- a/lib/ansible/runner/action_plugins/synchronize.py +++ b/lib/ansible/runner/action_plugins/synchronize.py @@ -19,6 +19,7 @@ import os.path from ansible import utils +from ansible import constants from ansible.runner.return_data import ReturnData import ansible.utils.template as template @@ -104,9 +105,11 @@ class ActionModule(object): src = options.get('src', None) dest = options.get('dest', None) + use_ssh_args = options.pop('use_ssh_args', None) src = template.template(self.runner.basedir, src, inject) dest = template.template(self.runner.basedir, dest, inject) + use_ssh_args = template.template(self.runner.basedir, use_ssh_args, inject) try: options['local_rsync_path'] = inject['ansible_rsync_path'] @@ -187,6 +190,8 @@ class ActionModule(object): options['dest'] = dest if 'mode' in options: del options['mode'] + if use_ssh_args: + options['ssh_args'] = constants.ANSIBLE_SSH_ARGS # Allow custom rsync path argument. rsync_path = options.get('rsync_path', None)