Fetch exported keys

This commit is contained in:
phil 2023-04-08 23:20:21 +02:00
parent 3dd71eac1d
commit 4e6628e86c
2 changed files with 10 additions and 10 deletions

View file

@ -20,18 +20,18 @@
responses:
^.*want to continue connecting.*$: "yes"
- name: "Borg | Create backup"
ansible.builtin.command:
cmd: "borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }}"
- name: "Borg | Create key export directory"
ansible.builtin.file:
path: "{{ borg_key_export_path }}"
state: directory
mode: "0750"
- name: "Borg | Export repo key"
ansible.builtin.command:
cmd: "borg key export {{ item }}"
cmd: "borg key export {{ item }} > {{ borg_key_export_path }}/{{ item }}.key"
loop: "{{ borg_repository }}"
register: repo_key_export
- name: "Borg | Save repo key to localhost"
ansible.builtin.copy:
content: "{{ repo_key_export.stdout }}"
dest: "{{ borg_key_export_path }}"
delegate_to: localhost
ansible.builtin.fetch:
src: "{{ repo_key_export.stdout }}"
dest: "~/"