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'
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- Skip creating new files on receiver.
|
||||
|
@ -205,6 +212,7 @@ def main():
|
|||
rsync_path = dict(default=None),
|
||||
archive = dict(default='yes', type='bool'),
|
||||
checksum = dict(default='no', type='bool'),
|
||||
compress = dict(default='yes', type='bool'),
|
||||
existing_only = dict(default='no', type='bool'),
|
||||
dirs = dict(default='no', type='bool'),
|
||||
recursive = dict(type='bool'),
|
||||
|
@ -231,6 +239,7 @@ def main():
|
|||
rsync_timeout = module.params.get('rsync_timeout', 'rsync_timeout')
|
||||
archive = module.params['archive']
|
||||
checksum = module.params['checksum']
|
||||
compress = module.params['compress']
|
||||
existing_only = module.params['existing_only']
|
||||
dirs = module.params['dirs']
|
||||
# the default of these params depends on the value of archive
|
||||
|
@ -243,7 +252,9 @@ def main():
|
|||
group = module.params['group']
|
||||
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:
|
||||
cmd = cmd + ' --timeout=%s' % rsync_timeout
|
||||
if module.check_mode:
|
||||
|
|
Loading…
Reference in a new issue