autoremove apt packages after upgrades
Some checks failed
/ Ansible Lint (push) Has been cancelled

This commit is contained in:
Max 2026-10-31 16:27:16 +01:00
commit ac7e18aec9
Signed by: max
SSH key fingerprint: SHA256:yZMpYLEULscoVYQvcuxhc3eWa6nymBFWCxjsRErAIY8
2 changed files with 5 additions and 1 deletions

View file

@ -1,6 +1,6 @@
# Role `apt_update_and_upgrade`
This role does an `apt-get update`, `apt-get dist-upgrade` and a potential reboot (if packages got upgraded) on the specified hosts.
This role does an `apt-get update`, `apt-get dist-upgrade`, `apt-get autoremove` and a potential reboot (if packages got upgraded) on the specified hosts.
## `hosts`

View file

@ -11,3 +11,7 @@
register: apt_update_and_upgrade__upgrade_result
notify:
- reboot the system
- name: Remove dependencies that are no longer required and purge their configuration files
ansible.builtin.apt:
autoremove: true