feat: initial cross-distro package management role

Supports apt, dnf, yum, pacman, apk and zypper. Variables cover install,
remove, upgrade, cache refresh and autoremove.
This commit is contained in:
2026-05-24 16:40:42 +02:00
commit c94df9fefa
12 changed files with 273 additions and 0 deletions

33
tasks/dnf.yml Normal file
View File

@@ -0,0 +1,33 @@
---
- name: Update dnf cache
ansible.builtin.dnf:
update_cache: true
become: true
when: packages_update_cache | bool
- name: Upgrade all packages
ansible.builtin.dnf:
name: "*"
state: latest
become: true
when: packages_upgrade | bool
- name: Install packages
ansible.builtin.dnf:
name: "{{ packages_install }}"
state: "{{ packages_state }}"
become: true
when: packages_install | length > 0
- name: Remove packages
ansible.builtin.dnf:
name: "{{ packages_remove }}"
state: absent
become: true
when: packages_remove | length > 0
- name: Remove unused dependencies
ansible.builtin.dnf:
autoremove: true
become: true
when: packages_autoremove | bool