diff --git a/roles/config/files/etc/systemd/zram-generator.conf b/roles/config/files/etc/systemd/zram-generator.conf new file mode 100644 index 00000000..dd997c96 --- /dev/null +++ b/roles/config/files/etc/systemd/zram-generator.conf @@ -0,0 +1,3 @@ +[zram0] +zram-size = ram / 2 +compression-algorithm = zstd diff --git a/roles/config/tasks/main.yml b/roles/config/tasks/main.yml index 41ad02e7..8eee9884 100644 --- a/roles/config/tasks/main.yml +++ b/roles/config/tasks/main.yml @@ -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 }}"