From 9fd91bec5db81bd5bc5238286ed5076332d266cb Mon Sep 17 00:00:00 2001 From: Henry Finucane Date: Sat, 12 Jul 2014 10:13:04 -0700 Subject: [PATCH] Make 'compress' optional --- files/synchronize | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/files/synchronize b/files/synchronize index c9f387c50f4..8af993ce069 100644 --- a/files/synchronize +++ b/files/synchronize @@ -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: