add dataserver's known host to homeserver

This commit is contained in:
Pim Kunis 2023-01-12 17:13:39 +01:00
parent 30a87cef3c
commit 70c3ae31de
6 changed files with 47 additions and 5 deletions

View file

@ -1,3 +1,13 @@
- name: Copy host public key
template:
src: "{{ role_path }}/templates/ssh_host_ed25519_key.pub.j2"
dest: "/etc/ssh/ssh_host_ed25519_key.pub"
mode: 0644
- name: Copy host private key
copy:
src: "{{ role_path }}/files/ssh_host_ed25519_key"
dest: "/etc/ssh/ssh_host_ed25519_key"
mode: 0600
- name: APT upgrade
apt:
autoremove: true
@ -10,9 +20,9 @@
name: borgbackup
- name: Add Borg public key
authorized_key:
key: "{{ borg_public_key }}"
key: "ssh-ed25519 {{ borg_public_key }} root@max"
user: "{{ ansible_user_id }}"
- name: Create Borg repository
command:
cmd: "borg init -e none {{ backup_location }}"
creates: "{{ backup_location }}"
creates: "{{ backup_location }}"