Update and add default vars for autobackup

This commit is contained in:
Joshua Boniface 2024-01-09 09:54:38 -05:00
parent f6878c69ad
commit b7f1c55279
3 changed files with 40 additions and 13 deletions

View File

@ -211,15 +211,15 @@ pvc_autobackup:
# conflicts should those clusters share VM names. It is optional unless this matches your situation. # conflicts should those clusters share VM names. It is optional unless this matches your situation.
# > The path "/tmp/backups" is usually recommended for remote mounting # > The path "/tmp/backups" is usually recommended for remote mounting
# > NOTE: If you specify it, the suffix must begin with a '/', but is relative to the root path! # > NOTE: If you specify it, the suffix must begin with a '/', but is relative to the root path!
backup_root_path: "/tmp/backups" root_path: "/tmp/backups"
backup_root_suffix: "/cluster1" root_suffix: "/mycluster"
# Set the VM tag(s) which will be selected for autobackup # Set the VM tag(s) which will be selected for autobackup
# > Autobackup selects VMs based on their tags. If a VM has a tag present in this list, it will be # > Autobackup selects VMs based on their tags. If a VM has a tag present in this list, it will be
# selected for autobackup at runtime; if not it will be ignored. # selected for autobackup at runtime; if not it will be ignored.
# > Usually, the tag "autobackup" here is sufficient; the administrator should then add this tag # > Usually, the tag "autobackup" here is sufficient; the administrator should then add this tag
# to any VM(s) they want to use autobackups. However, any tag may be specified to keep the tag list # to any VM(s) they want to use autobackups. However, any tag may be specified to keep the tag list
# cleaner and more focused, should the administrator choose to. # cleaner and more focused, should the administrator choose to.
backup_tags: tags:
- autobackup - autobackup
# Autobackup scheduling # Autobackup scheduling
schedule: schedule:
@ -265,20 +265,20 @@ pvc_autobackup:
# These Debian packages will be automatically installed if automatic mounting is enabled # These Debian packages will be automatically installed if automatic mounting is enabled
packages: packages:
# This example installs nfs-common, required for NFS mounts # This example installs nfs-common, required for NFS mounts
#- nfs-common # - nfs-common
# These commands are executed at the start of the backup run and should mount a filesystem or otherwise # These commands are executed at the start of the backup run and should mount a filesystem or otherwise
# prepare the system for the backups # prepare the system for the backups
mount_cmds: mount_cmds:
# This example shows an NFS mount leveraging the backup_root_path variable # This example shows an NFS mount leveraging the backup_root_path variable
#- "/usr/sbin/mount.nfs -o nfsvers=3 10.0.0.10:/backups {backup_root_path}" # - "/usr/sbin/mount.nfs -o nfsvers=3 10.0.0.10:/backups {backup_root_path}"
# This example shows an SSHFS mount leveraging the backup_root_path variable # This example shows an SSHFS mount leveraging the backup_root_path variable
#- "/usr/bin/sshfs user@hostname:/path {backup_root_path} -o default_permissions -o sshfs_sync -o IdentityFile=/path/to/id_rsa" # - "/usr/bin/sshfs user@hostname:/path {backup_root_path} -o default_permissions -o sshfs_sync -o IdentityFile=/path/to/id_rsa"
# These commands are executed at the end of the backup run and should unmount a filesystem # These commands are executed at the end of the backup run and should unmount a filesystem
unmount_cmds: unmount_cmds:
# This example shows a generic umount leveraging the backup_root_path variable # This example shows a generic umount leveraging the backup_root_path variable
#- "/usr/bin/umount {backup_root_path}" # - "/usr/bin/umount {backup_root_path}"
# This example shows an fusermount3 unmount (e.g. for SSHFS) leveraging the backup_root_path variable # This example shows an fusermount3 unmount (e.g. for SSHFS) leveraging the backup_root_path variable
#- "/usr/bin/fusermount3 -u {backup_root_path}" # - "/usr/bin/fusermount3 -u {backup_root_path}"
# Configuration file networks # Configuration file networks
# > Taken from base.yml's configuration; DO NOT MODIFY THIS SECTION. # > Taken from base.yml's configuration; DO NOT MODIFY THIS SECTION.

View File

@ -59,7 +59,34 @@ pvc_api_database_password: "PVCprovPassw0rd"
# # This slice includes all OSD processes # # This slice includes all OSD processes
# # At least 1 core per OSD should be assigned to this slice. # # At least 1 core per OSD should be assigned to this slice.
# Coordinators # VM Autobackup
# This is uncommented but disabled so this is not installed by default; enable it in your per-cluster configs
# Autobackup allows the exporting of VM backups automatically to an external disk target.
# These values are default; ensure you modify them in your own group_vars to match your system!
pvc_autobackup:
enabled: no
root_path: /tmp/backups
root_suffix: /mycluster
tags:
- autobackup
schedule:
normal_time: "Tue..Sun *-*-* 0:0:00"
forced_full_time: "Mon *-*-* 0:0:00"
full_interval: 7
full_retention: 2
auto_mount:
enabled: no
packages:
# Example: Install nfs-common for NFS mounts
# - nfs-common
mount_cmds:
# Example: Mount an NFSv3 path from 10.0.0.10:/backups to {backup_root_path}
# - "/usr/sbin/mount.nfs -o nfsvers=3 10.0.0.10:/backups {backup_root_path}"
unmount_cmds:
# Example: Unmount the {backup_root_path}
# - "/usr/bin/umount {backup_root_path}"
# Coordinators & Nodes list
pvc_nodes: pvc_nodes:
- hostname: "pvc1" # The full ansible inventory hostname of the node - hostname: "pvc1" # The full ansible inventory hostname of the node
is_coordinator: yes # If the node is a coordinator or not is_coordinator: yes # If the node is a coordinator or not

View File

@ -163,11 +163,11 @@ api:
private_key: "{{ pvc_api_ssl_key_path if pvc_api_ssl_key_path is defined and pvc_api_ssl_cert_path else '/etc/pvc/api-key.pem' }}" private_key: "{{ pvc_api_ssl_key_path if pvc_api_ssl_key_path is defined and pvc_api_ssl_cert_path else '/etc/pvc/api-key.pem' }}"
autobackup: autobackup:
{% if pvc_autobackup is defined and pvc_autobackup %} {% if pvc_autobackup is defined and pvc_autobackup.enabled is defined and pvc_autobackup.enabled %}
backup_root_path: {{ pvc_autobackup.backup_root_path }} backup_root_path: {{ pvc_autobackup.root_path }}
backup_root_suffix: {{ pvc_autobackup.backup_root_suffix }} backup_root_suffix: {{ pvc_autobackup.root_suffix }}
backup_tags: backup_tags:
{% for tag in pvc_autobackup.backup_tags %} {% for tag in pvc_autobackup.tags %}
- {{ tag }} - {{ tag }}
{% endfor %} {% endfor %}
backup_schedule: backup_schedule: