From b02491ba705b3c89a5c4c4bc0055381254e82e89 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Sat, 10 Dec 2016 09:20:35 -0500 Subject: [PATCH] Add --blocking-io option when docker connection (#19140) --- lib/ansible/plugins/action/synchronize.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/action/synchronize.py b/lib/ansible/plugins/action/synchronize.py index 3d2b7c7b081..b92490039b5 100644 --- a/lib/ansible/plugins/action/synchronize.py +++ b/lib/ansible/plugins/action/synchronize.py @@ -354,10 +354,13 @@ class ActionModule(ActionBase): # If launching synchronize against docker container # use rsync_opts to support container to override rsh options if self._remote_transport in [ 'docker' ]: + if not isinstance(self._task.args.get('rsync_opts'), list): + self._task.args['rsync_opts'] = [] + self._task.args['rsync_opts'].append('--blocking-io') if user is not None: - self._task.args['rsync_opts'] = "--rsh='%s exec -u %s -i'" % (self._docker_cmd, user) + self._task.args['rsync_opts'].append("--rsh='%s exec -u %s -i'" % (self._docker_cmd, user)) else: - self._task.args['rsync_opts'] = "--rsh='%s exec -i'" % (self._docker_cmd) + self._task.args['rsync_opts'].append("--rsh='%s exec -i'" % self._docker_cmd) # run the module and store the result result.update(self._execute_module('synchronize', task_vars=task_vars))