mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-19 17:34:52 +00:00
46 lines
1.6 KiB
YAML
46 lines
1.6 KiB
YAML
# SPDX-License-Identifier: BSD-3-Clause
|
|
---
|
|
- name: Create EPEL yum repo and Enable EPEL
|
|
when:
|
|
- ansible_distribution in ['RedHat', 'CentOS']
|
|
- ansible_distribution_major_version in ['7', '8']
|
|
block:
|
|
- name: Create EPEL {{ ansible_distribution_major_version }}
|
|
command:
|
|
cmd: >-
|
|
rpm -iv https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{
|
|
ansible_distribution_major_version }}.noarch.rpm
|
|
# noqa command-instead-of-module
|
|
creates: /etc/yum.repos.d/epel.repo
|
|
register: __epel_status
|
|
# sometimes the rpm download returns a 403 - I think it is when too
|
|
# many parallel jobs attempt the download from the same controller in
|
|
# too short a period of time, so the epel server throttles additional
|
|
# downloads - use a retry here to mitigate
|
|
until: __epel_status is success
|
|
retries: 6
|
|
delay: 10
|
|
|
|
- name: Enable EPEL 7
|
|
command: yum-config-manager --enable epel
|
|
when: ansible_distribution_major_version == '7'
|
|
changed_when: false
|
|
|
|
- name: Enable EPEL 8
|
|
command: dnf config-manager --set-enabled epel
|
|
when: ansible_distribution_major_version == '8'
|
|
changed_when: false
|
|
|
|
- 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
|
|
mode: "0644"
|
|
when:
|
|
- ansible_distribution in ['RedHat', 'CentOS']
|
|
- ansible_distribution_major_version == '6'
|