mirror of
https://github.com/luzifer-ansible/users.git
synced 2024-12-22 18:01:18 +00:00
Add ability to deploy Github keys
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
fa2a1ca7b6
commit
7697d5387a
1 changed files with 11 additions and 1 deletions
|
@ -23,8 +23,18 @@
|
||||||
copy:
|
copy:
|
||||||
content: '{{ item.ssh_key }}'
|
content: '{{ item.ssh_key }}'
|
||||||
dest: '/home/{{ item.name }}/.ssh/authorized_keys'
|
dest: '/home/{{ item.name }}/.ssh/authorized_keys'
|
||||||
mode: 0755
|
mode: 0600
|
||||||
owner: '{{ item.name }}'
|
owner: '{{ item.name }}'
|
||||||
group: '{{ item.name }}'
|
group: '{{ item.name }}'
|
||||||
when: item.ssh_key is defined
|
when: item.ssh_key is defined
|
||||||
with_items: '{{ users }}'
|
with_items: '{{ users }}'
|
||||||
|
|
||||||
|
- name: Install Github SSH keys for user
|
||||||
|
get_url:
|
||||||
|
url: 'https://github.com/{{ item.github_key_user }}.keys'
|
||||||
|
dest: '/home/{{ item.name }}/.ssh/authorized_keys'
|
||||||
|
mode: 0600
|
||||||
|
owner: '{{ item.name }}'
|
||||||
|
group: '{{ item.name }}'
|
||||||
|
when: item.github_key_user is defined and item.ssh_key is not defined
|
||||||
|
with_items: '{{ users }}'
|
||||||
|
|
Loading…
Reference in a new issue