homeserver/roles/mgrote.disable_oom_killer/tasks/main.yml
mg 7e55caf5da Rolle: Disable OOM Killer (#384)
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#384
2022-06-19 18:18:48 +02:00

13 lines
349 B
YAML

---
- name: disable oom-killer in sysctl.conf (works after a reboot)
become: true
blockinfile:
path: /etc/sysctl.conf
block: |
vm.oom-kill = 0
register: sysctl
- name: disable oom-killer through /proc
become: true
ansible.builtin.command: echo 2 > /proc/sys/vm/overcommit_memory
when: sysctl.changed