check new version
Some checks failed
Ansible Minecraft Server CI/CD / lint (push) Failing after 21s
Ansible Minecraft Server CI/CD / test (push) Has been skipped
Ansible Minecraft Server CI/CD / deploy (push) Has been skipped

This commit is contained in:
2025-08-27 07:59:19 +02:00
parent 7a2ccb537b
commit 9ea9ac7254
125 changed files with 2696 additions and 1511 deletions

View File

@@ -0,0 +1,21 @@
---
- name: Check for new SSH keys in repository
ansible.builtin.set_fact:
ssh_keys_to_add: "{{ admin_ssh_keys | default([]) }}"
- name: Get current authorized keys
ansible.builtin.slurp:
src: /home/ansible/.ssh/authorized_keys
register: current_keys
ignore_errors: yes
- name: Add new SSH keys if found
ansible.posix.authorized_key:
user: ansible
state: present
key: "{{ item.key }}"
comment: "{{ item.name }}"
loop: "{{ ssh_keys_to_add }}"
when:
- ssh_keys_to_add | length > 0
- item.key not in (current_keys.content | b64decode | default(''))