mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 07:05:27 +01:00
Added option to allow SSH connection multiplixing as opposed to hard-coded disabling it. Fixes bug #24365.
This commit is contained in:
parent
6343dbdcff
commit
cbf54f214c
1 changed files with 15 additions and 1 deletions
|
|
@ -141,6 +141,16 @@ options:
|
|||
- Use the ssh_args specified in ansible.cfg. Setting this to `yes` will also make `synchronize` use `ansible_ssh_common_args`.
|
||||
type: bool
|
||||
default: no
|
||||
ssh_connection_multiplexing:
|
||||
description:
|
||||
- SSH connection multiplexing for rsync is disabled by default to prevent misconfigured ControlSockets from resulting in failed SSH connections.
|
||||
This is accomplished by setting the SSH C(ControlSocket) to C(none).
|
||||
- Set this option to C(yes) to allow multiplexing and reduce SSH connection overhead.
|
||||
- Note that simply setting this option to C(yes) is not enough;
|
||||
You must also configure SSH connection multiplexing in your SSH client config by setting values for C(ControlMaster),
|
||||
C(ControlPersist) and C(ControlPath).
|
||||
type: bool
|
||||
default: no
|
||||
rsync_opts:
|
||||
description:
|
||||
- Specify additional rsync options by passing in an array.
|
||||
|
|
@ -392,6 +402,7 @@ def main():
|
|||
rsync_timeout=dict(type='int', default=0),
|
||||
rsync_opts=dict(type='list', default=[]),
|
||||
ssh_args=dict(type='str'),
|
||||
ssh_connection_multiplexing=dict(type='bool', default=False),
|
||||
partial=dict(type='bool', default=False),
|
||||
verify_host=dict(type='bool', default=False),
|
||||
mode=dict(type='str', default='push', choices=['pull', 'push']),
|
||||
|
|
@ -432,6 +443,7 @@ def main():
|
|||
group = module.params['group']
|
||||
rsync_opts = module.params['rsync_opts']
|
||||
ssh_args = module.params['ssh_args']
|
||||
ssh_connection_multiplexing = module.params['ssh_connection_multiplexing']
|
||||
verify_host = module.params['verify_host']
|
||||
link_dest = module.params['link_dest']
|
||||
|
||||
|
|
@ -507,7 +519,9 @@ def main():
|
|||
|
||||
# if the user has not supplied an --rsh option go ahead and add ours
|
||||
if not has_rsh:
|
||||
ssh_cmd = [module.get_bin_path('ssh', required=True), '-S', 'none']
|
||||
ssh_cmd = [module.get_bin_path('ssh', required=True)]
|
||||
if not ssh_connection_multiplexing:
|
||||
ssh_cmd.extend(['-S', 'none'])
|
||||
if private_key is not None:
|
||||
ssh_cmd.extend(['-i', private_key])
|
||||
# If the user specified a port value
|
||||
|
|
|
|||
Loading…
Reference in a new issue