diff --git a/group_vars/default/pvc.yml b/group_vars/default/pvc.yml index f48c50a..4f53d16 100644 --- a/group_vars/default/pvc.yml +++ b/group_vars/default/pvc.yml @@ -248,6 +248,23 @@ pvc_autobackup: # > Thus, this schedule combined with a full_interval of 7 ensures there is always 2 full weekly backups, # plus at least 1 full week's worth of incremental backups. full_retention: 2 + # Set reporting options for autobackups + # NOTE: By default, pvc-ansible installs a local Postfix MTA and Postfix sendmail to send emails + # This may not be what you want! If you want an alternate sendmail MTA (e.g. msmtp) you must install it + # yourself in a custom role! + reporting: + # Enable or disable email reporting; if disabled ("no"), no reports are ever sent + enabled: no + # Email a report to these addresses; at least one MUST be specified if enabled + emails: + - myuser@domain.tld + - otheruser@domain.tld + # Email a report on the specified jobs + report_on: + # Send a report on a forced_full backup (usually, weekly) + forced_full: yes + # Send a report on a normal backup (usually, daily) + normal: yes # Configure automatic mounting support # > PVC autobackup features the ability to automatically and dynamically mount and unmount remote # filesystems, or, indeed, perform any arbitrary pre- or post-run tasks, using a set of arbitrary diff --git a/roles/pvc/defaults/main.yml b/roles/pvc/defaults/main.yml index dcbfb6c..593a480 100644 --- a/roles/pvc/defaults/main.yml +++ b/roles/pvc/defaults/main.yml @@ -74,6 +74,11 @@ pvc_autobackup: forced_full_time: "Mon *-*-* 0:0:00" full_interval: 7 full_retention: 2 + reporting: + enabled: no + report_on: + forced_full: no + normal: no auto_mount: enabled: no packages: diff --git a/roles/pvc/templates/autobackup/pvc-autobackup-full.service.j2 b/roles/pvc/templates/autobackup/pvc-autobackup-full.service.j2 index ed4f994..6b6eba5 100644 --- a/roles/pvc/templates/autobackup/pvc-autobackup-full.service.j2 +++ b/roles/pvc/templates/autobackup/pvc-autobackup-full.service.j2 @@ -5,4 +5,4 @@ Description=[Cron] PVC VM autobackup (forced-full) Type=oneshot IgnoreSIGPIPE=false KillMode=process -ExecStart=/usr/bin/pvc --quiet vm autobackup --cron --force-full +ExecStart=/usr/bin/pvc --quiet vm autobackup --cron --force-full {% if pvc_autobackup.reporting.enabled and pvc_autobackup.reporting.report_on.forced_full %}--email-report {{ pvc_autobackup.reporting.emails|join(',') }}{% endif %} diff --git a/roles/pvc/templates/autobackup/pvc-autobackup-normal.service.j2 b/roles/pvc/templates/autobackup/pvc-autobackup-normal.service.j2 index 0f80a88..129a7fe 100644 --- a/roles/pvc/templates/autobackup/pvc-autobackup-normal.service.j2 +++ b/roles/pvc/templates/autobackup/pvc-autobackup-normal.service.j2 @@ -5,4 +5,4 @@ Description=[Cron] PVC VM autobackup (normal) Type=oneshot IgnoreSIGPIPE=false KillMode=process -ExecStart=/usr/bin/pvc --quiet vm autobackup --cron +ExecStart=/usr/bin/pvc --quiet vm autobackup --cron {% if pvc_autobackup.reporting.enabled and pvc_autobackup.reporting.report_on.normal %}--email-report {{ pvc_autobackup.reporting.emails|join(',') }}{% endif %}