role_update_cache/tasks/main.yml

31 lines
812 B
YAML

---
###########################################################################
#
# This role will update the package cache on the target host.
#
###########################################################################
#
# NOTE:
# The following variable(s) must be specified in the calling playbook (usually
# done by doing a 'gather_facts' action);
#
# {{ ansible_distribution }}
# {{ ansible_os_family }}
#
###########################################################################
# tasks file for update_cache
- debug: msg="Updating package cache"
- name: updated package cache (Debian based distros)
apt:
update-cache: true
when: ansible_os_family == "Debian"
- name: updated package cache (Arch based distros)
pacman:
update_cache: true
when: ansible_os_family == "Archlinux"
# EOF