Ansible_workstation/tasks/choux_borg_backup.yml

46 lines
916 B
YAML
Raw Normal View History

2018-08-25 06:47:57 +00:00
---
2018-11-10 15:24:18 +00:00
- name: Mount backup disk
2018-11-10 15:25:09 +00:00
mount:
2018-11-10 15:25:45 +00:00
path: "{{ backup_mount_point }}"
2018-11-10 15:24:18 +00:00
src: "UUID={{ backup_disk_uuid }}"
fstype: ext4
2018-11-10 16:27:08 +00:00
opts: defaults
2018-11-10 15:33:05 +00:00
state: mounted
2018-11-10 15:24:18 +00:00
2018-08-25 06:47:57 +00:00
- name: Install borgbackup
pacman:
name:
- borg
- python-llfuse
2018-08-25 06:47:57 +00:00
state: present
- name: Create script directory
file:
path: "{{ borg_script_path }}"
state: directory
mode: 755
- name: Automate toward local RAID backup with systemd timer
2018-08-25 06:47:57 +00:00
template:
src: files/choux_borg.sh
2018-11-10 16:23:32 +00:00
dest: "{{ borg_script_path }}/{{ borg_script_filename }}"
2018-08-25 06:47:57 +00:00
mode: 755
- name: Backup systemd timer
template:
src: files/choux_borg.timer
dest: /etc/systemd/system/
mode: 755
- name: Backup systemd service
template:
src: files/choux_borg.service
dest: /etc/systemd/system/
mode: 755
- name: Enable systemd borg script
2018-08-26 10:20:05 +00:00
service:
2020-07-17 09:39:35 +00:00
name: choux_borg.timer
2018-08-26 10:20:05 +00:00
state: started
enabled: yes