Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/pkgng/tasks/create-outofdate-pkg.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Create temporary directory for package creation
7 tempfile:
8 state: directory
9 register: pkgng_test_outofdate_pkg_tempdir
10
11 - name: Copy intentionally out-of-date package manifest to testhost
12 template:
13 src: MANIFEST.json.j2
14 # Plus-sign must be added at the destination
15 # CI doesn't like files with '+' in them in the repository
16 dest: '{{ pkgng_test_outofdate_pkg_tempdir.path }}/MANIFEST'
17
18 - name: Create out-of-date test package file
19 command:
20 argv:
21 - pkg
22 - create
23 - '--verbose'
24 - '--out-dir'
25 - '{{ pkgng_test_outofdate_pkg_tempdir.path }}'
26 - '--manifest'
27 - '{{ pkgng_test_outofdate_pkg_tempdir.path }}/MANIFEST'
28
29 # pkg switched from .txz to .pkg in version 1.17.0
30 # Might as well look for all valid pkg extensions.
31 - name: Find created package file
32 find:
33 path: '{{ pkgng_test_outofdate_pkg_tempdir.path }}'
34 use_regex: true
35 pattern: '.*\.(pkg|tzst|t[xbg]z|tar)'
36 register: pkgng_test_outofdate_pkg_tempfile
37
38 - name: There should be only one package
39 assert:
40 that:
41 - pkgng_test_outofdate_pkg_tempfile.files | count == 1
42
43 - name: Copy the created package file to the expected location
44 copy:
45 remote_src: true
46 src: '{{ pkgng_test_outofdate_pkg_tempfile.files[0].path }}'
47 dest: '{{ pkgng_test_outofdate_pkg_path }}'
48
49 - name: Remove temporary directory
50 file:
51 state: absent
52 path: '{{ pkgng_test_outofdate_pkg_tempdir.path }}'