ansible-edda/playbooks/roles/system/zfs/tasks/include/trim.yml

28 lines
836 B
YAML

- name: "trim : zfs trim service file"
ansible.builtin.copy:
src: "./trim/zfs-trim@.service"
dest: "/etc/systemd/system/zfs-trim@.service"
mode: 0644
register: system_zfs_trim_service_file
- name: "trim : zfs trim timer file"
ansible.builtin.copy:
src: "./trim/zfs-trim-monthly@.timer"
dest: "/etc/systemd/system/zfs-trim-monthly@.timer"
mode: 0644
register: system_zfs_trim_monthly_timer_file
- name: "trim : systemd daemon reload"
ansible.builtin.systemd:
daemon_reload: true
when:
system_zfs_trim_service_file.changed or
system_zfs_trim_monthly_timer_file.changed
- name: "trim : enable and start timer for zfs trim of {{ item }}"
ansible.builtin.systemd:
name: "zfs-trim-monthly@{{ item }}.timer"
enabled: true
state: "started"
loop: "{{ system_zfs_zpools_trim }}"