From a22ff185f9836023817f9d4f8df3157b948f8cf2 Mon Sep 17 00:00:00 2001 From: Colin Wilk Date: Sat, 27 Jun 2026 15:22:45 +0200 Subject: borg!: support multiple backups to same target This brings support for multiple backups pointing to the same borg server, different repositories, from the same client. We support this by parsing the SSH authorized key file first and appending allowed repositories to allow independent definitions of the borg targets. So that the decryption_keys do not clash we include the repository name as well as the host in the key. This will lead to new keys being created for existing hosts in the new format. Old Format: {{ combine({inventory_hostname: borg_keys.stdout}) }} New Format: {{ combine({(inventory_hostname ~ '_' ~ borg_repo_name): borg_keys.stdout}) }} If upgrading from an older version that used just the hostname as the key, your existing `decryption_keys.yml` can be manually removed once the new format is also added. --- tasks/server_setup.yml | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'tasks/server_setup.yml') diff --git a/tasks/server_setup.yml b/tasks/server_setup.yml index 603dd3d..e47d012 100644 --- a/tasks/server_setup.yml +++ b/tasks/server_setup.yml @@ -8,15 +8,3 @@ generate_ssh_key: true become: true delegate_to: "{{ borg_server_host }}" - -- name: Make sure authorized keys exists - ansible.builtin.file: - path: "{{ borg_server_user_home }}/.ssh/authorized_keys" - state: touch - owner: borg - group: borg - mode: "644" - access_time: preserve - modification_time: preserve - become: true - delegate_to: "{{ borg_server_host }}" -- cgit v1.2.3