Create borgmatic configuration directory is not exists

This commit is contained in:
phil 2023-04-09 12:21:35 +02:00
parent 1aeb58245e
commit 7e0278debb

View file

@ -1,4 +1,12 @@
---
- name: Ensure /etc/borgmatic exists
ansible.builtin.file:
path: /etc/borgmatic
state: directory
mode: "0700"
owner: "{{ borg_user }}"
group: "{{ borg_group }}"
- name: "Borg | Copy borgmatic configuration"
ansible.builtin.template:
src: config.yaml.j2
@ -40,7 +48,7 @@
- name: "Borg | Export repo key"
ansible.builtin.command:
cmd: "borg key export ssh://{{ borgbase_repo.repo_id }}@{{ borgbackup_ssh_host }}/./repo borgbase_{{ inventory_hostname }}"
cmd: "borg key export ssh://{{ borgbase_repo.repo_id }}@{{ borgbackup_ssh_host }}/./repo borgbase"
chdir: "{{ borg_key_export_path }}"
when: borgbase is defined and borgbase