summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-01-12 19:45:46 +0100
committerChristian Pointner <equinox@spreadspace.org>2019-01-12 19:45:46 +0100
commit4e8134a929098ff1817ea4677d8e2fdcde9e7102 (patch)
tree6b662a4ab174a86b4ddcf6b9a9447d9267de0304
parentfixed dyndns/client role (diff)
admin-user: role also add ssh keys
-rw-r--r--inventory/group_vars/all/main.yml1
-rw-r--r--roles/admin-user/tasks/main.yml7
2 files changed, 8 insertions, 0 deletions
diff --git a/inventory/group_vars/all/main.yml b/inventory/group_vars/all/main.yml
index 87ecb369..82d81d6e 100644
--- a/inventory/group_vars/all/main.yml
+++ b/inventory/group_vars/all/main.yml
@@ -12,6 +12,7 @@ equinox_user:
name: equinox
# password: "{{ vault_equinox_password }}"
shell: /bin/zsh
+ ssh_keys: "{{ ssh_keys.equinox[env_group] }}"
ssh_keys:
diff --git a/roles/admin-user/tasks/main.yml b/roles/admin-user/tasks/main.yml
index e6fc3572..887da0ab 100644
--- a/roles/admin-user/tasks/main.yml
+++ b/roles/admin-user/tasks/main.yml
@@ -15,3 +15,10 @@
- adm
append: yes
shell: "{{ item.shell | default(omit) }}"
+
+- name: install ssh keys for admin users
+ with_items: "{{ admin_user_group | default([]) | union(admin_user_host | default([])) }}"
+ authorized_key:
+ user: "{{ item.name }}"
+ key: "{{ item.ssh_keys | join('\n') }}"
+ exclusive: yes