summaryrefslogtreecommitdiff
path: root/roles/storage/zfs/syncoid/tasks
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-05-19 18:55:24 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-05-19 18:55:24 +0200
commita23e7f8055818a1d95b005998f094a249f71b490 (patch)
tree587f74d54eff1d6de7c497fc956840b85e16dceb /roles/storage/zfs/syncoid/tasks
parentinitial version of syncoid autosuspender (diff)
syncoid: autosuspend cleanup and cooldown
Diffstat (limited to 'roles/storage/zfs/syncoid/tasks')
-rw-r--r--roles/storage/zfs/syncoid/tasks/main.yml15
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/storage/zfs/syncoid/tasks/main.yml b/roles/storage/zfs/syncoid/tasks/main.yml
index 7c489baa..bab61a89 100644
--- a/roles/storage/zfs/syncoid/tasks/main.yml
+++ b/roles/storage/zfs/syncoid/tasks/main.yml
@@ -69,6 +69,21 @@
- name: enable autosuspend
when: zfs_syncoid_autosuspend
block:
+ - name: generate syncoid post script
+ copy:
+ content: |
+ #!/bin/bash
+
+ echo "running sanoid --prune to cleanup old snapshots"
+ sleep 5
+ systemctl start --wait sanoid-prune.service
+
+ echo "wait 60s (autosuspend cooldown period)"
+ sleep 60
+ echo "done."
+ dest: /var/lib/syncoid/syncoid_post
+ mode: 0755
+
- name: install autosuspend script
template:
src: autosuspend.py.j2