diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index 6d19bab..21489c5 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -1,3 +1,7 @@ borg_public_key: "AAAAC3NzaC1lZDI1NTE5AAAAIBTag7YToG5W+H2kEUz40kOH+7cs0Lp3owFFKkmHBiWM" dataserver_public_key: "AAAAC3NzaC1lZDI1NTE5AAAAIJsLVptkoOwmxs6DnenN8u7Q1Tm/Psh0QdI6vjrTgb6D" backup_location: "/root/homeserver_backup" + +admin_public_keys: + - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINUZp4BCxf7uLa1QWonx/Crf8tYZ5MKIZ+EuaBa82LrV user@user-laptop" + - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOodpLr+FDRyKyHjucHizNLVFHZ5AQmE9GmxMnOsSoaw pimkunis@thinkpadpim" diff --git a/roles/dataserver/tasks/main.yml b/roles/dataserver/tasks/main.yml index 27d17cc..cfbfb5c 100644 --- a/roles/dataserver/tasks/main.yml +++ b/roles/dataserver/tasks/main.yml @@ -1,3 +1,8 @@ +- name: Add admins' authorized keys + authorized_key: + key: "{{ item }}" + user: "{{ ansible_user_id }}" + loop: "{{ admin_public_keys }}" - name: Copy host public key template: src: "{{ role_path }}/templates/ssh_host_ed25519_key.pub.j2"