Ansible_workstation/tasks/dd_backup.yml

48 lines
987 B
YAML
Raw Normal View History

---
- 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
- 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:
src: files/dd_borg/automatic-backup.service
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
state: link
- name: copy run script
template:
src: files/dd_borg/run.sh
dest: /etc/backups/run.sh
2019-08-05 20:18:53 +00:00
mode: u+rxw
- name: Reload systemctl
systemd:
daemon_reload: yes
- name: Reload udev
shell: udevadm control --reload