feat: Introduce an Ansible common role for base system configuration, including packages, users, and Netplan networking, alongside Semaphore playbooks for system bootstrapping and Proxmox management.
This commit is contained in:
18
ansible/roles/common/tasks/users.yml
Normal file
18
ansible/roles/common/tasks/users.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Ensure users exist
|
||||
user:
|
||||
name: "{{ item.name }}"
|
||||
shell: /bin/bash
|
||||
groups: sudo
|
||||
append: yes
|
||||
state: present
|
||||
loop: "{{ common_ssh_users }}"
|
||||
when: item.create_user | default(false)
|
||||
|
||||
- name: Add SSH keys
|
||||
authorized_key:
|
||||
user: "{{ item.0.name }}"
|
||||
key: "{{ item.1 }}"
|
||||
loop: "{{ common_ssh_users | subelements('keys', skip_missing=True) }}"
|
||||
loop_control:
|
||||
label: "{{ item.0.name }}"
|
||||
Reference in New Issue
Block a user