[borg] Use borgmatic

certbot_on_virtu
_pollion 2020-12-02 16:01:07 +01:00
parent b3e4383a01
commit bb08b4312a
3 changed files with 17 additions and 16 deletions

View File

@ -9,7 +9,7 @@
retries: 3
until: apt_result is succeeded
- name: Install borgbackup
- name: Install borgmatic with apt
apt:
update_cache: true
name:
@ -19,10 +19,20 @@
retries: 3
until: apt_result is succeeded
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:
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"