2019-08-05 19:36:31 +00:00
|
|
|
---
|
|
|
|
- name: Install autofs
|
|
|
|
pacman:
|
|
|
|
name: borg
|
|
|
|
state: present
|
|
|
|
|
2019-08-05 19:47:10 +00:00
|
|
|
- name: mkdir for config files and scripts
|
|
|
|
file:
|
2019-08-05 19:51:24 +00:00
|
|
|
path: /etc/backups
|
2019-08-05 19:47:10 +00:00
|
|
|
state: directory
|
|
|
|
|
2019-08-05 19:36:31 +00:00
|
|
|
- name: copy udev rule in /etc/backups
|
|
|
|
copy:
|
|
|
|
src: files/dd_borg/40-backup.rules
|
|
|
|
dest: /etc/backups/40-backup.rules
|
|
|
|
backup: yes
|
|
|
|
|
|
|
|
- name: Link it to /etc/udev
|
|
|
|
file:
|
|
|
|
src: /etc/backups/40-backup.rules
|
|
|
|
dest: /etc/udev/rules.d/40-backup.rules
|
|
|
|
state: link
|
|
|
|
|
|
|
|
- name: copy service in /etc/backups
|
|
|
|
copy:
|
2019-08-05 20:09:12 +00:00
|
|
|
src: files/dd_borg/automatic-backup.service
|
2019-08-05 19:36:31 +00:00
|
|
|
dest: /etc/backups/automatic-backup.service
|
|
|
|
backup: yes
|
|
|
|
|
|
|
|
- name: Link it to /etc/udev
|
|
|
|
file:
|
|
|
|
src: /etc/backups/automatic-backup.service
|
2019-08-05 20:13:59 +00:00
|
|
|
dest: /etc/systemd/system/automatic-backup.service
|
2019-08-05 19:36:31 +00:00
|
|
|
state: link
|
|
|
|
|
2019-08-05 20:09:12 +00:00
|
|
|
- name: copy run script
|
2019-08-05 19:36:31 +00:00
|
|
|
template:
|
|
|
|
src: files/dd_borg/run.sh
|
|
|
|
dest: /etc/backups/run.sh
|
2019-08-05 20:18:53 +00:00
|
|
|
mode: u+rxw
|
2019-08-05 19:36:31 +00:00
|
|
|
|
|
|
|
- name: Reload systemctl
|
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
|
|
|
|
- name: Reload udev
|
|
|
|
shell: udevadm control --reload
|