feat: Add authorized ssh keys to host
This commit is contained in:
parent
8019fa9276
commit
b493485b90
2 changed files with 13 additions and 0 deletions
4
roles/system/defaults/main.yaml
Normal file
4
roles/system/defaults/main.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
|
||||
system_authorized_keys:
|
||||
- "{{ lookup('file', '~/.ssh/keys/bob.pub') }}"
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue