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 owner: root
group: root group: root
- name: Ensure authorized_keys keys - name: Add SSH authorized keys
copy: ansible.posix.authorized_key:
dest: /root/.ssh/authorized_keys user: root
content: "{{ vars.ssh_keys | join('\n') }}" key: "{{ item }}"
owner: root state: present
group: root with_items: "{{ vars.ssh_keys }}"
mode: '0600'