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