28 lines
829 B
YAML
28 lines
829 B
YAML
- name: "trim : zfs trim service file"
|
|
ansible.builtin.copy:
|
|
src: "./trim/zfs-trim@.service"
|
|
dest: "/etc/systemd/system/zfs-trim@.service"
|
|
mode: 0644
|
|
register: systemd_zfs_trim_service_file
|
|
|
|
- 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
|
|
register: systemd_zfs_trim_monthly_timer_file
|
|
|
|
- name: "trim : systemd daemon reload"
|
|
ansible.builtin.systemd:
|
|
daemon_reload: true
|
|
when:
|
|
systemd_zfs_trim_service_file.changed or
|
|
systemd_zfs_trim_monthly_timer_file.changed
|
|
|
|
- name: "trim : enable and start timer for zfs trim of {{ item }}"
|
|
ansible.builtin.systemd:
|
|
name: "zfs-trim-monthly@{{ item }}.timer"
|
|
enabled: true
|
|
state: "started"
|
|
loop: "{{ zpools_trim }}"
|