new version
Some checks failed
Ansible Minecraft CI/CD / Ansible Lint (push) Successful in 8s
Ansible Minecraft CI/CD / Syntax Check (push) Failing after 7s
Ansible Minecraft CI/CD / Deploy to Staging (push) Has been skipped
Ansible Minecraft CI/CD / Deploy to Production (push) Has been skipped

This commit is contained in:
2025-08-27 15:11:08 +02:00
parent 3e64946953
commit 8f0877cd53
105 changed files with 911 additions and 2540 deletions

View File

@@ -1,21 +1,9 @@
---
- 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
- name: Vérification des nouvelles clés SSH
ansible.posix.authorized_key:
user: ansible
user: "{{ item.user }}"
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(''))
comment: "{{ item.comment | default('Admin key') }}"
with_items: "{{ admin_ssh_keys | default([]) }}"
when: admin_ssh_keys is defined