synchronize module update request

Hello fellow admins and programmers,

I was wondering if it’s possible to have the synchronize module modified so compression is optional (like compression=yes/no, etc), rather than hardcoded.

I was working on a playbook to backup all my servers and I found out about the synchronize module, very handy module. So I created a simple task as follows https://gist.github.com/sebdoesntknow/f26a60202a3e9217141b

When I ran the playbook I got the following errors: https://gist.github.com/sebdoesntknow/79e9bd6f400b0c7e9ba0

I tried a few workarounds with rsync and zlib but no avail. So I thought of just disabling compression from rsync and try again, but there’s no such option on ansible as you may know. So I had to edit the module itself which in my system is located at /usr/share/ansible/files/synchronize

Line 246 shows the following:

cmd = ‘%s --delay-updates -FF --compress’ % rsync

Commented that line out and added a copy but excluding the --compress bit

cmd = ‘%s --delay-updates -FF’ % rsync

synchronize works like a charm now.

So I’m not asking to remove the compression option (because it’s actually very useful), I just want to make it optional (i.e not hardcoded into the default rsync command).

Let me know your thoughts about it.

Best Regards,
Seb.

Sounds about right to me. I don't recall forcing the compress option when I initially wrote that module and submitted it to core. Maybe I did. Not sure why now tho.

Regardless. Have you created a PR for this yet? My only suggestion is that compression is on by default but a user can disable it by default with a --no-compress flag. The behavior everyone is accustomed to continues as it's been but users like yourself have the means to turn that off.

<tim/>

Yep, existing behavior as the default and a compress=no option would be welcome.