Fix template extension, add borg backup install
This commit is contained in:
31
playbooks/install_borgbackup.yml
Normal file
31
playbooks/install_borgbackup.yml
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
- hosts: all
|
||||
become: yes
|
||||
vars:
|
||||
borg.repo.path: /var/backup/backup.borg/
|
||||
borg.repo.encryption: none
|
||||
tasks:
|
||||
- name: "Install borg backup"
|
||||
apt:
|
||||
name: borgbackup
|
||||
state: latest
|
||||
|
||||
- name: "Create backup repository"
|
||||
ansible.builtin.command: borg init -e {{borg.repo.encryption}} {{borg.repo.path}}
|
||||
args:
|
||||
creates: {{borg.repo.path}}
|
||||
|
||||
- name: "Configure backup script"
|
||||
ansible.builtin.copy:
|
||||
src: ../templates/borgbackup.j2
|
||||
dest: /opt/borgbackup.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: '744'
|
||||
|
||||
- name: "Configure cronjob"
|
||||
ansible.builtin.cron:
|
||||
name: "Borg backup"
|
||||
minute: "0"
|
||||
hour: "1"
|
||||
job: "/opt/borgbackup.sh"
|
Reference in New Issue
Block a user