32 lines
805 B
YAML
32 lines
805 B
YAML
---
|
|
- name: Install Restic
|
|
ansible.builtin.apt:
|
|
name: restic
|
|
state: present
|
|
become: true
|
|
|
|
- name: Deploy restic backup script
|
|
ansible.builtin.template:
|
|
src: restic-backup.sh.j2
|
|
dest: /usr/local/bin/restic-backup.sh
|
|
mode: "0700" # Only root can read/execute this because it contains secrets
|
|
|
|
- name: Deploy restic systemd service
|
|
ansible.builtin.template:
|
|
src: restic-backup.service.j2
|
|
dest: /etc/systemd/system/restic-backup.service
|
|
mode: "0644"
|
|
|
|
- name: Deploy restic systemd timer
|
|
ansible.builtin.template:
|
|
src: restic-backup.timer.j2
|
|
dest: /etc/systemd/system/restic-backup.timer
|
|
mode: "0644"
|
|
|
|
- name: Enable and start backup timer
|
|
ansible.builtin.systemd:
|
|
name: restic-backup.timer
|
|
enabled: yes
|
|
state: started
|
|
daemon_reload: yes
|