epel-formula
epel-formula copied to clipboard
To use pkgrepo.managed instead of file.replace for disable or enable repo
Using file.replace to disable or enable EPEL repo has a problem because in the file /etc/yum.repos.d/epel.repo there are 3 repos, not just 1. So, if pillar "epel:disabled" is False the repos epel, epel-debuginfo and epel-source are enabled when I just wanna enable epel repo.
Some like this:
disable_epel:
pkgrepo.managed:
- name: epel
- enabled: False
The basis of a potential solution using pkgrepo.managed only (for amazonlinux-2 in this situation):
openvpn_external_repo:
pkgrepo.managed:
- name: epel
- humanname: Extra Packages for Enterprise Linux 7 - $basearch
- mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
- enabled: 1
- gpgcheck: 1
- gpgkey: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
- failovermethod: priority
- require_in:
- pkg: openvpn_pkgs