test other version
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
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
This commit is contained in:
17
roles/01-server_hardening/tasks/06-ssh-keys-management.yml
Normal file
17
roles/01-server_hardening/tasks/06-ssh-keys-management.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- 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
|
Reference in New Issue
Block a user