diff --git a/roles/configure-mirrors/handlers/main.yaml b/roles/configure-mirrors/handlers/main.yaml index 97aaf7620..560ad787c 100644 --- a/roles/configure-mirrors/handlers/main.yaml +++ b/roles/configure-mirrors/handlers/main.yaml @@ -7,19 +7,15 @@ tags: - skip_ansible_lint -- name: Update dnf cache +- name: Update yum/dnf cache become: yes command: "{{ item }}" + args: + warn: false with_items: - - dnf clean all - - dnf makecache - -- name: Update yum cache - become: yes - command: "{{ item }}" - with_items: - - yum clean all - - yum makecache + - "{{ ansible_pkg_mgr }} clean all" + - "{{ ansible_pkg_mgr }} makecache -v" + # verbose is needed in order to make it possible to debug potential failures - name: Update zypper cache become: yes diff --git a/roles/configure-mirrors/tasks/main.yaml b/roles/configure-mirrors/tasks/main.yaml index 4f65d42b6..c98c53dc7 100644 --- a/roles/configure-mirrors/tasks/main.yaml +++ b/roles/configure-mirrors/tasks/main.yaml @@ -1,3 +1,8 @@ +- name: gather needed facts + when: ansible_pkg_mgr is not defined + setup: + gather_subset: pkg_mgr + - name: Set up infrastructure mirrors include: mirror.yaml when: mirror_fqdn is defined diff --git a/roles/configure-mirrors/tasks/mirror/CentOS-7.yaml b/roles/configure-mirrors/tasks/mirror/CentOS-7.yaml index 38847e92e..799147cf8 100644 --- a/roles/configure-mirrors/tasks/mirror/CentOS-7.yaml +++ b/roles/configure-mirrors/tasks/mirror/CentOS-7.yaml @@ -10,7 +10,7 @@ - etc/yum.repos.d/CentOS-Base.repo - etc/yum.repos.d/epel.repo notify: - - Update yum cache + - Update yum/dnf cache # http://dnf.readthedocs.io/en/latest/conf_ref.html#options-for-both-main-and-repo # deltarpm is useful when the bottleneck is the network throughput. diff --git a/roles/configure-mirrors/tasks/mirror/CentOS-8.yaml b/roles/configure-mirrors/tasks/mirror/CentOS-8.yaml index 8e6489789..b42826f40 100644 --- a/roles/configure-mirrors/tasks/mirror/CentOS-8.yaml +++ b/roles/configure-mirrors/tasks/mirror/CentOS-8.yaml @@ -13,7 +13,7 @@ - etc/yum.repos.d/CentOS-PowerTools.repo - etc/yum.repos.d/epel.repo notify: - - Update dnf cache + - Update yum/dnf cache # http://dnf.readthedocs.io/en/latest/conf_ref.html#options-for-both-main-and-repo # deltarpm is useful when the bottleneck is the network throughput. diff --git a/roles/configure-mirrors/tasks/mirror/Fedora.yaml b/roles/configure-mirrors/tasks/mirror/Fedora.yaml index fcf664646..81eb5f460 100644 --- a/roles/configure-mirrors/tasks/mirror/Fedora.yaml +++ b/roles/configure-mirrors/tasks/mirror/Fedora.yaml @@ -10,7 +10,7 @@ - etc/yum.repos.d/fedora.repo - etc/yum.repos.d/fedora-updates.repo notify: - - Update dnf cache + - Update yum/dnf cache # http://dnf.readthedocs.io/en/latest/conf_ref.html#options-for-both-main-and-repo # deltarpm is useful when the bottleneck is the network throughput.