summaryrefslogtreecommitdiff
path: root/roles/storage/zfs/syncoid/tasks
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-05-02 16:45:47 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-05-02 16:45:47 +0200
commitfd1363eedadb183c439a00e143fd05ba8e10ad31 (patch)
tree8761cca63cdedcd5d0772bea48ac69262ca71f16 /roles/storage/zfs/syncoid/tasks
parentadapt backup sanoid template for ch-epimetheus only (diff)
add timer for syncoid backups
Diffstat (limited to 'roles/storage/zfs/syncoid/tasks')
-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