epel-formula icon indicating copy to clipboard operation
epel-formula copied to clipboard

To use pkgrepo.managed instead of file.replace for disable or enable repo

Open alisson276 opened this issue 8 years ago • 2 comments

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.

alisson276 avatar Apr 19 '17 11:04 alisson276

Some like this:

disable_epel:
  pkgrepo.managed:
    - name: epel
    - enabled: False

alisson276 avatar Apr 19 '17 11:04 alisson276

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

myii avatar Sep 19 '19 08:09 myii