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:
26
tasks/apk.yml
Normal file
26
tasks/apk.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: Update apk cache
|
||||
community.general.apk:
|
||||
update_cache: true
|
||||
become: true
|
||||
when: packages_update_cache | bool
|
||||
|
||||
- name: Upgrade all packages
|
||||
community.general.apk:
|
||||
upgrade: true
|
||||
become: true
|
||||
when: packages_upgrade | bool
|
||||
|
||||
- name: Install packages
|
||||
community.general.apk:
|
||||
name: "{{ packages_install }}"
|
||||
state: "{{ packages_state }}"
|
||||
become: true
|
||||
when: packages_install | length > 0
|
||||
|
||||
- name: Remove packages
|
||||
community.general.apk:
|
||||
name: "{{ packages_remove }}"
|
||||
state: absent
|
||||
become: true
|
||||
when: packages_remove | length > 0
|
||||
Reference in New Issue
Block a user