ansible-personal/roles/common/tasks/ssh-keys.yml

12 lines
432 B
YAML
Raw Normal View History

---
- name: Zero .ssh/authorized_keys for provisioning user
ansible.builtin.file: dest={{ provisioning_user.home }}/.ssh/authorized_keys state=absent
- name: Add public keys to authorized_keys
2023-08-23 20:33:22 +02:00
ansible.posix.authorized_key: { user: "{{ provisioning_user.name }}", key: "{{ lookup('file',item) }}" }
with_fileglob:
# use descriptive names for keys, like: aorth-mzito-rsa.pub
- ssh-pub-keys/*.pub
# vim: set sw=2 ts=2: