Files
Ansible-Minecraft-Server/roles/05-update/tasks/01-check-ssh-keys.yml
hcornet 31711c7627
Some checks failed
Deploy Minecraft Server / deploy (push) Failing after 1m25s
Ansible Lint / lint (push) Failing after 12s
update
2025-08-26 14:28:09 +02:00

14 lines
378 B
YAML

---
- name: Check for new SSH keys in authorized_keys
stat:
path: /home/{{ ansible_user }}/.ssh/authorized_keys
register: ssh_keys_stat
- name: Update SSH keys if changed
authorized_key:
user: "{{ ansible_user }}"
key: "{{ item }}"
state: present
loop: "{{ ssh_public_keys | default([]) }}"
when: ssh_public_keys is defined
tags: ['ssh-keys-update']