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:
1 parent
c0155e3396
commit
b09d1af493
2 files changed
+9
-9
No files matched your search
+7
-7
@@ -26,21 +26,21 @@
|
|||||||
|
|
||||||
- name: setup ssh public keys of clients
|
- name: setup ssh public keys of clients
|
||||||
copy:
|
copy:
|
||||||
content: "{{ backup_clients[item].sshpubkey }}"
|
content: "{{ backup_server_clients[item].sshpubkey }}"
|
||||||
dest: "{{ backup_home }}/.ssh/{{ item }}.pub"
|
dest: "{{ backup_home }}/.ssh/{{ item }}.pub"
|
||||||
owner: "{{ backup_owner }}"
|
owner: "{{ backup_owner }}"
|
||||||
group: "{{ backup_group }}"
|
group: "{{ backup_group }}"
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
loop: "{{ backup_clients.keys() }}"
|
loop: "{{ backup_server_clients.keys() }}"
|
||||||
|
|
||||||
- name: setup ssh private keys of clients
|
- name: setup ssh private keys of clients
|
||||||
copy:
|
copy:
|
||||||
content: "{{ backup_clients[item].sshprivkey }}"
|
content: "{{ backup_server_clients[item].sshprivkey }}"
|
||||||
dest: "{{ backup_home }}/.ssh/{{ item }}"
|
dest: "{{ backup_home }}/.ssh/{{ item }}"
|
||||||
owner: "{{ backup_owner }}"
|
owner: "{{ backup_owner }}"
|
||||||
group: "{{ backup_group }}"
|
group: "{{ backup_group }}"
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
loop: "{{ backup_clients.keys() }}"
|
loop: "{{ backup_server_clients.keys() }}"
|
||||||
|
|
||||||
- name: setup ssh config of clients
|
- name: setup ssh config of clients
|
||||||
template:
|
template:
|
||||||
@@ -60,12 +60,12 @@
|
|||||||
|
|
||||||
- name: setup borg repository keys
|
- name: setup borg repository keys
|
||||||
copy:
|
copy:
|
||||||
content: "{{ backup_clients[item].borgkey }}"
|
content: "{{ backup_server_clients[item].borgkey }}"
|
||||||
dest: "{{ backup_key_folder }}/{{ backup_clients[item].app }}"
|
dest: "{{ backup_key_folder }}/{{ backup_server_clients[item].app }}"
|
||||||
owner: "{{ backup_owner }}"
|
owner: "{{ backup_owner }}"
|
||||||
group: "{{ backup_group }}"
|
group: "{{ backup_group }}"
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
loop: "{{ backup_clients.keys() }}"
|
loop: "{{ backup_server_clients.keys() }}"
|
||||||
|
|
||||||
- name: setup local backup storage folder
|
- name: setup local backup storage folder
|
||||||
file:
|
file:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% for client in backup_clients %}
|
{% for client in backup_server_clients %}
|
||||||
Host {{ client }}
|
Host {{ client }}
|
||||||
HostName {{ backup_host }}
|
HostName {{ backup_host }}
|
||||||
Port {{ backup_ssh_port }}
|
Port {{ backup_ssh_port }}
|
||||||
User {{ backup_clients[client].owner }}
|
User {{ backup_server_clients[client].owner }}
|
||||||
IdentityFile {{ backup_home }}/.ssh/{{ client }}
|
IdentityFile {{ backup_home }}/.ssh/{{ client }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
Reference in new issue
Block a user