This commit is contained in:
Tiara Rodney 2026-03-14 05:38:45 +01:00
commit 883f31932e
No known key found for this signature in database
GPG key ID: 5CD8EC1D46106723
169 changed files with 5676 additions and 0 deletions

View file

@ -0,0 +1,35 @@
---
-
name: Create admin user
user:
name: "{{ admin_user }}"
shell: "{{ admin_shell }}"
groups: sudo
append: yes
create_home: yes
-
name: Allow admin user passwordless sudo
copy:
dest: "/etc/sudoers.d/{{ admin_user }}"
content: "{{ admin_user }} ALL=(ALL) NOPASSWD:ALL\n"
mode: "0440"
validate: "visudo -cf %s"
-
name: Find SSH public keys
find:
paths: "{{ ssh_pubkey_dir }}"
patterns: "*.pub"
delegate_to: localhost
become: no
register: ssh_pubkeys
-
name: Deploy SSH authorized keys
authorized_key:
user: "{{ admin_user }}"
key: "{{ lookup('file', item.path) }}"
loop: "{{ ssh_pubkeys.files }}"
loop_control:
label: "{{ item.path | basename }}"