[common] feat: added apt cleanup job
This commit is contained in:
parent
ca10f5d745
commit
39aaf8e076
2 changed files with 24 additions and 0 deletions
17
tasks/apt/cleanup.yaml
Normal file
17
tasks/apt/cleanup.yaml
Normal 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"'
|
||||
Loading…
Add table
Add a link
Reference in a new issue