dnf: integration tests cleanup (#83203)
* remove no longer needed tasks * remove workarounds * consolidate conditionals * remove distros/versions from conditionals that are no longer present in CI
This commit is contained in:
@ -1,21 +1,4 @@
|
||||
# UNINSTALL 'python2-dnf'
|
||||
# The `dnf` module has the smarts to auto-install the relevant python
|
||||
# bindings. To test, we will first uninstall python2-dnf (so that the tests
|
||||
# on python2 will require python2-dnf)
|
||||
- name: check python2-dnf with rpm
|
||||
shell: rpm -q python2-dnf
|
||||
register: rpm_result
|
||||
ignore_errors: true
|
||||
|
||||
# Don't uninstall python2-dnf with the `dnf` module in case it needs to load
|
||||
# some dnf python files after the package is uninstalled.
|
||||
- name: uninstall python2-dnf with shell
|
||||
shell: dnf -y remove python2-dnf
|
||||
when: rpm_result is successful
|
||||
|
||||
# UNINSTALL
|
||||
# With 'python2-dnf' uninstalled, the first call to 'dnf' should install
|
||||
# python2-dnf.
|
||||
- name: uninstall sos
|
||||
dnf:
|
||||
name: sos
|
||||
@ -549,17 +532,22 @@
|
||||
- "'results' in dnf_result"
|
||||
- landsidescalping_result.rc == 0
|
||||
|
||||
# Fedora 28 (DNF 2) does not support this, just remove the package itself
|
||||
- name: remove landsidescalping package on Fedora 28
|
||||
- name: uninstall Custom Environment Group
|
||||
dnf:
|
||||
name: landsidescalping
|
||||
name: "@Custom Environment Group"
|
||||
state: absent
|
||||
when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int <= 28
|
||||
register: dnf_result
|
||||
|
||||
# cleanup until https://github.com/ansible/ansible/issues/27377 is resolved
|
||||
- name: remove Custom Environment Group
|
||||
shell: dnf -y group install "Custom Environment Group" && dnf -y group remove "Custom Environment Group"
|
||||
when: not (ansible_distribution == 'Fedora' and ansible_distribution_major_version|int <= 28)
|
||||
- name: check landsidescalping with rpm
|
||||
command: rpm -q landsidescalping
|
||||
register: landsidescalping_result
|
||||
ignore_errors: yes
|
||||
|
||||
- name: verify removal of the environment
|
||||
assert:
|
||||
that:
|
||||
- dnf_result is changed
|
||||
- landsidescalping_result.rc != 0
|
||||
|
||||
# https://github.com/ansible/ansible/issues/39704
|
||||
- name: install non-existent rpm, state=latest
|
||||
|
||||
@ -16,55 +16,28 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Note: We install the yum package onto Fedora so that this will work on dnf systems
|
||||
# We want to test that for people who don't want to upgrade their systems.
|
||||
|
||||
- include_tasks: dnf.yml
|
||||
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
|
||||
- include_tasks: skip_broken_and_nobest.yml
|
||||
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
|
||||
- include_tasks: filters_check_mode.yml
|
||||
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
tags:
|
||||
- filters
|
||||
|
||||
- include_tasks: filters.yml
|
||||
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
tags:
|
||||
- filters
|
||||
|
||||
- include_tasks: gpg.yml
|
||||
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
|
||||
- include_tasks: repo.yml
|
||||
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
|
||||
- include_tasks: dnf_group_remove.yml
|
||||
when:
|
||||
- (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
|
||||
- include_tasks: dnfinstallroot.yml
|
||||
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
- 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'
|
||||
- ansible_distribution_major_version is version('23', '>=')
|
||||
when: ansible_distribution == 'Fedora'
|
||||
|
||||
- when:
|
||||
- (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('39', '<')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
- ansible_distribution == 'RedHat'
|
||||
- not dnf5|default(false)
|
||||
block:
|
||||
# FUTURE - look at including AppStream support in our local repo
|
||||
@ -86,12 +59,3 @@
|
||||
rescue:
|
||||
# Just in case something crazy happens when listing or parsing modules
|
||||
- meta: noop
|
||||
|
||||
- include_tasks: logging.yml
|
||||
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('31', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
|
||||
- include_tasks: cacheonly.yml
|
||||
when:
|
||||
- (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
||||
|
||||
@ -11,9 +11,7 @@
|
||||
dnf5: true
|
||||
dnf_log_files:
|
||||
- /var/log/dnf5.log
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_distribution_major_version is version('37', '>=')
|
||||
when: ansible_distribution == 'Fedora'
|
||||
module_defaults:
|
||||
dnf:
|
||||
use_backend: dnf5
|
||||
|
||||
Reference in New Issue
Block a user