summaryrefslogtreecommitdiff
path: root/roles/storage/zfs/syncoid/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/storage/zfs/syncoid/tasks/main.yml')
-rw-r--r--roles/storage/zfs/syncoid/tasks/main.yml20
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