This repository has been archived on 2023-12-26. You can view files and clone it, but cannot push or open issues or pull requests.
hypervisors/ansible/roles/borg/tasks/main.yml

48 lines
1 KiB
YAML

- name: Create snapshots directory
file:
path: /kvm/snapshots
state: directory
- name: Create backup mountpoint
file:
path: /mnt/thecloud
state: directory
- 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
copy:
src: "{{ role_path }}/backup.timer"
dest: /etc/systemd/system/backup.timer
notify: systemd daemon reload
- name: Copy systemd backup failure service
template:
src: "{{ role_path }}/backup-failure.service.j2"
dest: /etc/systemd/system/backup-failure.service
notify: systemd daemon reload
- name: Enable backup timer
systemd:
name: backup.timer
enabled: true
state: started