feat: Add earlyoom userspace oom killer
This commit is contained in:
parent
db562158f7
commit
96a63c7cc9
1 changed files with 35 additions and 15 deletions
|
|
@ -62,21 +62,21 @@
|
||||||
- name: Install glibc
|
- name: Install glibc
|
||||||
tags: glibc
|
tags: glibc
|
||||||
block:
|
block:
|
||||||
- name: Check if glibc locales exist
|
- name: Check if glibc locales exist
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: /etc/default/libc-locales
|
path: /etc/default/libc-locales
|
||||||
register: libc_locales_file
|
register: libc_locales_file
|
||||||
|
|
||||||
- name: Set correct glibc locales
|
- name: Set correct glibc locales
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/default/libc-locales
|
path: /etc/default/libc-locales
|
||||||
regexp: "^{{ item }}"
|
regexp: "^{{ item }}"
|
||||||
line: "{{ item }}"
|
line: "{{ item }}"
|
||||||
state: "present"
|
state: "present"
|
||||||
create: true
|
create: true
|
||||||
loop: "{{ locales_enabled }}"
|
loop: "{{ locales_enabled }}"
|
||||||
when: libc_locales_file.stat.exists
|
when: libc_locales_file.stat.exists
|
||||||
notify: glibc-locales-changed
|
notify: glibc-locales-changed
|
||||||
|
|
||||||
- name: Set up chrony for NTP management
|
- name: Set up chrony for NTP management
|
||||||
community.general.xbps:
|
community.general.xbps:
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
- socklog-void
|
- socklog-void
|
||||||
state: "{{ desired_package_state | default('present') }}"
|
state: "{{ desired_package_state | default('present') }}"
|
||||||
|
|
||||||
- name: Activate snooze cron services
|
- name: Activate syslog watch services
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
force: "yes"
|
force: "yes"
|
||||||
src: "/etc/sv/{{ item }}"
|
src: "/etc/sv/{{ item }}"
|
||||||
|
|
@ -141,3 +141,23 @@
|
||||||
name: "{{ user_name | default('root') }}"
|
name: "{{ user_name | default('root') }}"
|
||||||
groups: [socklog]
|
groups: [socklog]
|
||||||
append: true
|
append: true
|
||||||
|
|
||||||
|
- name: Set up earlyoom as userspace oom killer
|
||||||
|
tags:
|
||||||
|
- oom
|
||||||
|
- earlyoom
|
||||||
|
block:
|
||||||
|
- name: Install earlyoom
|
||||||
|
community.general.xbps:
|
||||||
|
name:
|
||||||
|
- earlyoom
|
||||||
|
state: "{{ desired_package_state | default('present') }}"
|
||||||
|
|
||||||
|
- name: Activate earlyoom services
|
||||||
|
ansible.builtin.file:
|
||||||
|
force: "yes"
|
||||||
|
src: "/etc/sv/{{ item }}"
|
||||||
|
dest: "/etc/runit/runsvdir/default/{{ item }}"
|
||||||
|
state: link
|
||||||
|
loop:
|
||||||
|
- earlyoom
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue