mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 15:15:26 +01:00
Adding rsync parameter 'quiet' to synchronize
This commit is contained in:
parent
8bb61047f8
commit
1a4c2051e8
1 changed files with 5 additions and 5 deletions
|
|
@ -438,7 +438,7 @@ def main():
|
||||||
mode=dict(type='str', default='push', choices=['pull', 'push']),
|
mode=dict(type='str', default='push', choices=['pull', 'push']),
|
||||||
link_dest=dict(type='list', elements='path'),
|
link_dest=dict(type='list', elements='path'),
|
||||||
link_dest=dict(type='list', elements='str'),
|
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,
|
supports_check_mode=True,
|
||||||
)
|
)
|
||||||
|
|
@ -479,7 +479,7 @@ def main():
|
||||||
verify_host = module.params['verify_host']
|
verify_host = module.params['verify_host']
|
||||||
link_dest = module.params['link_dest']
|
link_dest = module.params['link_dest']
|
||||||
delay_updates = module.params['delay_updates']
|
delay_updates = module.params['delay_updates']
|
||||||
print_err_only = module.params['print_err_only']
|
quiet = module.params['quiet']
|
||||||
|
|
||||||
if '/' not in rsync:
|
if '/' not in rsync:
|
||||||
rsync = module.get_bin_path(rsync, required=True)
|
rsync = module.get_bin_path(rsync, required=True)
|
||||||
|
|
@ -623,9 +623,9 @@ def main():
|
||||||
else:
|
else:
|
||||||
(rc, out, err) = module.run_command(cmdstr)
|
(rc, out, err) = module.run_command(cmdstr)
|
||||||
|
|
||||||
# If print_errors_only is true, supress the verbose output by suppressing changes but allowing errors
|
# If quiet is true, supress the verbose output by suppressing changes but allowing errors
|
||||||
if print_err_only:
|
if quiet:
|
||||||
return module.fail_json(msg=err)
|
cmd.append('--quiet')
|
||||||
|
|
||||||
if rc:
|
if rc:
|
||||||
return module.fail_json(msg=err, rc=rc, cmd=cmdstr)
|
return module.fail_json(msg=err, rc=rc, cmd=cmdstr)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue