From 4472e45c659791384365cd69debae6c1ed44258e Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 14 Apr 2024 19:15:20 +0200 Subject: [PATCH] Enable fstrim systemd timer --- roles/virt-common/tasks/main.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/roles/virt-common/tasks/main.yml b/roles/virt-common/tasks/main.yml index 09b16b4..dcb1452 100644 --- a/roles/virt-common/tasks/main.yml +++ b/roles/virt-common/tasks/main.yml @@ -85,7 +85,7 @@ - firewalld - rsyslog -- name: Packages for non-LXC instances +- name: Services for non-LXC instances when: instance_type != 'lxc' block: - name: Install haveged @@ -99,6 +99,15 @@ enabled: true state: started +- name: Services for QEMU instances + when: instance_type == 'qemu' + block: + - name: Ensure fstrim systemd timer is enabled + ansible.builtin.systemd_service: + name: fstrim.timer + enabled: true + state: started + - name: Create directory '{{ data_fs }}' ansible.builtin.file: path: "{{ data_fs }}"