2022-11-10 00:53:32 +01:00
|
|
|
# Run fstrim daily on ZFS. It's a no-op on ZFS filesystems, but it will run on zvols mounted via
|
|
|
|
# fstab. This helps keep zvol space requirements down.
|
|
|
|
- name: Configure daily fstrim timer
|
|
|
|
copy:
|
|
|
|
src: ./filesystem/common/etc/systemd/system/fstrim-daily.timer
|
|
|
|
dest: /etc/systemd/system/fstrim.timer
|
|
|
|
mode: 0644
|
|
|
|
register: systemd_fstrim_daily_timer_file
|
|
|
|
when:
|
|
|
|
is_zfs
|
|
|
|
|
|
|
|
- name: SystemD daemon reload
|
|
|
|
systemd:
|
|
|
|
daemon_reload: true
|
|
|
|
when:
|
|
|
|
systemd_fstrim_daily_timer_file is changed
|
|
|
|
|
2022-09-21 23:57:15 +02:00
|
|
|
- name: Enable fstrim
|
|
|
|
systemd:
|
|
|
|
name: fstrim.timer
|
|
|
|
enabled: yes
|
|
|
|
state: started
|