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

28 lines
836 B
YAML
Raw Normal View History

2022-12-04 17:06:18 +01:00
- name: "trim : zfs trim service file"
ansible.builtin.copy:
src: "./trim/zfs-trim@.service"
dest: "/etc/systemd/system/zfs-trim@.service"
mode: 0644
2022-12-08 23:19:54 +01:00
register: system_zfs_trim_service_file
2022-12-04 17:06:18 +01:00
- 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
2022-12-08 23:19:54 +01:00
register: system_zfs_trim_monthly_timer_file
2022-12-04 17:06:18 +01:00
- name: "trim : systemd daemon reload"
ansible.builtin.systemd:
daemon_reload: true
when:
2022-12-08 23:19:54 +01:00
system_zfs_trim_service_file.changed or
system_zfs_trim_monthly_timer_file.changed
2022-12-04 17:06:18 +01:00
- name: "trim : enable and start timer for zfs trim of {{ item }}"
ansible.builtin.systemd:
name: "zfs-trim-monthly@{{ item }}.timer"
enabled: true
state: "started"
2022-12-08 23:19:54 +01:00
loop: "{{ system_zfs_zpools_trim }}"