feat: Add authorized ssh keys to host

This commit is contained in:
Marty Oehme 2025-11-19 14:35:30 +01:00
parent 8019fa9276
commit b493485b90
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,4 @@
---
system_authorized_keys:
- "{{ lookup('file', '~/.ssh/keys/bob.pub') }}"

View file

@ -36,3 +36,12 @@
- packages
become: true
- name: Add authorized SSH keys
ansible.posix.authorized_key:
user: marty # FIXME: don't hardoce user
state: present
key: "{{ item }}"
loop: "{{ system_authorized_keys }}"
tags:
- ssh
become: true