common/tasks/apt/cleanup.yaml
Simon Cornet 2272aa6a58
All checks were successful
ci/woodpecker/push/linting Pipeline was successful
chore: migrate bare ansible_* facts to ansible_facts[] syntax
2026-05-19 09:19:03 +02:00

21 lines
488 B
YAML

---
# apt cleanup
- name: "apt cleanup"
tags: "apt-cleanup"
block:
# clean apt cache
- name: "apt - clean cache"
ansible.builtin.apt:
clean: true
changed_when: false
failed_when: false
when: 'ansible_facts["os_family"] == "Debian"'
# run fstrim if target is a VM
- name: "fstrim"
ansible.builtin.command: "fstrim /"
changed_when: false
failed_when: false
when: "ansible_facts['virtualization_type'] == 'kvm'"