From 1e81d179161be4509e200eda73a5b92c04c2de2a Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Wed, 29 Jul 2020 01:09:46 -0400 Subject: [PATCH] Update dockerbox playbook and manage SSH keys --- dockerbox.yml | 3 +++ roles/base/tasks/system.yml | 6 ++++++ roles/base/templates/authorized_keys.j2 | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 roles/base/templates/authorized_keys.j2 diff --git a/dockerbox.yml b/dockerbox.yml index 8034611..b8fae16 100644 --- a/dockerbox.yml +++ b/dockerbox.yml @@ -18,5 +18,8 @@ roles: - base - docker + - traefik + - nextcloud + - gitea - jenkins - prometheus diff --git a/roles/base/tasks/system.yml b/roles/base/tasks/system.yml index dee5cec..15ae03e 100644 --- a/roles/base/tasks/system.yml +++ b/roles/base/tasks/system.yml @@ -2,3 +2,9 @@ apt: name: ["vim", "wget"] state: present + +- name: Manage root authorized_keys + template: + src: authorized_keys.j2 + dest: /root/.ssh/authorized_keys + when: authorized_keys is defined diff --git a/roles/base/templates/authorized_keys.j2 b/roles/base/templates/authorized_keys.j2 new file mode 100644 index 0000000..b40ed15 --- /dev/null +++ b/roles/base/templates/authorized_keys.j2 @@ -0,0 +1,3 @@ +{% for key in authorized_keys %} +{{ key.key }} {{ key.name }} +{% endfor %}