35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
---
|
|
- name: "scrub : zpool status mail script"
|
|
ansible.builtin.template:
|
|
src: "./scrub/systemd-mail-zpool-status.j2"
|
|
dest: "/usr/local/sbin/systemd-mail-zpool-status"
|
|
mode: 0755
|
|
|
|
- name: "scrub : zfs scrub systemd service file"
|
|
ansible.builtin.copy:
|
|
src: "./scrub/zfs-scrub@.service"
|
|
dest: "/etc/systemd/system/zfs-scrub@.service"
|
|
mode: 0644
|
|
register: system_zfs_scrub_service_file
|
|
|
|
- name: "scrub : zfs scrub systemd timer file"
|
|
ansible.builtin.copy:
|
|
src: "./scrub/zfs-scrub-monthly@.timer"
|
|
dest: "/etc/systemd/system/zfs-scrub-monthly@.timer"
|
|
mode: 0644
|
|
register: system_zfs_scrub_monthly_timer_file
|
|
|
|
- name: "scrub : systemd daemon reload"
|
|
ansible.builtin.systemd:
|
|
daemon_reload: true
|
|
when:
|
|
system_zfs_scrub_service_file.changed or
|
|
system_zfs_scrub_monthly_timer_file.changed
|
|
|
|
- name: "scrub : enable and start timer for zfs scrub of {{ item }}"
|
|
ansible.builtin.systemd:
|
|
name: "zfs-scrub-monthly@{{ item }}.timer"
|
|
enabled: true
|
|
state: "started"
|
|
loop: "{{ system_zfs_zpools }}"
|