Revert to weekly rather than daily fstrim on zfs
This commit is contained in:
parent
cdad9e3b6a
commit
abdc0fff9c
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Discard unused blocks once a day
|
||||
Documentation=man:fstrim
|
||||
ConditionVirtualization=!container
|
||||
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
AccuracySec=1h
|
||||
Persistent=true
|
||||
RandomizedDelaySec=6000
|
||||
Unit=fstrim.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
@ -1,31 +0,0 @@
|
||||
---
|
||||
# Run fstrim daily on ZFS. It's a no-op on ZFS filesystems, but it will run on zvols mounted via
|
||||
# fstab. Untrimmed zvol blocks occupy space in th ZFS pool. Therefore, this helps keep zvol space
|
||||
# requirements down if they are busy.
|
||||
- name: "fstrim : configure a daily fstrim timer"
|
||||
ansible.builtin.copy:
|
||||
src: "./fstrim/fstrim.timer"
|
||||
dest: "/etc/systemd/system/fstrim.timer"
|
||||
mode: 0644
|
||||
register: system_zfs_fstrim_timer_file
|
||||
|
||||
- name: "fstrim : systemd daemon reload"
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: true
|
||||
when:
|
||||
system_zfs_fstrim_timer_file.changed
|
||||
|
||||
# Disabling is necessary to make sure systemd uses the new timer file.
|
||||
- name: "fstrim : disable fstrim.timer"
|
||||
ansible.builtin.systemd:
|
||||
name: "fstrim.timer"
|
||||
enabled: false
|
||||
state: "stopped"
|
||||
when:
|
||||
system_zfs_fstrim_timer_file.changed
|
||||
|
||||
- name: "fstrim : enable fstrim.timer"
|
||||
ansible.builtin.systemd:
|
||||
name: "fstrim.timer"
|
||||
enabled: true
|
||||
state: "started"
|
@ -18,7 +18,3 @@
|
||||
- name: "play:system : role:zfs : tasks:load_key"
|
||||
ansible.builtin.import_tasks: "include/load_key.yml"
|
||||
tags: "system:zfs:load_key"
|
||||
|
||||
- name: "play:system : role:zfs : tasks:fstrim"
|
||||
ansible.builtin.import_tasks: "include/fstrim.yml"
|
||||
tags: "system:zfs:fstrim"
|
||||
|
Loading…
Reference in New Issue
Block a user