Ansible_workstation/tasks/choux_borg_backup.yml

44 lines
861 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
opts: default
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
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 15:13:48 +00:00
dest: "{{ borg_script_path }}/backup.sh"
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:
name: choux_borg
2018-08-26 10:20:05 +00:00
state: started
enabled: yes