summaryrefslogtreecommitdiff
path: root/playbook.yaml
diff options
context:
space:
mode:
authorMatthew Fennell <matthew@fennell.dev>2024-01-08 22:53:42 +0000
committerMatthew Fennell <matthew@fennell.dev>2024-01-08 22:53:42 +0000
commitf324bbdef4a71d33d4dd0adbd9037f600a058ad5 (patch)
treec85e20e304721313a8200ef1274e886b12f84479 /playbook.yaml
parentd7e71e34d6eb308b20b6e7fee9eb6e6a74224897 (diff)
Install borgmatic in the playbook
This commit adds borgmatic, to provide automated backups.
Diffstat (limited to 'playbook.yaml')
-rw-r--r--playbook.yaml22
1 files changed, 22 insertions, 0 deletions
diff --git a/playbook.yaml b/playbook.yaml
index 1a2a1e9..6c61e68 100644
--- a/playbook.yaml
+++ b/playbook.yaml
@@ -10,6 +10,7 @@
- name: Ensure required packages are installed
ansible.builtin.package:
name:
+ - borgmatic
- certbot
- prosody
- prosody-modules
@@ -74,6 +75,23 @@
name: prosody
enabled: true
become: true
+ - name: Ensure borgmatic private key is installed
+ ansible.builtin.copy:
+ src: "{{ borg_private_key_path }}"
+ dest: /root/.ssh/borg_key
+ owner: root
+ group: root
+ mode: "0600"
+ become: true
+ - name: Ensure borgmatic is configured
+ ansible.builtin.template:
+ src: "{{ playbook_dir }}/files/borgmatic_config.yaml.j2"
+ dest: "/etc/borgmatic/config.yaml"
+ owner: root
+ group: root
+ mode: "0600"
+ become: true
+ notify: Validate borgmatic config
handlers:
- name: Reload prosody
@@ -81,3 +99,7 @@
name: prosody
state: reloaded
become: true
+ - name: Validate borgmatic config
+ ansible.builtin.command: validate-borgmatic-config
+ become: true
+ changed_when: false