summaryrefslogtreecommitdiff
path: root/roles/storage
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-05-19 23:39:10 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-05-19 23:39:10 +0200
commit389f7be86f07a08a6282e02913a676aeef328db5 (patch)
treeb0548116d5d14fd62c1295d408d5e7086af9b9dd /roles/storage
parentsyncoid: autosuspend cleanup and cooldown (diff)
syncoid: run vs pull and fix autosuspend timer
Diffstat (limited to 'roles/storage')
-rw-r--r--roles/storage/zfs/syncoid/tasks/main.yml15
-rw-r--r--roles/storage/zfs/syncoid/templates/autosuspend.timer.j22
-rw-r--r--roles/storage/zfs/syncoid/templates/pull.service.j2 (renamed from roles/storage/zfs/syncoid/templates/run.service.j2)0
-rw-r--r--roles/storage/zfs/syncoid/templates/pull.timer.j2 (renamed from roles/storage/zfs/syncoid/templates/run.timer.j2)0
4 files changed, 11 insertions, 6 deletions
diff --git a/roles/storage/zfs/syncoid/tasks/main.yml b/roles/storage/zfs/syncoid/tasks/main.yml
index bab61a89..6232eea7 100644
--- a/roles/storage/zfs/syncoid/tasks/main.yml
+++ b/roles/storage/zfs/syncoid/tasks/main.yml
@@ -43,8 +43,8 @@
loop_control:
label: "{{ item.key }}"
template:
- src: run.service.j2
- dest: "/etc/systemd/system/syncoid-run-{{ item.key }}.service"
+ src: pull.service.j2
+ dest: "/etc/systemd/system/syncoid-pull-{{ item.key }}.service"
- name: create systemd timer units for periodic backups
loop: "{{ zfs_syncoid_sources | dict2items }}"
@@ -52,8 +52,8 @@
label: "{{ item.key }}"
when: "'periodic' in item.value"
template:
- src: run.timer.j2
- dest: "/etc/systemd/system/syncoid-run-{{ item.key }}.timer"
+ src: pull.timer.j2
+ dest: "/etc/systemd/system/syncoid-pull-{{ item.key }}.timer"
- name: make sure systemd timer units for periodic backups are enabled and started
loop: "{{ zfs_syncoid_sources | dict2items }}"
@@ -62,7 +62,7 @@
when: "'periodic' in item.value"
systemd:
daemon_reload: yes
- name: "syncoid-run-{{ item.key }}.timer"
+ name: "syncoid-pull-{{ item.key }}.timer"
state: started
enabled: yes
@@ -84,6 +84,11 @@
dest: /var/lib/syncoid/syncoid_post
mode: 0755
+ - name: install python deps
+ apt:
+ name: "{{ python_basename }}-dbus"
+ state: present
+
- name: install autosuspend script
template:
src: autosuspend.py.j2
diff --git a/roles/storage/zfs/syncoid/templates/autosuspend.timer.j2 b/roles/storage/zfs/syncoid/templates/autosuspend.timer.j2
index 5c0b3329..40852739 100644
--- a/roles/storage/zfs/syncoid/templates/autosuspend.timer.j2
+++ b/roles/storage/zfs/syncoid/templates/autosuspend.timer.j2
@@ -2,7 +2,7 @@
Description=automatic system suspender for syncoid-based backups
[Timer]
-OnCalendar=*-*-* *-03/10-00
+OnCalendar=*-*-* *:03/10:00
[Install]
WantedBy=timers.target
diff --git a/roles/storage/zfs/syncoid/templates/run.service.j2 b/roles/storage/zfs/syncoid/templates/pull.service.j2
index 33283576..33283576 100644
--- a/roles/storage/zfs/syncoid/templates/run.service.j2
+++ b/roles/storage/zfs/syncoid/templates/pull.service.j2
diff --git a/roles/storage/zfs/syncoid/templates/run.timer.j2 b/roles/storage/zfs/syncoid/templates/pull.timer.j2
index cc252854..cc252854 100644
--- a/roles/storage/zfs/syncoid/templates/run.timer.j2
+++ b/roles/storage/zfs/syncoid/templates/pull.timer.j2