From adb459b64e027df473a38a80a73a2cb32465ecf6 Mon Sep 17 00:00:00 2001 From: Mandar Kulkarni Date: Mon, 12 Jul 2021 09:00:16 -0700 Subject: [PATCH] Adding rsync parameter 'quiet' to synchronize --- plugins/modules/synchronize.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/modules/synchronize.py b/plugins/modules/synchronize.py index 8444de7..393b014 100644 --- a/plugins/modules/synchronize.py +++ b/plugins/modules/synchronize.py @@ -419,7 +419,7 @@ def main(): delay_updates=dict(type='bool', default=True), mode=dict(type='str', default='push', choices=['pull', 'push']), link_dest=dict(type='list', elements='str'), - print_err_only=dict(type='bool',default=False) + quiet=dict(type='bool',default=False) ), supports_check_mode=True, ) @@ -460,7 +460,7 @@ def main(): verify_host = module.params['verify_host'] link_dest = module.params['link_dest'] delay_updates = module.params['delay_updates'] - print_err_only = module.params['print_err_only'] + quiet = module.params['quiet'] if '/' not in rsync: rsync = module.get_bin_path(rsync, required=True) @@ -610,9 +610,9 @@ def main(): else: (rc, out, err) = module.run_command(cmdstr) - # If print_errors_only is true, supress the verbose output by suppressing changes but allowing errors - if print_err_only: - return module.fail_json(msg=err) + # If quiet is true, supress the verbose output by suppressing changes but allowing errors + if quiet: + cmd.append('--quiet') if rc: return module.fail_json(msg=err, rc=rc, cmd=cmdstr)