added "borgbackup" role

This commit is contained in:
2023-03-30 13:50:14 +02:00
parent f81fa5a4af
commit b319a4928a
5 changed files with 133 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
---
- name: Install required system packages
ansible.builtin.package:
state: present
name: "{{ borgbackup_deps }}"
- name: Copy smb credentials file
ansible.builtin.template:
src: "../templates/.cifs.j2"
dest: /home/{{ user['name'] }}/.cifs
owner: simon
group: simon
mode: '0600'
- name: Copy "backup_to_smb.sh" Skript
ansible.builtin.template:
src: "../templates/backup_to_smb.sh"
dest: /usr/local/bin/
owner: simon
group: simon
mode: '0700'
- name: add cron backupjob for backups to samba server
become: true
ansible.builtin.cron:
user: simon
name: "borgbackup the docker dir to smb"
minute: "30"
hour: "3"
job: "sudo /usr/local/bin/backup_to_smb.sh > /dev/null 2>&1"
notify: restart cron