toolbox/playbooks/dependencies-fedora.yaml
Daniel Pawlik 96791726a3 playbooks: Add workaround for Fedora Rawhide
The Zuul executor contains Ansible 2.13.7 whose 'dnf' module is not
working as it should with Fedora Rawhide because of the DNF5 Change [1].
Unlike DNF4, DNF5 no longer pulls in the python3-dnf RPM, which causes:
  TASK [Install RPM packages]
  fedora-rawhide | ERROR
  fedora-rawhide | {
  fedora-rawhide |   "msg": "Could not import the dnf python module
      using /usr/bin/python3 (3.12.0b3 (main, Jun 21 2023, 00:00:00)
      [GCC 13.1.1 20230614 (Red Hat 13.1.1-4)]). Please install
      `python3-dnf` or `python2-dnf` package or ensure you have
      specified the correct ansible_python_interpreter. (attempted
      ['/usr/libexec/platform-python', '/usr/bin/python3',
      '/usr/bin/python2', '/usr/bin/python'])",
  fedora-rawhide |   "results": []
  fedora-rawhide | }

This adds a workaround that explicitly installs the python3-dnf RPM
using Ansible's 'command' module.  It should be removed after Zuul
contains a newer release of Ansible.

[1] https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5

https://github.com/containers/toolbox/pull/1338

Signed-off-by: Daniel Pawlik <dpawlik@redhat.com>
2023-07-11 19:40:07 +02:00

68 lines
1.9 KiB
YAML

#
# Copyright © 2022 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
- name: Install python3-dnf
become: true
command: dnf5 --assumeyes install python3-dnf
when: ansible_distribution_major_version | int >= 39
- name: Install RPM packages
become: yes
package:
update_cache: "{{ true if zuul.attempts > 1 else false }}"
name:
- ShellCheck
- bash-completion
- bats
- codespell
- fish
- flatpak-session-helper
- gcc
- golang
- golang-github-cpuguy83-md2man
- httpd-tools
- meson
- ninja-build
- openssl
- podman
- shadow-utils-subid-devel
- skopeo
- systemd
- udisks2
- name: Download Go modules
command: go mod download -x
args:
chdir: '{{ zuul.project.src_dir }}/src'
- name: Initialize Git submodules
command: git submodule init
args:
chdir: '{{ zuul.project.src_dir }}'
- name: Update Git submodules
command: git submodule update
args:
chdir: '{{ zuul.project.src_dir }}'
- name: Check versions of crucial packages
command: rpm -qa ShellCheck codespell *kernel* gcc *glibc* shadow-utils-subid-devel golang podman conmon containernetworking-plugins containers-common container-selinux crun fuse-overlayfs flatpak-session-helper skopeo
- name: Show podman versions
command: podman version
- name: Show podman debug information
command: podman info --debug