From: David Galloway Date: Fri, 15 Nov 2019 15:43:47 +0000 (-0500) Subject: common: Update yum metadata from upstream epel and exclude mirrors X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F487%2Fhead;p=ceph-cm-ansible.git common: Update yum metadata from upstream epel and exclude mirrors Signed-off-by: David Galloway --- diff --git a/roles/common/tasks/epel.yml b/roles/common/tasks/epel.yml index f3befb8d..a75c97c4 100644 --- a/roles/common/tasks/epel.yml +++ b/roles/common/tasks/epel.yml @@ -27,6 +27,21 @@ - epel-mirrorlist - epel-testing-mirrorlist -- name: Clean yum cache - shell: yum clean all - when: epel_repo is defined and epel_repo is changed +# A few times a year, we'd see a bunch of 404 errors during yum transactions that involved epel mirrors. +# It has to do with upstream EPEL being updated and mirrors lagging behind. +- name: Temporarily comment mirrorlist so we can update yum cache + replace: + path: "/etc/yum.repos.d/{{ item.key }}.repo" + regexp: '^(.*mirror.*)' + replace: '#\1' + with_dict: "{{ epel_repos }}" + +- name: Update yum cache + shell: yum clean all; yum makecache + +- name: Uncomment mirrorlist + replace: + path: "/etc/yum.repos.d/{{ item.key }}.repo" + regexp: '^#(.*mirror.*)' + replace: '\1' + with_dict: "{{ epel_repos }}"