--- - name: Ensure we have needed repositories ansible.builtin.import_role: name: ci_setup tasks_from: repos.yml # Some roles like repo_setup may have altered the RPM installed files # without removing the RPM itself. Ensuring it's not installed before # enforcing its installation will make the EPEL rpm install consistent # with the actul state of the repository files. - name: Ensure EPEL is not already installed become: true ansible.builtin.dnf: name: epel-release state: absent - name: Install EPEL become: true ansible.builtin.dnf: name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_facts['distribution_major_version'] }}.noarch.rpm" disable_gpg_check: true - name: Deactivate all of EPEL repositories become: true ansible.builtin.shell: # noqa: command-instead-of-module cmd: sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/epel* - name: Install packages from EPEL become: true ansible.builtin.dnf: # noqa: package-latest enablerepo: epel name: "{{ cifmw_ci_setup_epel_pkgs }}" state: latest