Merge pull request #1073 from sivel/sync-ssh-args
Add ability to specify using ssh_args in synchronize
This commit is contained in:
commit
c323ef9233
1 changed files with 12 additions and 2 deletions
|
@ -138,6 +138,14 @@ options:
|
||||||
- put user@ for the remote paths. If you have a custom ssh config to define the remote user for a host
|
- put user@ for the remote paths. If you have a custom ssh config to define the remote user for a host
|
||||||
that does not match the inventory user, you should set this parameter to "no".
|
that does not match the inventory user, you should set this parameter to "no".
|
||||||
default: yes
|
default: yes
|
||||||
|
use_ssh_args:
|
||||||
|
description:
|
||||||
|
- Use the ssh_args specified in ansible.cfg
|
||||||
|
default: "yes"
|
||||||
|
choices:
|
||||||
|
- "yes"
|
||||||
|
- "no"
|
||||||
|
version_added: "2.0"
|
||||||
rsync_opts:
|
rsync_opts:
|
||||||
description:
|
description:
|
||||||
- Specify additional rsync options by passing in an array.
|
- Specify additional rsync options by passing in an array.
|
||||||
|
@ -227,7 +235,8 @@ def main():
|
||||||
group = dict(type='bool'),
|
group = dict(type='bool'),
|
||||||
set_remote_user = dict(default='yes', type='bool'),
|
set_remote_user = dict(default='yes', type='bool'),
|
||||||
rsync_timeout = dict(type='int', default=0),
|
rsync_timeout = dict(type='int', default=0),
|
||||||
rsync_opts = dict(type='list')
|
rsync_opts = dict(type='list'),
|
||||||
|
ssh_args = dict(type='str'),
|
||||||
),
|
),
|
||||||
supports_check_mode = True
|
supports_check_mode = True
|
||||||
)
|
)
|
||||||
|
@ -254,6 +263,7 @@ def main():
|
||||||
owner = module.params['owner']
|
owner = module.params['owner']
|
||||||
group = module.params['group']
|
group = module.params['group']
|
||||||
rsync_opts = module.params['rsync_opts']
|
rsync_opts = module.params['rsync_opts']
|
||||||
|
ssh_args = module.params['ssh_args']
|
||||||
|
|
||||||
cmd = '%s --delay-updates -F' % rsync
|
cmd = '%s --delay-updates -F' % rsync
|
||||||
if compress:
|
if compress:
|
||||||
|
@ -306,7 +316,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
private_key = '-i '+ private_key
|
private_key = '-i '+ private_key
|
||||||
|
|
||||||
ssh_opts = '-S none -o StrictHostKeyChecking=no'
|
ssh_opts = '-S none -o StrictHostKeyChecking=no %s' % ssh_args
|
||||||
if dest_port != 22:
|
if dest_port != 22:
|
||||||
cmd += " --rsh 'ssh %s %s -o Port=%s'" % (private_key, ssh_opts, dest_port)
|
cmd += " --rsh 'ssh %s %s -o Port=%s'" % (private_key, ssh_opts, dest_port)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue