Debian Codegraph @

test/integration/targets/dnf/tasks/main.yml

raw
1 # (c) 2014, James Tanner <[email protected]>
2 # Copyright: Contributors to the Ansible project
3 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
5 - set_fact:
6 dnf5: "{{ (ansible_distribution == 'RedHat' and ansible_distribution_major_version | int > 10) or ansible_distribution == 'Fedora' }}"
7
8 - when:
9 - dnf5
10 - test_auto_install | default(false) # NOTE ensure one of dnf, dnf-oldest or dnf-latest sets test_auto_install
11 block:
12 - name: Ensure module deps are not installed
13 command: dnf remove -y python3-libdnf5
14
15 - name: Test the auto_install_module_deps option
16 dnf5:
17 name: sos
18 auto_install_module_deps: false
19 register: r
20 ignore_errors: true
21
22 - assert:
23 that:
24 - r is failed
25 - r.msg is contains("Could not import the libdnf5 python module")
26
27 # Now the first dnf5 task in the integration tests should auto install python3-libdnf5 as
28 # auto_install_module_deps is true by default.
29
30 - when: ansible_distribution in ['RedHat', 'Fedora']
31 block:
32 - include_tasks: dnf.yml
33 - include_tasks: skip_broken_and_nobest.yml
34 - block:
35 - include_tasks: filters.yml
36 - include_tasks: filters_check_mode.yml
37 tags:
38 - filters
39 - include_tasks: gpg.yml
40 - include_tasks: repo.yml
41 - include_tasks: dnf_group_remove.yml
42 - include_tasks: dnfinstallroot.yml
43 - include_tasks: logging.yml
44 - include_tasks: cacheonly.yml
45 - include_tasks: multilib.yml
46 - include_tasks: dnf_config.yml
47 - include_tasks: exclude.yml
48
49 # Attempting to install a different RHEL release in a tmpdir doesn't work (rhel8 beta)
50 - include_tasks: dnfreleasever.yml
51 when: ansible_distribution == 'Fedora'
52
53 - when:
54 - ansible_distribution == 'RedHat'
55 - ansible_distribution_major_version | int == 9
56 block:
57 # FUTURE - look at including AppStream support in our local repo
58 - name: list modules
59 command: dnf module list -q
60 register: module_list
61
62 # A module that only has a single version
63 - name: Find a module that meets our testing needs
64 set_fact:
65 astream_name: '@{{ module.name }}:{{ module.version }}/{{ module.profile }}'
66 astream_name_no_stream: '@{{ module.name }}/{{ module.profile }}'
67 vars:
68 module: '{{ module_list.stdout|get_first_single_version_module }}'
69
70 - include_tasks: modularity.yml
71 tags:
72 - dnf_modularity
73 rescue:
74 # Just in case something crazy happens when listing or parsing modules
75 - meta: noop