[borg] Use borgmatic
parent
b3e4383a01
commit
bb08b4312a
|
@ -9,7 +9,7 @@
|
|||
retries: 3
|
||||
until: apt_result is succeeded
|
||||
|
||||
- name: Install borgbackup
|
||||
- name: Install borgmatic with apt
|
||||
apt:
|
||||
update_cache: true
|
||||
name:
|
||||
|
@ -20,9 +20,19 @@
|
|||
until: apt_result is succeeded
|
||||
when: ansible_lsb.release >= 10
|
||||
|
||||
- name: Ensures /etc/borgbackup exists
|
||||
- name: Install borgmatic with pip
|
||||
pip:
|
||||
executable: pip3
|
||||
name:
|
||||
- borgmatic
|
||||
register: pip_result
|
||||
retries: 3
|
||||
until: pip_result is succeeded
|
||||
when: ansible_lsb.release <= 9
|
||||
|
||||
- name: Ensures /etc/borgmatic exists
|
||||
file:
|
||||
path: /etc/borgbackup
|
||||
path: /etc/borgmatic
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: root
|
||||
|
@ -34,22 +44,13 @@
|
|||
mode: 0600
|
||||
owner: root
|
||||
|
||||
- name: Deploy borgbackup script
|
||||
template:
|
||||
src: "borgbackup/backup.sh.j2"
|
||||
dest: "/etc/borgbackup/backup.sh"
|
||||
mode: 0700
|
||||
owner: root
|
||||
when: ansible_lsb.release <= 9
|
||||
|
||||
- name: Deploy borgmatic config
|
||||
template:
|
||||
src: "borgbackup/config.yaml.j2"
|
||||
dest: "/etc/borgbackup/config.yaml"
|
||||
when: ansible_lsb.release >= 10
|
||||
src: "borgmatic/config.yaml.j2"
|
||||
dest: "/etc/borgmatic/config.yaml"
|
||||
|
||||
- name: Deploy borg cron
|
||||
template:
|
||||
src: "cron.d/borgbackup.j2"
|
||||
dest: "/etc/cron.d/borgbackup"
|
||||
src: "cron.d/borg.j2"
|
||||
dest: "/etc/cron.d/borg"
|
||||
|
||||
|
|
Loading…
Reference in New Issue