50 lines
982 B
YAML
50 lines
982 B
YAML
---
|
|
- name: Pin borgmatic
|
|
template:
|
|
src: "apt/{{ item }}.j2"
|
|
dest: "/etc/apt/{{ item }}"
|
|
loop:
|
|
- sources.list.d/bullseye.list
|
|
- preferences.d/borgmatic-bullseye
|
|
when: ansible_lsb.release | int <= 10
|
|
|
|
- name: Install borgbackup
|
|
apt:
|
|
update_cache: true
|
|
name:
|
|
- borgbackup
|
|
- borgmatic
|
|
state: present
|
|
register: apt_result
|
|
retries: 3
|
|
until: apt_result is succeeded
|
|
|
|
- name: Ensures /etc/borgmatic exists
|
|
file:
|
|
path: /etc/borgmatic
|
|
state: directory
|
|
mode: 0700
|
|
owner: root
|
|
|
|
- name: Deploy ssh private key
|
|
template:
|
|
src: "borgmatic/id_ed25519_borg.j2"
|
|
dest: "/etc/borgmatic/id_ed25519_borg"
|
|
mode: 0600
|
|
owner: root
|
|
|
|
- name: Deploy borgmatic config
|
|
template:
|
|
src: "borgmatic/config.yaml.j2"
|
|
dest: "/etc/borgmatic/config.yaml"
|
|
mode: 0600
|
|
owner: root
|
|
group: root
|
|
|
|
- name: Deploy borg cron
|
|
template:
|
|
src: "cron.d/borg.j2"
|
|
dest: "/etc/cron.d/borg"
|
|
notify: restart cron
|
|
|