mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make 'compress' optional
This commit is contained in:
parent
8a6cfa1a23
commit
49889bd808
1 changed files with 12 additions and 1 deletions
|
@ -56,6 +56,13 @@ options:
|
||||||
default: 'no'
|
default: 'no'
|
||||||
required: false
|
required: false
|
||||||
version_added: "1.6"
|
version_added: "1.6"
|
||||||
|
compress:
|
||||||
|
description:
|
||||||
|
- Compress file data during the transfer. You should leave this enabled unlessit causes problems.
|
||||||
|
choices: [ 'yes', 'no' ]
|
||||||
|
default: 'yes'
|
||||||
|
required: false
|
||||||
|
version_added: "1.7"
|
||||||
existing_only:
|
existing_only:
|
||||||
description:
|
description:
|
||||||
- Skip creating new files on receiver.
|
- Skip creating new files on receiver.
|
||||||
|
@ -205,6 +212,7 @@ def main():
|
||||||
rsync_path = dict(default=None),
|
rsync_path = dict(default=None),
|
||||||
archive = dict(default='yes', type='bool'),
|
archive = dict(default='yes', type='bool'),
|
||||||
checksum = dict(default='no', type='bool'),
|
checksum = dict(default='no', type='bool'),
|
||||||
|
compress = dict(default='yes', type='bool'),
|
||||||
existing_only = dict(default='no', type='bool'),
|
existing_only = dict(default='no', type='bool'),
|
||||||
dirs = dict(default='no', type='bool'),
|
dirs = dict(default='no', type='bool'),
|
||||||
recursive = dict(type='bool'),
|
recursive = dict(type='bool'),
|
||||||
|
@ -231,6 +239,7 @@ def main():
|
||||||
rsync_timeout = module.params.get('rsync_timeout', 'rsync_timeout')
|
rsync_timeout = module.params.get('rsync_timeout', 'rsync_timeout')
|
||||||
archive = module.params['archive']
|
archive = module.params['archive']
|
||||||
checksum = module.params['checksum']
|
checksum = module.params['checksum']
|
||||||
|
compress = module.params['compress']
|
||||||
existing_only = module.params['existing_only']
|
existing_only = module.params['existing_only']
|
||||||
dirs = module.params['dirs']
|
dirs = module.params['dirs']
|
||||||
# the default of these params depends on the value of archive
|
# the default of these params depends on the value of archive
|
||||||
|
@ -243,7 +252,9 @@ def main():
|
||||||
group = module.params['group']
|
group = module.params['group']
|
||||||
rsync_opts = module.params['rsync_opts']
|
rsync_opts = module.params['rsync_opts']
|
||||||
|
|
||||||
cmd = '%s --delay-updates -FF --compress' % rsync
|
cmd = '%s --delay-updates -FF' % rsync
|
||||||
|
if compress:
|
||||||
|
cmd = cmd + ' --compress'
|
||||||
if rsync_timeout:
|
if rsync_timeout:
|
||||||
cmd = cmd + ' --timeout=%s' % rsync_timeout
|
cmd = cmd + ' --timeout=%s' % rsync_timeout
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
|
|
Loading…
Reference in a new issue