[common] feat: added apt cleanup job

This commit is contained in:
Simon Cornet 2024-12-17 16:36:51 +01:00
commit 39aaf8e076
2 changed files with 24 additions and 0 deletions

17
tasks/apt/cleanup.yaml Normal file
View file

@ -0,0 +1,17 @@
---
# clean apt cache
- name: "apt - clean cache"
ansible.builtin.apt:
clean: true
when: 'ansible_os_family == "Debian"'
tags: 'apt-cleanup'
# run fstrim if target is a VM
- name: "fstrim"
ansible.builtin.command: "fstrim /"
changed_when: false
failed_when: false
tags: 'apt-cleanup'
when:
- 'type = "vm"'