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

43 lines
831 B
YAML
Raw Normal View History

2023-06-17 10:54:41 +00:00
- name: Create snapshots directory
file:
path: /kvm/snapshots
state: directory
- name: Create backup mountpoint
file:
path: /mnt/thecloud
state: directory
2023-04-26 15:45:19 +00:00
- name: Install Borg
apt:
pkg:
- borgbackup
- borgmatic
2023-05-10 16:54:43 +00:00
- name: Install apprise
pip:
name: apprise
2023-04-26 15:45:19 +00:00
- name: Copy Borgmatic script
2023-06-17 11:14:30 +00:00
template:
src: "{{ role_path }}/backup.yml.j2"
2023-06-17 10:54:41 +00:00
dest: /root/backup.yml
2023-04-26 15:45:19 +00:00
- name: Copy systemd backup unit
copy:
2023-06-17 10:54:41 +00:00
src: "{{ role_path }}/backup.service"
2023-04-26 15:45:19 +00:00
dest: /etc/systemd/system/backup.service
notify: systemd daemon reload
- name: Copy systemd backup timer
copy:
2023-06-17 10:54:41 +00:00
src: "{{ role_path }}/backup.timer"
2023-04-26 15:45:19 +00:00
dest: /etc/systemd/system/backup.timer
notify: systemd daemon reload
- name: Enable backup timer
systemd:
name: backup.timer
enabled: true
state: started