add playbook and role to remove packages

This commit is contained in:
c0de 2024-01-04 15:07:56 -06:00
parent 9088458b5d
commit 10343d8f36
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,14 @@
---
- name: Install Packages
become: true
hosts: pibox
tasks:
- name: Loop over packages_to_remove and remove them
ansible.builtin.include_role:
name: apt-remove-package
loop: "{{ packages_to_remove }}"
loop_control:
loop_var: package
...

View File

@ -0,0 +1,10 @@
---
- name: "Remove {{ package }}"
ansible.builtin.apt:
update_cache: true
name: "{{ package }}"
state: absent
failed_when: package is undefined
...