Files
toallab-automation/roles/linux-system-roles.network/tests/tasks/enable_epel.yml

25 lines
837 B
YAML

# SPDX-License-Identifier: BSD-3-Clause
---
- name: Enable EPEL {{ ansible_distribution_major_version }}
# yamllint disable-line rule:line-length
command: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
args:
warn: false
creates: /etc/yum.repos.d/epel.repo
when:
- ansible_distribution in ['RedHat', 'CentOS']
- ansible_distribution_major_version in ['7', '8']
- name: Enable EPEL 6
copy:
dest: /etc/yum.repos.d/epel.repo
content: |
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=https://archives.fedoraproject.org/pub/archive/epel/6/$basearch
enabled=1
gpgcheck=0
when:
- ansible_distribution in ['RedHat', 'CentOS']
- ansible_distribution_major_version == '6'