1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/pkgng/tasks/create-outofdate-pkg.yml
Felix Fontein 24ca69aa05
CI: Remove 'warn:' that's removed in ansible-core 2.14 (#4434)
* Remove 'warn:' that's removed in ansible-core 2.14.

* Install virtualenv when needed.
2022-04-01 22:53:05 +02:00

48 lines
1.4 KiB
YAML

---
- name: Create temporary directory for package creation
tempfile:
state: directory
register: pkgng_test_outofdate_pkg_tempdir
- name: Copy intentionally out-of-date package manifest to testhost
template:
src: MANIFEST.json.j2
# Plus-sign must be added at the destination
# CI doesn't like files with '+' in them in the repository
dest: '{{ pkgng_test_outofdate_pkg_tempdir.path }}/MANIFEST'
- name: Create out-of-date test package file
command:
argv:
- pkg
- create
- '--verbose'
- '--out-dir'
- '{{ pkgng_test_outofdate_pkg_tempdir.path }}'
- '--manifest'
- '{{ pkgng_test_outofdate_pkg_tempdir.path }}/MANIFEST'
# pkg switched from .txz to .pkg in version 1.17.0
# Might as well look for all valid pkg extensions.
- name: Find created package file
find:
path: '{{ pkgng_test_outofdate_pkg_tempdir.path }}'
use_regex: yes
pattern: '.*\.(pkg|tzst|t[xbg]z|tar)'
register: pkgng_test_outofdate_pkg_tempfile
- name: There should be only one package
assert:
that:
- pkgng_test_outofdate_pkg_tempfile.files | count == 1
- name: Copy the created package file to the expected location
copy:
remote_src: yes
src: '{{ pkgng_test_outofdate_pkg_tempfile.files[0].path }}'
dest: '{{ pkgng_test_outofdate_pkg_path }}'
- name: Remove temporary directory
file:
state: absent
path: '{{ pkgng_test_outofdate_pkg_tempdir.path }}'