Skip to content

Commit

Permalink
Fix: Add update Cache
Browse files Browse the repository at this point in the history
  • Loading branch information
stephrobert committed Nov 20, 2022
1 parent 409fe8c commit 330e717
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
block:
- name: Gather ansible facts
ansible.builtin.setup:

- name: Update cache
ansible.builtin.include_tasks:
file: update_cache.yml
- name: Install bootstrap packages (package)
become: true
ansible.builtin.package:
Expand Down
36 changes: 36 additions & 0 deletions tasks/update_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- name: Update apt cache
ansible.builtin.apt:
update_cache: yes
when: ansible_pkg_mgr == "apt"
become: true

- name: Update yum cache
ansible.builtin.yum:
update_cache: yes
when: ansible_pkg_mgr == "yum"
become: true

- name: Update apk cache
community.general.apk:
update_cache: yes
when: ansible_pkg_mgr == "apk"
become: true

- name: Update dnf cache
ansible.builtin.dnf:
update_cache: yes
when: ansible_pkg_mgr == "dnf"
become: true

- name: Update zypper cache
community.general.zypper:
name: zypper
update_cache: yes
when: ansible_pkg_mgr == "zypper"
become: true

- name: Update pacman cache
community.general.pacman:
update_cache: yes
when: ansible_pkg_mgr == "pacman"
become: true

0 comments on commit 330e717

Please sign in to comment.