diff --git a/compact_mem.yaml b/compact_mem.yaml new file mode 100644 index 0000000..8a45781 --- /dev/null +++ b/compact_mem.yaml @@ -0,0 +1,5 @@ +--- +- name: "Compact mem on VMs." + hosts: all + roles: + - compact_mem diff --git a/roles/compact_mem/tasks/main.yaml b/roles/compact_mem/tasks/main.yaml new file mode 100644 index 0000000..b163fe9 --- /dev/null +++ b/roles/compact_mem/tasks/main.yaml @@ -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