Add autobackup support to pvc-ansible

This commit is contained in:
2023-10-27 02:07:49 -04:00
parent 677287fd2e
commit 90417621d7
10 changed files with 232 additions and 0 deletions

View File

@ -0,0 +1,24 @@
---
# PVC Autobackup configuration
# {{ ansible_managed }}
autobackup:
backup_root_path: {{ pvc_autobackup.backup_root_path }}
backup_root_suffix: {{ pvc_autobackup.backup_root_suffix }}
backup_tags:
{% for tag in pvc_autobackup.backup_tags %}
- {{ tag }}
{% endfor %}
backup_schedule:
full_interval: {{ pvc_autobackup.schedule.full_interval }}
full_retention: {{ pvc_autobackup.schedule.full_retention }}
auto_mount:
enabled: {{ pvc_autobackup.auto_mount.enabled }}
mount_cmds:
{% for cmd in pvc_autobackup.auto_mount.mount_cmds %}
- "{{ cmd }}"
{% endfor %}
unmount_cmds:
{% for cmd in pvc_autobackup.auto_mount.unmount_cmds %}
- "{{ cmd }}"
{% endfor %}

View File

@ -0,0 +1,8 @@
[Unit]
Description=[Cron] PVC VM autobackup (forced-full)
[Service]
Type=oneshot
IgnoreSIGPIPE=false
KillMode=process
ExecStart=/usr/bin/pvc --quiet vm autobackup --cron --force-full

View File

@ -0,0 +1,9 @@
[Unit]
Description=[Timer] PVC VM autobackup (forced-full)
[Timer]
Unit=pvc-autobackup-full.service
OnCalendar={{ pvc_autobackup.schedule.forced_full_time }}
[Install]
WantedBy=pvc.target

View File

@ -0,0 +1,8 @@
[Unit]
Description=[Cron] PVC VM autobackup (normal)
[Service]
Type=oneshot
IgnoreSIGPIPE=false
KillMode=process
ExecStart=/usr/bin/pvc --quiet vm autobackup --cron

View File

@ -0,0 +1,9 @@
[Unit]
Description=[Timer] PVC VM autobackup (normal)
[Timer]
Unit=pvc-autobackup-normal.service
OnCalendar={{ pvc_autobackup.schedule.normal_time }}
[Install]
WantedBy=pvc.target