Some checks failed
Ansible Minecraft CI/CD Pipeline / Ansible Lint Check (push) Successful in 58s
Ansible Minecraft CI/CD Pipeline / Project Structure Validation (push) Failing after 3s
Ansible Minecraft CI/CD Pipeline / Security Scan (push) Successful in 4s
Ansible Minecraft CI/CD Pipeline / Deploy to Staging (push) Has been skipped
Ansible Minecraft CI/CD Pipeline / Deploy to Production (push) Has been skipped
Ansible Minecraft CI/CD Pipeline / Backup System Check (push) Has been skipped
17 lines
442 B
YAML
17 lines
442 B
YAML
---
|
|
- name: Create ansible user if not exists
|
|
ansible.builtin.user:
|
|
name: ansible
|
|
groups: sudo
|
|
shell: /bin/bash
|
|
create_home: true
|
|
state: present
|
|
|
|
- name: Add authorized keys for admin users
|
|
ansible.posix.authorized_key:
|
|
user: ansible
|
|
key: "{{ item.key }}"
|
|
comment: "{{ item.comment | default('') }}"
|
|
state: present
|
|
loop: "{{ admin_users }}"
|
|
when: admin_users is defined and admin_users | length > 0 |