diff --git a/tasks/server.yml b/tasks/server.yml index eb13a7d..4fca317 100644 --- a/tasks/server.yml +++ b/tasks/server.yml @@ -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: diff --git a/templates/home/backup/.ssh/config.j2 b/templates/home/backup/.ssh/config.j2 index 3bceb68..857659f 100644 --- a/templates/home/backup/.ssh/config.j2 +++ b/templates/home/backup/.ssh/config.j2 @@ -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 %} \ No newline at end of file