configure-mirrors: Consolidate dnf/yum handler

Simplify logic by using a single handler for redhat systems.

Change-Id: I328f0abb602f0d71372812ff64d8ad3f3764fbd0
This commit is contained in:
Sorin Sbarnea 2019-10-14 18:08:16 +01:00
parent 2e684a8da5
commit d3a52f108d
5 changed files with 14 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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.