Commit 6c107258 by Gaurav Jain

Fix rsync connections to IPv6 addresses

Similar to https://github.com/ansible/ansible/pull/11816 we can unconditionally
wrap the host address in square brackets. This is required by rsync for IPv6
addresses.
parent 718812d9
...@@ -48,9 +48,9 @@ class ActionModule(ActionBase): ...@@ -48,9 +48,9 @@ class ActionModule(ActionBase):
if host not in C.LOCALHOST: if host not in C.LOCALHOST:
if user: if user:
return '%s@%s:%s' % (user, host, path) return '%s@[%s]:%s' % (user, host, path)
else: else:
return '%s:%s' % (host, path) return '[%s]:%s' % (host, path)
if ':' not in path and not path.startswith('/'): if ':' not in path and not path.startswith('/'):
path = self._get_absolute_path(path=path) path = self._get_absolute_path(path=path)
...@@ -60,9 +60,9 @@ class ActionModule(ActionBase): ...@@ -60,9 +60,9 @@ class ActionModule(ActionBase):
transport = self._play_context.connection transport = self._play_context.connection
if host not in C.LOCALHOST or transport != "local": if host not in C.LOCALHOST or transport != "local":
if user: if user:
return '%s@%s:%s' % (user, host, path) return '%s@[%s]:%s' % (user, host, path)
else: else:
return '%s:%s' % (host, path) return '[%s]:%s' % (host, path)
if ':' not in path and not path.startswith('/'): if ':' not in path and not path.startswith('/'):
path = self._get_absolute_path(path=path) path = self._get_absolute_path(path=path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment