- Use dnf to install epel-release for CentOS 9 (available in base repos)
- Keep URL-based installation for CentOS 7/8
- Matches pattern used in python-install role
Change-Id: I1bc84d251a554c52348839e26a45874ff8049d4e
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
when: ansible_distribution == 'Ubuntu'
become: true
- - name: Install EPEL release repo
+ - name: Install EPEL for CentOS 9
+ ansible.builtin.dnf:
+ name: epel-release
+ state: present
+ when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '9'
+ become: true
+
+ - name: Install EPEL for CentOS 7/8
ansible.builtin.yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
state: present
disable_gpg_check: True
- when: ansible_os_family == 'RedHat'
+ when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int < 9
become: true