From 8e38f7475fcbed026059ef5fd18019141c05dc26 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Fri, 2 Dec 2016 07:29:24 -0800 Subject: [PATCH] Do not set docker use to None. (#18706) The user variable defaults to None, and was being passed in as a user named None. This was breaking rsync unless a specific user was set. Fixes 16306 --- lib/ansible/plugins/action/synchronize.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/synchronize.py b/lib/ansible/plugins/action/synchronize.py index d23e0eab5c..3d2b7c7b08 100644 --- a/lib/ansible/plugins/action/synchronize.py +++ b/lib/ansible/plugins/action/synchronize.py @@ -354,7 +354,10 @@ 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' ]: - self._task.args['rsync_opts'] = "--rsh='%s exec -u %s -i'" % (self._docker_cmd, user) + if user is not None: + self._task.args['rsync_opts'] = "--rsh='%s exec -u %s -i'" % (self._docker_cmd, user) + else: + self._task.args['rsync_opts'] = "--rsh='%s exec -i'" % (self._docker_cmd) # run the module and store the result result.update(self._execute_module('synchronize', task_vars=task_vars))