Ansible_workstation/tasks/choux_borg_backup.yml

44 lines
879 B
YAML

---
- name: Mount backup disk
mount:
path: "{{ backup_mount_point }}"
src: "UUID={{ backup_disk_uuid }}"
fstype: ext4
opts: defaults
state: mounted
- 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
template:
src: files/choux_borg.sh
dest: "{{ borg_script_path }}/{{ borg_script_filename }}"
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
service:
name: choux_borg
state: started
enabled: yes