Add ability to deploy Github keys

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-01-07 18:20:42 +01:00
parent fa2a1ca7b6
commit 7697d5387a
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -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 }}'