diff --git a/tasks/auth.yml b/tasks/auth.yml index 0297f41..5370c2a 100644 --- a/tasks/auth.yml +++ b/tasks/auth.yml @@ -6,10 +6,9 @@ owner: root group: root -- name: Ensure authorized_keys keys - copy: - dest: /root/.ssh/authorized_keys - content: "{{ vars.ssh_keys | join('\n') }}" - owner: root - group: root - mode: '0600' \ No newline at end of file +- name: Add SSH authorized keys + ansible.posix.authorized_key: + user: root + key: "{{ item }}" + state: present + with_items: "{{ vars.ssh_keys }}"