roles: add earlyoom role
This commit is contained in:
parent
b72db7e5fa
commit
b2f0cd6808
|
@ -102,6 +102,13 @@ opened_ports:
|
|||
# 'podman' or 'nerdctl'
|
||||
rootless_container_cli: podman
|
||||
|
||||
# earlyoom kills processes on its own so make it optional
|
||||
earlyoom:
|
||||
enabled: true
|
||||
set_priority: true
|
||||
mem_min_percent: 5,2
|
||||
swap_min_percent: 10,5
|
||||
|
||||
# Configure waydroid base image
|
||||
waydroid:
|
||||
rom_type: lineage # lineage, bliss
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
- name: earlyoom | Install earlyoom package
|
||||
apk:
|
||||
name: earlyoom
|
||||
state: present
|
||||
|
||||
- name: earlyoom | Copy service configuration
|
||||
template:
|
||||
src: conf.j2
|
||||
dest: /etc/conf.d/earlyoom
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: earlyoom | Start earlyoom service on runlevel 'default'
|
||||
service:
|
||||
name: earlyoom
|
||||
runlevel: default
|
||||
enabled: yes
|
||||
state: started
|
|
@ -0,0 +1,29 @@
|
|||
# Configuration for /etc/init.d/earlyoom
|
||||
|
||||
{% if earlyoom.mem_min_percent is defined %}
|
||||
# Set available memory minimum to PERCENT of total (default 10 %). [-m]
|
||||
mem_min_percent={{ earlyoom.mem_min_percent }}
|
||||
|
||||
{% endif %}
|
||||
{% if earlyoom.swap_min_percent is defined %}
|
||||
# Set free swap minimum to PERCENT of total (default 10 %). [-s]
|
||||
# Note: Both memory and swap must be below minimum for earlyoom to act.
|
||||
swap_min_percent={{ earlyoom.swap_min_percent }}
|
||||
|
||||
{% endif %}
|
||||
{% if earlyoom.mem_min_size is defined %}
|
||||
# Set available memory minimum to SIZE[,KILL_SIZE] KiB. [-M]
|
||||
mem_min_size={{ earlyoom.mem_min_size }}
|
||||
|
||||
{% endif %}
|
||||
{% if earlyoom.swap_min_size is defined %}
|
||||
# Set free swap minimum to SIZE[,KILL_SIZE] KiB. [-S]
|
||||
swap_min_size={{ swap_min_size }}
|
||||
|
||||
{% endif %}
|
||||
{% if earlyoom.set_priority %}
|
||||
# Set niceness of earlyoom to -20 and oom_score_adj to -100? yes/no [-p]
|
||||
set_priority=yes
|
||||
|
||||
{% endif%}
|
||||
supervisor="supervise-daemon"
|
Reference in New Issue