34 lines
1.0 KiB
YAML
34 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: systemd_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: systemd_zfs_scrub_monthly_timer_file
|
|
|
|
- name: "scrub : systemd daemon reload"
|
|
ansible.builtin.systemd:
|
|
daemon_reload: true
|
|
when:
|
|
systemd_zfs_scrub_service_file.changed or
|
|
systemd_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: "{{ zpools }}"
|