From fd1363eedadb183c439a00e143fd05ba8e10ad31 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 2 May 2021 16:45:47 +0200 Subject: add timer for syncoid backups --- roles/storage/zfs/syncoid/tasks/main.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'roles/storage/zfs/syncoid/tasks') 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 -- cgit v1.2.3