summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/dnf/tasks/main.yml
blob: 9f43d1df24894a719ef4ae5a93a9830d7326a371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# test code for the dnf module
# (c) 2014, James Tanner <tanner.jc@gmail.com>

# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.

- block:
    - include_tasks: dnf.yml
    - include_tasks: skip_broken_and_nobest.yml
    - block:
        - include_tasks: filters.yml
        - include_tasks: filters_check_mode.yml
      tags:
        - filters
    - include_tasks: gpg.yml
    - include_tasks: repo.yml
    - include_tasks: dnf_group_remove.yml
    - include_tasks: dnfinstallroot.yml
    - include_tasks: logging.yml
    - include_tasks: cacheonly.yml
  when: ansible_distribution in ['Fedora', 'RedHat']

# Attempting to install a different RHEL release in a tmpdir doesn't work (rhel8 beta)
- include_tasks: dnfreleasever.yml
  when: ansible_distribution == 'Fedora'

- when:
    - ansible_distribution == 'RedHat'
    - not dnf5|default(false)
  block:
    # FUTURE - look at including AppStream support in our local repo
    - name: list modules
      command: dnf module list -q
      register: module_list

    # A module that only has a single version
    - name: Find a module that meets our testing needs
      set_fact:
        astream_name: '@{{ module.name }}:{{ module.version }}/{{ module.profile }}'
        astream_name_no_stream: '@{{ module.name }}/{{ module.profile }}'
      vars:
        module: '{{ module_list.stdout|get_first_single_version_module }}'

    - include_tasks: modularity.yml
      tags:
        - dnf_modularity
  rescue:
    # Just in case something crazy happens when listing or parsing modules
    - meta: noop