-
-
Save bluedevilx/89fdf71e7354e03507da44ed22c25b3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - 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