2022-09-11 20:55:30 +02:00
|
|
|
- name: Zfs trim service file
|
|
|
|
copy:
|
2022-09-22 23:01:27 +02:00
|
|
|
src: ./filesystem/{{ ansible_hostname }}/etc/systemd/system/zfs-trim@.service
|
2022-09-11 20:55:30 +02:00
|
|
|
dest: /etc/systemd/system/zfs-trim@.service
|
|
|
|
mode: 0644
|
|
|
|
register: systemd_zfs_trim_service_file
|
|
|
|
|
|
|
|
- name: Zfs trim timer file
|
|
|
|
copy:
|
2022-09-22 23:01:27 +02:00
|
|
|
src: ./filesystem/{{ ansible_hostname }}/etc/systemd/system/zfs-trim-monthly@.timer
|
2022-09-11 20:55:30 +02:00
|
|
|
dest: /etc/systemd/system/zfs-trim-monthly@.timer
|
|
|
|
mode: 0644
|
|
|
|
register: systemd_zfs_trim_monthly_timer_file
|
|
|
|
|
|
|
|
- name: SystemD daemon reload
|
|
|
|
systemd:
|
|
|
|
daemon_reload: true
|
|
|
|
when:
|
|
|
|
systemd_zfs_trim_service_file is changed or
|
|
|
|
systemd_zfs_trim_monthly_timer_file is changed
|
|
|
|
|
|
|
|
- name: Enable zfs trim of bpool
|
|
|
|
systemd:
|
|
|
|
name: zfs-trim-monthly@bpool.timer
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
|
|
|
|
- name: Enable zfs trim of rpool
|
|
|
|
systemd:
|
|
|
|
name: zfs-trim-monthly@rpool.timer
|
|
|
|
enabled: yes
|
|
|
|
state: started
|