mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
unarchive module: Add creates functionality.
Closes GH-5354. Forklift copy logic into unarchive. Provides integration unit tests.
This commit is contained in:
parent
d3cbde57f5
commit
a483e42583
2 changed files with 50 additions and 1 deletions
|
@ -64,6 +64,33 @@
|
|||
- name: remove our tar.gz unarchive destination
|
||||
file: path={{output_dir}}/test-unarchive-tar-gz state=absent
|
||||
|
||||
- name: create our tar.gz unarchive destination for creates
|
||||
file: path={{output_dir}}/test-unarchive-tar-gz state=directory
|
||||
|
||||
- name: unarchive a tar.gz file with creates set
|
||||
unarchive: src={{output_dir}}/test-unarchive.tar.gz dest={{output_dir | expanduser}}/test-unarchive-tar-gz copy=no creates={{output_dir}}/test-unarchive-tar-gz/foo-unarchive.txt
|
||||
register: unarchive02b
|
||||
|
||||
- name: verify that the file was marked as changed
|
||||
assert:
|
||||
that:
|
||||
- "unarchive02b.changed == true"
|
||||
|
||||
- name: verify that the file was unarchived
|
||||
file: path={{output_dir}}/test-unarchive-tar-gz/foo-unarchive.txt state=file
|
||||
|
||||
- name: unarchive a tar.gz file with creates over an existing file
|
||||
unarchive: src={{output_dir}}/test-unarchive.tar.gz dest={{output_dir | expanduser}}/test-unarchive-tar-gz copy=no creates={{output_dir}}/test-unarchive-tar-gz/foo-unarchive.txt
|
||||
register: unarchive02c
|
||||
|
||||
- name: verify that the file was not marked as changed
|
||||
assert:
|
||||
that:
|
||||
- "unarchive02c.changed == false"
|
||||
|
||||
- name: remove our tar.gz unarchive destination
|
||||
file: path={{output_dir}}/test-unarchive-tar-gz state=absent
|
||||
|
||||
- name: create our zip unarchive destination
|
||||
file: path={{output_dir}}/test-unarchive-zip state=directory
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue