From e7afe1e8d2de8dd51b588cb21aa79062ec965eeb Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Sat, 2 Apr 2022 08:14:33 +0200 Subject: [PATCH] Feat: add collectd to backup --- home.yml | 8 ++++++-- vars/backup.yml | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/home.yml b/home.yml index ebca3cc..aca39b6 100644 --- a/home.yml +++ b/home.yml @@ -7,10 +7,14 @@ tasks: - name: NFS shares client - include_role: + include_role: name: nfs_client - name: Set up borgmatic - include_role: + include_role: name: borgmatic + + - name: Set up collectd + include_role: + name: collectd diff --git a/vars/backup.yml b/vars/backup.yml index fd58dfd..d19ffc4 100644 --- a/vars/backup.yml +++ b/vars/backup.yml @@ -12,10 +12,24 @@ nfs_shares: server: nas.lan export: /mnt/DocNas/Commun options: defaults,_netdev,rsize=8192,wsize=8192 + - mount_point: /mnt/jails + server: nas.lan + export: /mnt/DocNas/iocage/jails + options: defaults,_netdev,rsize=8192,wsize=8192 +borgmatic_name: on_start borg_source_directories: "{{ nfs_shares | map(attribute='mount_point') }}" borg_repository: /backup/borgmatic +borgmatic_hooks: + on_error: + - echo "`date` - Error while creating a backup." + before_backup: + - echo "`date` - Starting backup." + after_backup: + - echo "`date` - Finished backup." + - poweroff - +collectd_network_server: 192.168.2.240 +collectd_network_port: 25826