mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 07:31:23 -07:00
Do not crash when lzma is not around. (#5393)
This commit is contained in:
parent
c3bdc4b394
commit
5aa1e58749
3 changed files with 39 additions and 10 deletions
|
@ -12,6 +12,37 @@
|
|||
# Make sure we start fresh
|
||||
|
||||
# Test setup
|
||||
- name: prep our files
|
||||
copy: src={{ item }} dest={{remote_tmp_dir}}/{{ item }}
|
||||
with_items:
|
||||
- foo.txt
|
||||
- bar.txt
|
||||
- empty.txt
|
||||
- sub
|
||||
- sub/subfile.txt
|
||||
|
||||
# Run twice without lzma backport installed, to make sure it does not crash
|
||||
- name: Archive - pre-test - first run
|
||||
archive:
|
||||
path: "{{ remote_tmp_dir }}/*.txt"
|
||||
dest: "{{ remote_tmp_dir }}/archive_pretest_1.tar"
|
||||
format: "tar"
|
||||
register: pretest_1
|
||||
|
||||
- name: Archive - pre-test - second run
|
||||
archive:
|
||||
path: "{{ remote_tmp_dir }}/*.txt"
|
||||
dest: "{{ remote_tmp_dir }}/archive_pretest_1.tar"
|
||||
format: "tar"
|
||||
register: pretest_2
|
||||
|
||||
- name: Archive - validate pre-test
|
||||
assert:
|
||||
that:
|
||||
- pretest_1 is changed
|
||||
- pretest_2 is not changed
|
||||
|
||||
# Install dependencies
|
||||
- name: Ensure zip is present to create test archive (yum)
|
||||
yum: name=zip state=latest
|
||||
when: ansible_facts.pkg_mgr == 'yum'
|
||||
|
@ -63,15 +94,6 @@
|
|||
when: ansible_python_version.split('.')[0] == '2'
|
||||
register: backports_lzma_pip
|
||||
|
||||
- name: prep our files
|
||||
copy: src={{ item }} dest={{remote_tmp_dir}}/{{ item }}
|
||||
with_items:
|
||||
- foo.txt
|
||||
- bar.txt
|
||||
- empty.txt
|
||||
- sub
|
||||
- sub/subfile.txt
|
||||
|
||||
- name: Define formats to test
|
||||
set_fact:
|
||||
formats:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue