Backup server: use backup_server_clients for keys and ssh config

Borg passphrase files are named by app; looping over all backup_clients let public-cloud-frontend overwrite the key of the live 'webserver' repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lhahnandClaude Opus 5.5 committed 2026-10-16 21:58:21 +02:00
1 parent c0155e3396
commit b09d1af493
2 files changed
+9 -9

No files matched your search

+7 -7
View File
@@ -26,21 +26,21 @@
- name: setup ssh public keys of clients
copy:
content: "{{ backup_clients[item].sshpubkey }}"
content: "{{ backup_server_clients[item].sshpubkey }}"
dest: "{{ backup_home }}/.ssh/{{ item }}.pub"
owner: "{{ backup_owner }}"
group: "{{ backup_group }}"
mode: "0600"
loop: "{{ backup_clients.keys() }}"
loop: "{{ backup_server_clients.keys() }}"
- name: setup ssh private keys of clients
copy:
content: "{{ backup_clients[item].sshprivkey }}"
content: "{{ backup_server_clients[item].sshprivkey }}"
dest: "{{ backup_home }}/.ssh/{{ item }}"
owner: "{{ backup_owner }}"
group: "{{ backup_group }}"
mode: "0600"
loop: "{{ backup_clients.keys() }}"
loop: "{{ backup_server_clients.keys() }}"
- name: setup ssh config of clients
template:
@@ -60,12 +60,12 @@
- name: setup borg repository keys
copy:
content: "{{ backup_clients[item].borgkey }}"
dest: "{{ backup_key_folder }}/{{ backup_clients[item].app }}"
content: "{{ backup_server_clients[item].borgkey }}"
dest: "{{ backup_key_folder }}/{{ backup_server_clients[item].app }}"
owner: "{{ backup_owner }}"
group: "{{ backup_group }}"
mode: "0600"
loop: "{{ backup_clients.keys() }}"
loop: "{{ backup_server_clients.keys() }}"
- name: setup local backup storage folder
file:
+2 -2
View File
@@ -1,7 +1,7 @@
{% for client in backup_clients %}
{% for client in backup_server_clients %}
Host {{ client }}
HostName {{ backup_host }}
Port {{ backup_ssh_port }}
User {{ backup_clients[client].owner }}
User {{ backup_server_clients[client].owner }}
IdentityFile {{ backup_home }}/.ssh/{{ client }}
{% endfor %}