forked from bitlair/ansible
Manage SSH keys with Ansible
This commit is contained in:
parent
eff6091c5a
commit
6fc9d8df96
19 changed files with 49 additions and 0 deletions
8
roles/common-bitlair/tasks/main.yaml
Normal file
8
roles/common-bitlair/tasks/main.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
- name: Update authorized_keys
|
||||
tags: authorized_keys
|
||||
template:
|
||||
src: authorized_keys.j2
|
||||
dest: /root/.ssh/authorized_keys
|
||||
mode: 0600
|
||||
when: root_access is defined and root_access
|
5
roles/common-bitlair/templates/authorized_keys.j2
Normal file
5
roles/common-bitlair/templates/authorized_keys.j2
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Managed by Ansible
|
||||
|
||||
{% for name in root_access %}
|
||||
{{ lookup('file', 'authorized_keys/'+name+'.keys') }}
|
||||
{% endfor %}
|
Loading…
Add table
Add a link
Reference in a new issue