53 lines
1.2 KiB
YAML
53 lines
1.2 KiB
YAML
---
|
|
- name: Sanity check
|
|
assert:
|
|
that: ansible_pkg_mgr in ["apk", "apt", "dnf", "pacman", "xbps", "yum", "zypper"]
|
|
msg: 'Unsupported package manager "{{ ansible_pkg_mgr }}"'
|
|
|
|
##############################################################################
|
|
|
|
- name: Update index files
|
|
package:
|
|
update_cache: true
|
|
timeout: 120
|
|
when: ansible_pkg_mgr not in ["zypper"]
|
|
|
|
- name: Update index files
|
|
package:
|
|
name: zypper
|
|
update_cache: true
|
|
timeout: 120
|
|
when: ansible_pkg_mgr in ["zypper"]
|
|
|
|
##############################################################################
|
|
|
|
- name: Void -- Pre-Update xbps
|
|
package:
|
|
upgrade_xbps: true
|
|
when: ansible_pkg_mgr == "xbps"
|
|
|
|
##############################################################################
|
|
|
|
- name: Debian -- Dist-Upgrade packages
|
|
package:
|
|
upgrade: dist
|
|
when: ansible_pkg_mgr == "apt"
|
|
|
|
- name: Alpine/Arch/Voidlinux -- Upgrade whole system
|
|
package:
|
|
upgrade: yes
|
|
when: ansible_pkg_mgr in ["apk", "pacman", "xbps"]
|
|
|
|
- name: RedHat/Void -- Upgrade all packages
|
|
package:
|
|
name: "*"
|
|
state: latest
|
|
when: ansible_pkg_mgr in ["dnf", "xbps", "yum"]
|
|
|
|
- name: SUSE -- Upgrade all packages
|
|
package:
|
|
name: "*"
|
|
state: dist-upgrade
|
|
when: ansible_pkg_mgr in ["zypper"]
|
|
|