mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-12 07:35:31 +01:00
Adding tests, corrections
This commit is contained in:
parent
8ceac49534
commit
39930cac21
3 changed files with 37 additions and 4 deletions
|
|
@ -1,2 +1,2 @@
|
|||
minor_changes:
|
||||
- synchronize - add the ``quiet`` option to supress non-error messages (https://github.com/ansible-collections/ansible.posix/issues/171).
|
||||
- synchronize - add the ``quiet`` option to suppress non-error messages (https://github.com/ansible-collections/ansible.posix/issues/171).
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ options:
|
|||
version_added: '1.3.0'
|
||||
quiet:
|
||||
description:
|
||||
- This specifies rsync quiet option which on yes/true suppresses the non-error messages
|
||||
- This specifies rsync quiet option which on yes/true suppresses the non-error messages.
|
||||
type: bool
|
||||
default: no
|
||||
version_added: '1.3.0'
|
||||
|
|
@ -429,7 +429,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'),
|
||||
quiet=dict(type='bool',default=False)
|
||||
quiet=dict(type='bool', default=False)
|
||||
),
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
|
@ -600,7 +600,7 @@ def main():
|
|||
dest = os.path.expanduser(dest)
|
||||
|
||||
if quiet:
|
||||
cmd.append('--quiet')
|
||||
cmd.append('--quiet')
|
||||
|
||||
cmd.append(source)
|
||||
cmd.append(dest)
|
||||
|
|
|
|||
|
|
@ -227,3 +227,36 @@
|
|||
- directory_a/foo.txt
|
||||
- directory_a
|
||||
- directory_b
|
||||
- name: synchronize files with quiet option
|
||||
synchronize:
|
||||
src: '{{output_dir}}/foo.txt'
|
||||
dest: '{{output_dir}}/foo.result'
|
||||
quiet: true
|
||||
register: sync_result
|
||||
ignore_errors: true
|
||||
- assert:
|
||||
that:
|
||||
- '''--quiet'' in sync_result.cmd'
|
||||
- name: Cleanup
|
||||
file:
|
||||
state: absent
|
||||
path: '{{output_dir}}/{{item}}'
|
||||
with_items:
|
||||
- foo.result
|
||||
- bar.result
|
||||
- name: synchronize files without quiet option
|
||||
synchronize:
|
||||
src: '{{output_dir}}/foo.txt'
|
||||
dest: '{{output_dir}}/foo.result'
|
||||
register: sync_result
|
||||
ignore_errors: true
|
||||
- assert:
|
||||
that:
|
||||
- '''--quiet'' not in sync_result.cmd'
|
||||
- name: Cleanup
|
||||
file:
|
||||
state: absent
|
||||
path: '{{output_dir}}/{{item}}'
|
||||
with_items:
|
||||
- foo.result
|
||||
- bar.result
|
||||
|
|
|
|||
Loading…
Reference in a new issue