Integrate restic backup system

This commit is contained in:
Jef Roosens 2024-01-10 13:51:51 +01:00
parent c38bda8dfd
commit a6e4beefb3
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
6 changed files with 84 additions and 2 deletions

View file

@ -25,3 +25,32 @@
group: 'root'
mode: '0755'
when: 'res.changed'
- name: Ensure backup scripts directory is present
ansible.builtin.file:
path: '/etc/backups'
state: directory
mode: '0755'
- name: Ensure Restic backups password file is present
ansible.builtin.copy:
src: 'restic_backups_passwd'
dest: '/etc/backups/restic_backups_passwd'
owner: root
group: root
mode: '0600'
- name: Ensure backup-all script is present
ansible.builtin.template:
src: "backup-all.sh.j2"
dest: '/etc/backups/backup-all.sh'
owner: root
group: root
mode: '0644'
- name: Ensure backup cronjob is enabled
ansible.builtin.cron:
name: 'Perform nightly backups'
minute: '0'
hour: '2'
job: 'bash /etc/backups/backup-all.sh'