diff --git a/tasks/main.yml b/tasks/main.yml index 8c8ecd6..9c604b3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,11 +5,10 @@ attr: '-i' - name: Write ssh keys - copy: - content: "item" + template: + src: "authorized_keys.j2" dest: "/root/.ssh/authorized_keys" mode: 0600 - with_items: "{{ ssh_protect_root_public_keys }}" - name: Setup i attr in authorized_keys file file: diff --git a/templates/authorized_keys.j2 b/templates/authorized_keys.j2 new file mode 100644 index 0000000..6957ab1 --- /dev/null +++ b/templates/authorized_keys.j2 @@ -0,0 +1,3 @@ +{% for key in ssh_protect_root_public_keys %} +{{key}} +{% endfor %}