role.securityupdates/tasks/main.yml

51 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2024-07-07 11:32:25 +00:00
---
- 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
2024-07-09 11:57:21 +00:00
when: ansible_pkg_mgr not in ["zypper"]
- name: Update index files
package:
name: zypper
update_cache: true
when: ansible_pkg_mgr in ["zypper"]
2024-07-07 11:32:25 +00:00
##############################################################################
- 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"
2024-07-09 09:22:08 +00:00
- name: Alpine/Arch/Voidlinux -- Upgrade whole system
2024-07-07 11:32:25 +00:00
package:
upgrade: yes
when: ansible_pkg_mgr in ["apk", "pacman", "xbps"]
2024-07-09 11:57:21 +00:00
- name: RedHat/Void -- Upgrade all packages
2024-07-07 11:32:25 +00:00
package:
name: "*"
state: latest
2024-07-09 11:57:21 +00:00
when: ansible_pkg_mgr in ["dnf", "xbps", "yum"]
- name: SUSE -- Upgrade all packages
package:
name: "*"
state: dist-upgrade
when: ansible_pkg_mgr in ["zypper"]
2024-07-07 11:32:25 +00:00