From 6cb7fe05d0b36b8955e8ca5fd1a2f40c6962ca94 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Wed, 12 Apr 2023 14:55:02 -0400 Subject: [PATCH] common: use EPEL metalink Some mirrors are stale (https://pagure.io/fedora-infrastructure/issue/11233) Use MirrorManager's metalink application so we always get up-to-date mirrors. MirrorManager will also return the list of mirror that carry each architecture (x86_64, aarch64, etc) so we will not need to manage that information ourselves here. --- roles/common/defaults/main.yml | 4 ++-- roles/common/tasks/epel.yml | 11 ----------- roles/common/templates/epel-mirrorlist | 9 --------- roles/common/templates/epel-testing-mirrorlist | 9 --------- 4 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 roles/common/templates/epel-mirrorlist delete mode 100644 roles/common/templates/epel-testing-mirrorlist diff --git a/roles/common/defaults/main.yml b/roles/common/defaults/main.yml index a1d90e86..f42e09da 100644 --- a/roles/common/defaults/main.yml +++ b/roles/common/defaults/main.yml @@ -17,13 +17,13 @@ epel_mirror_baseurl: "http://dl.fedoraproject.org/pub/epel" epel_repos: epel: name: "Extra Packages for Enterprise Linux" - mirrorlist: file:///etc/yum.repos.d/epel-mirrorlist + metalink: "https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir" # ternary requires ansible >= 1.9 enabled: "{{ enable_epel | ternary(1, 0) }}" gpgcheck: 0 epel-testing: name: "Extra Packages for Enterprise Linux - Testing" - mirrorlist: file:///etc/yum.repos.d/epel-testing-mirrorlist + metalink: "https://mirrors.fedoraproject.org/metalink?repo=testing-epel$releasever&arch=$basearch&infra=$infra&content=$contentdir" enabled: 0 gpgcheck: 0 diff --git a/roles/common/tasks/epel.yml b/roles/common/tasks/epel.yml index f3befb8d..9b5f5dd9 100644 --- a/roles/common/tasks/epel.yml +++ b/roles/common/tasks/epel.yml @@ -16,17 +16,6 @@ register: epel_repo with_dict: "{{ epel_repos }}" -- name: Configure local epel mirrorlists - template: - src: '{{ item }}' - dest: '/etc/yum.repos.d/{{ item }}' - owner: root - group: root - mode: 0644 - with_items: - - epel-mirrorlist - - epel-testing-mirrorlist - - name: Clean yum cache shell: yum clean all when: epel_repo is defined and epel_repo is changed diff --git a/roles/common/templates/epel-mirrorlist b/roles/common/templates/epel-mirrorlist deleted file mode 100644 index a4c4b0b9..00000000 --- a/roles/common/templates/epel-mirrorlist +++ /dev/null @@ -1,9 +0,0 @@ -# {{ ansible_managed }} - -# local yum mirrorlist for epel-{{ ansible_distribution_major_version }} -http://download-ib01.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://download-cc-rdu01.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://mirrors.cat.pdx.edu/epel/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://mirror.pnl.gov/epel/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://ftp.linux.ncsu.edu/pub/epel/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://mirror.oss.ou.edu/epel/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch diff --git a/roles/common/templates/epel-testing-mirrorlist b/roles/common/templates/epel-testing-mirrorlist deleted file mode 100644 index 2e2f519d..00000000 --- a/roles/common/templates/epel-testing-mirrorlist +++ /dev/null @@ -1,9 +0,0 @@ -# {{ ansible_managed }} - -# local yum mirrorlist for epel-testing-{{ ansible_distribution_major_version }} -http://download-ib01.fedoraproject.org/pub/epel/testing/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://download-cc-rdu01.fedoraproject.org/pub/epel/testing/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://mirrors.cat.pdx.edu/epel/testing/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://mirror.pnl.gov/epel/testing/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://fedora-epel.mirror.lstn.net/testing/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch -http://mirror.oss.ou.edu/epel/testing/{{ ansible_distribution_major_version }}/{% if ansible_distribution_major_version|int >= 8 %}Everything/{% endif %}$basearch