diff --git a/plugins/modules/synchronize.py b/plugins/modules/synchronize.py index 3d8d0fe..f6b028a 100644 --- a/plugins/modules/synchronize.py +++ b/plugins/modules/synchronize.py @@ -437,6 +437,8 @@ def main(): delay_updates=dict(type='bool', default=True), mode=dict(type='str', default='push', choices=['pull', 'push']), link_dest=dict(type='list', elements='path'), + link_dest=dict(type='list', elements='str'), + print_err_only=dict(type='bool',default=False) ), supports_check_mode=True, ) @@ -477,6 +479,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'] if '/' not in rsync: rsync = module.get_bin_path(rsync, required=True) @@ -620,6 +623,10 @@ 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 rc: return module.fail_json(msg=err, rc=rc, cmd=cmdstr)