mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-30 00:21:23 -07:00
Manually backporting to stable-2 (#2865)
This commit is contained in:
parent
f6afc0f019
commit
55ce4af134
5 changed files with 481 additions and 347 deletions
|
@ -117,6 +117,37 @@
|
|||
- name: verify that excluded file is still present
|
||||
file: path={{ output_dir }}/tmpdir/empty.txt state=file
|
||||
|
||||
- name: prep our files in tmpdir again
|
||||
copy: src={{ item }} dest={{ output_dir }}/tmpdir/{{ item }}
|
||||
with_items:
|
||||
- foo.txt
|
||||
- bar.txt
|
||||
- empty.txt
|
||||
- sub
|
||||
- sub/subfile.txt
|
||||
|
||||
- name: archive using gz and remove src directory
|
||||
archive:
|
||||
path:
|
||||
- "{{ output_dir }}/tmpdir/*.txt"
|
||||
- "{{ output_dir }}/tmpdir/sub/*"
|
||||
dest: "{{ output_dir }}/archive_remove_04.gz"
|
||||
format: gz
|
||||
remove: yes
|
||||
exclude_path: "{{ output_dir }}/tmpdir/sub/subfile.txt"
|
||||
register: archive_remove_result_04
|
||||
|
||||
- debug: msg="{{ archive_remove_result_04 }}"
|
||||
|
||||
- name: verify that the files archived
|
||||
file: path={{ output_dir }}/archive_remove_04.gz state=file
|
||||
|
||||
- name: remove our gz
|
||||
file: path="{{ output_dir }}/archive_remove_04.gz" state=absent
|
||||
|
||||
- name: verify that excluded sub file is still present
|
||||
file: path={{ output_dir }}/tmpdir/sub/subfile.txt state=file
|
||||
|
||||
- name: remove temporary directory
|
||||
file:
|
||||
path: "{{ output_dir }}/tmpdir"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue