Add ability to specify using ssh_args in synchronize for v2

This commit is contained in:
Matt Martz 2015-05-06 17:06:43 -05:00
parent cee7cd5d3b
commit 4f4df29cb0

View file

@ -22,6 +22,8 @@ import os.path
from ansible.plugins.action import ActionBase from ansible.plugins.action import ActionBase
from ansible.utils.boolean import boolean from ansible.utils.boolean import boolean
from ansible import constants
class ActionModule(ActionBase): class ActionModule(ActionBase):
@ -81,6 +83,7 @@ class ActionModule(ActionBase):
src = self._task.args.get('src', None) src = self._task.args.get('src', None)
dest = self._task.args.get('dest', None) dest = self._task.args.get('dest', None)
use_ssh_args = self._task.args.pop('use_ssh_args', None)
# FIXME: this doesn't appear to be used anywhere? # FIXME: this doesn't appear to be used anywhere?
local_rsync_path = task_vars.get('ansible_rsync_path') local_rsync_path = task_vars.get('ansible_rsync_path')
@ -162,6 +165,9 @@ class ActionModule(ActionBase):
if rsync_path: if rsync_path:
self._task.args['rsync_path'] = '"%s"' % rsync_path self._task.args['rsync_path'] = '"%s"' % rsync_path
if use_ssh_args:
self._task.args['ssh_args'] = constants.ANSIBLE_SSH_ARGS
# run the module and store the result # run the module and store the result
result = self._execute_module('synchronize') result = self._execute_module('synchronize')