Add zram generator automation

This commit is contained in:
exu 2024-10-14 21:07:54 +02:00
parent 38a9443571
commit bbf645e6bf
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,3 @@
[zram0]
zram-size = ram / 2
compression-algorithm = zstd

View File

@ -111,6 +111,12 @@
scope: user scope: user
tags: services tags: services
- name: Reload system systemd services
ansible.builtin.systemd_service:
daemon_reload: true
become: true
tags: services
- name: Enable fstrim - name: Enable fstrim
ansible.builtin.systemd_service: ansible.builtin.systemd_service:
name: fstrim.timer name: fstrim.timer
@ -119,6 +125,17 @@
become: true become: true
tags: services 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 - name: Enable btrfsmaintenance timers
ansible.builtin.systemd_service: ansible.builtin.systemd_service:
name: "{{ item }}" name: "{{ item }}"