From 304493e79548209dcaa8fd03cc994cec5450e7e5 Mon Sep 17 00:00:00 2001 From: Sergei Smolianinov Date: Wed, 15 Jun 2016 03:37:26 +0400 Subject: [PATCH] Fix synchronize module incorrect remote host processing. (#15993) Fixes #15539 (cherry picked from commit 9753cac530ac688a3623d22f223d0b38c755292f) --- lib/ansible/plugins/action/synchronize.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/synchronize.py b/lib/ansible/plugins/action/synchronize.py index 9c4ac64c5fd..20d40e7eb26 100644 --- a/lib/ansible/plugins/action/synchronize.py +++ b/lib/ansible/plugins/action/synchronize.py @@ -85,7 +85,8 @@ class ActionModule(ActionBase): alternative ssh port to a vagrant host.) """ transport = self._connection.transport - if host not in C.LOCALHOST or transport != "local": + if host not in C.LOCALHOST or transport != "local" or \ + (host in C.LOCALHOST and not port_matches_localhost_port): if port_matches_localhost_port and host in C.LOCALHOST: self._task.args['_substitute_controller'] = True return self._format_rsync_rsh_target(host, path, user)