Add zram generator automation
This commit is contained in:
parent
38a9443571
commit
bbf645e6bf
3
roles/config/files/etc/systemd/zram-generator.conf
Normal file
3
roles/config/files/etc/systemd/zram-generator.conf
Normal file
@ -0,0 +1,3 @@
|
||||
[zram0]
|
||||
zram-size = ram / 2
|
||||
compression-algorithm = zstd
|
@ -111,6 +111,12 @@
|
||||
scope: user
|
||||
tags: services
|
||||
|
||||
- name: Reload system systemd services
|
||||
ansible.builtin.systemd_service:
|
||||
daemon_reload: true
|
||||
become: true
|
||||
tags: services
|
||||
|
||||
- name: Enable fstrim
|
||||
ansible.builtin.systemd_service:
|
||||
name: fstrim.timer
|
||||
@ -119,6 +125,17 @@
|
||||
become: true
|
||||
tags: services
|
||||
|
||||
- name: Enable zram generator
|
||||
ansible.builtin.systemd_service:
|
||||
name: "systemd-zram-setup@zram0.service"
|
||||
state: "started"
|
||||
enabled: true
|
||||
when:
|
||||
- ('zram-generator' in ansible_facts.packages)
|
||||
- ('zswap.enabled=0' in {{ lookup('ansible.builtin.file', '/proc/cmdline') }})
|
||||
become: true
|
||||
tags: services
|
||||
|
||||
- name: Enable btrfsmaintenance timers
|
||||
ansible.builtin.systemd_service:
|
||||
name: "{{ item }}"
|
||||
|
Loading…
Reference in New Issue
Block a user