ssh keys: append instead of overwrite

Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
Frank Villaro-Dixon 2024-10-22 15:34:08 +02:00
parent cc76a73dfd
commit aa0bea9b70

View file

@ -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'
- name: Add SSH authorized keys
ansible.posix.authorized_key:
user: root
key: "{{ item }}"
state: present
with_items: "{{ vars.ssh_keys }}"