mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
archive: Fix paramater types (#1039)
* archive: Fix ignored sanity test parameter-list-no-elements * Fix wrong argument type * Add changelog * Add integration test for a list of files
This commit is contained in:
parent
28ac4b79e2
commit
31443e57b1
6 changed files with 32 additions and 17 deletions
|
@ -256,6 +256,29 @@
|
|||
- name: remove our xz
|
||||
file: path="{{ output_dir }}/archive_02.xz" state=absent
|
||||
|
||||
- name: archive multiple files as list
|
||||
archive:
|
||||
path:
|
||||
- "{{ output_dir }}/empty.txt"
|
||||
- "{{ output_dir }}/foo.txt"
|
||||
- "{{ output_dir }}/bar.txt"
|
||||
dest: "{{ output_dir }}/archive_list.gz"
|
||||
format: gz
|
||||
register: archive_gz_list_result
|
||||
|
||||
- name: verify that the files archived
|
||||
file: path={{output_dir}}/archive_list.gz state=file
|
||||
|
||||
- name: check if gz file exists and includes all text files
|
||||
assert:
|
||||
that:
|
||||
- "{{ archive_gz_list_result.changed }}"
|
||||
- "{{ 'archived' in archive_gz_list_result }}"
|
||||
- "{{ archive_gz_list_result['archived'] | length }} == 3"
|
||||
|
||||
- name: remove our gz
|
||||
file: path="{{ output_dir }}/archive_list.gz" state=absent
|
||||
|
||||
- name: test that gz archive that contains non-ascii filenames
|
||||
archive:
|
||||
path: "{{ output_dir }}/*.txt"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue