ansible-edda/playbooks/tasks/hosts/fstrim.yml

23 lines
599 B
YAML

# 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
- name: Enable fstrim
systemd:
name: fstrim.timer
enabled: yes
state: started