summaryrefslogtreecommitdiff
path: root/playbook.yaml
diff options
context:
space:
mode:
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