- name: Create snapshots directory
file:
path: /kvm/snapshots
state: directory
- name: Create backup mountpoint
path: /mnt/thecloud
- name: Install Borg
apt:
pkg:
- borgbackup
- borgmatic
- name: Install apprise
pip:
name: apprise
- name: Copy Borgmatic script
template:
src: "{{ role_path }}/backup.yml.j2"
dest: /root/backup.yml
- name: Copy systemd backup unit
copy:
src: "{{ role_path }}/backup.service"
dest: /etc/systemd/system/backup.service
notify: systemd daemon reload
- name: Copy systemd backup timer
src: "{{ role_path }}/backup.timer"
dest: /etc/systemd/system/backup.timer
- name: Enable backup timer
systemd:
name: backup.timer
enabled: true
state: started