From 72555d15c4456ca34d878c0c158a41aeb76b2ea9 Mon Sep 17 00:00:00 2001 From: phil Date: Sat, 8 Apr 2023 23:44:07 +0200 Subject: [PATCH] Fix copy of exported keys --- tasks/borg.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/borg.yml b/tasks/borg.yml index 3975489..7002806 100644 --- a/tasks/borg.yml +++ b/tasks/borg.yml @@ -28,10 +28,11 @@ - name: "Borg | Export repo key" ansible.builtin.command: - cmd: "borg key export {{ item }} > {{ borg_key_export_path }}/{{ item }}.key" + cmd: "borg key export {{ item }} {{ borg_key_export_path }}/{{ item | replace('ssh://', '') | replace('@', '') | replace('.', '_') | replace('/', '') }}" loop: "{{ borg_repository }}" - name: "Borg | Save repo key to localhost" - ansible.builtin.fetch: - src: "{{ repo_key_export.stdout }}" + ansible.posix.synchronize: + mode: pull + src: "{{ borg_key_export_path }}" dest: "~/"