39 lines
993 B
YAML
39 lines
993 B
YAML
---
|
|
- name: zram | Print notice
|
|
debug:
|
|
msg:
|
|
- There is little point creating a zram of greater than twice the size of memory since we expect a 2:1 compression ratio
|
|
- Note that zram uses about 0.1% of the size of the disk when not in use so a huge zram is wasteful
|
|
- But we will use 3 zram devices at estimated (hopefully) 3:1 compression ratio with zstd
|
|
|
|
- name: zram | Configure 3 zram nodes
|
|
copy:
|
|
src: zram.conf
|
|
dest: /etc/modprobe.d/zram.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
|
|
- name: zram | Add zram.start hook for local service
|
|
template:
|
|
src: zram-start.j2
|
|
dest: /etc/local.d/zram.start
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
|
|
- name: zram | Add zram.stop hook for local service
|
|
copy:
|
|
src: zram.stop
|
|
dest: /etc/local.d/zram.stop
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
|
|
- name: zram | Add local service to runlevel 'default'
|
|
service:
|
|
name: local
|
|
runlevel: default
|
|
enabled: yes
|
|
state: started
|