diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-05-02 16:45:47 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-05-02 16:45:47 +0200 |
commit | fd1363eedadb183c439a00e143fd05ba8e10ad31 (patch) | |
tree | 8761cca63cdedcd5d0772bea48ac69262ca71f16 /roles/storage/zfs/syncoid/tasks/main.yml | |
parent | adapt backup sanoid template for ch-epimetheus only (diff) |
add timer for syncoid backups
Diffstat (limited to 'roles/storage/zfs/syncoid/tasks/main.yml')
-rw-r--r-- | roles/storage/zfs/syncoid/tasks/main.yml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/roles/storage/zfs/syncoid/tasks/main.yml b/roles/storage/zfs/syncoid/tasks/main.yml index 53aa434a..a01900b1 100644 --- a/roles/storage/zfs/syncoid/tasks/main.yml +++ b/roles/storage/zfs/syncoid/tasks/main.yml @@ -45,3 +45,23 @@ template: src: systemd.service.j2 dest: "/etc/systemd/system/syncoid-{{ item.key }}.service" + +- name: create systemd timer units for periodic backups + loop: "{{ zfs_syncoid_sources | dict2items }}" + loop_control: + label: "{{ item.key }}" + when: "'periodic' in item.value" + template: + src: systemd.timer.j2 + dest: "/etc/systemd/system/syncoid-{{ item.key }}.timer" + +- name: make sure systemd timer units for periodic backups are enabled and started + loop: "{{ zfs_syncoid_sources | dict2items }}" + loop_control: + label: "{{ item.key }}" + when: "'periodic' in item.value" + systemd: + daemon_reload: yes + name: "syncoid-{{ item.key }}.timer" + state: started + enabled: yes |