feat: added compact memory for virtual machines

Signed-off-by: Louis Vallat <contact@louis-vallat.dev>
This commit is contained in:
Louis Vallat 2025-01-08 11:30:58 +01:00
parent 83da79bf82
commit 180472bf46
Signed by: louis
SSH Key Fingerprint: SHA256:0iPwDU/PZtEy/K13Oar4TzmcunmI9H5U9IsOR3jyT/Q
2 changed files with 12 additions and 0 deletions

5
compact_mem.yaml Normal file
View File

@ -0,0 +1,5 @@
---
- name: "Compact mem on VMs."
hosts: all
roles:
- compact_mem

View File

@ -0,0 +1,7 @@
---
- name: Set cron to compact memory
ansible.builtin.cron:
name: "compact memory every day"
special_time: "daily"
job: "echo 1 > /proc/sys/vm/compact_memory"
when: compact_mem