Integrate restic backup system
This commit is contained in:
parent
c38bda8dfd
commit
a6e4beefb3
6 changed files with 84 additions and 2 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue