Skip to content

Instantly share code, notes, and snippets.

@fungiboletus
Created October 21, 2025 21:07
Show Gist options
  • Save fungiboletus/794a265cc186e79cd5eb2fe896f05168 to your computer and use it in GitHub Desktop.
Save fungiboletus/794a265cc186e79cd5eb2fe896f05168 to your computer and use it in GitHub Desktop.
- name: Overprovision like the pros'
hosts: all
tasks:
- name: Install early OOM killer and zram
ansible.builtin.apt:
pkg:
- earlyoom
- zram-tools
- name: Configure early OOM killer
ansible.builtin.lineinfile:
path: /etc/default/earlyoom
regexp: "^EARLYOOM_ARGS="
line: 'EARLYOOM_ARGS="-r 15"'
- name: Enable early OOM killer
ansible.builtin.systemd:
name: earlyoom
state: restarted
enabled: true
daemon_reload: true
- name: Configure zram algorithm
ansible.builtin.lineinfile:
path: /etc/default/zramswap
regexp: "^ALGO="
line: "ALGO=zstd"
- name: Configure zram percent
ansible.builtin.lineinfile:
path: /etc/default/zramswap
regexp: "^PERCENT="
line: "PERCENT=25"
- name: (Re)start zram service
ansible.builtin.systemd:
name: zramswap
state: restarted
enabled: true
daemon_reload: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment