zuul-jobs/roles/configure-mirrors/handlers/main.yaml
Sorin Sbarnea d3a52f108d configure-mirrors: Consolidate dnf/yum handler
Simplify logic by using a single handler for redhat systems.

Change-Id: I328f0abb602f0d71372812ff64d8ad3f3764fbd0
2019-10-15 18:21:44 +01:00

30 lines
744 B
YAML

# The apt module can not be used for this since it installs python-apt
# which can not work until this command fixes the cache.
- name: Update apt cache
become: yes
command: apt-get update
# ANSIBLE0006: ignore, since we cannot use the apt module
tags:
- skip_ansible_lint
- name: Update yum/dnf cache
become: yes
command: "{{ item }}"
args:
warn: false
with_items:
- "{{ 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
command: "{{ item }}"
with_items:
- zypper clean
- zypper refresh
- name: Update Gentoo cache
become: yes
command: emerge-webrsync