]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
common: Update yum metadata from upstream epel and exclude mirrors 487/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 15 Nov 2019 15:43:47 +0000 (10:43 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Fri, 15 Nov 2019 15:43:47 +0000 (10:43 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/common/tasks/epel.yml

index f3befb8d317f4983c3c596890ffe6be5404f8b23..a75c97c414ced5d5142b71d9cef2d8e85a9cd4d8 100644 (file)
     - 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 }}"