proxmox ansible bootstrapping

This commit is contained in:
plasmagoat 2025-06-07 19:41:15 +02:00
parent 2d1a363a50
commit bdf3bc6b02
20 changed files with 481 additions and 4 deletions

View file

@ -0,0 +1,20 @@
- name: Create CI user
ansible.builtin.user:
name: "{{ ci_user.name }}"
groups: "{{ ci_user.groups }}"
shell: "{{ ci_user.shell }}"
state: present
create_home: yes
when: ci_user.name is defined and ci_user.name | length > 0
- name: Add SSH keys for CI user
ansible.posix.authorized_key:
user: "{{ ci_user.name }}"
state: present
key: "{{ item }}"
loop: "{{ ci_user.ssh_keys }}"
when:
- ci_user.name is defined
- ci_user.name | length > 0
- ci_user.ssh_keys is defined
- ci_user.ssh_keys | length > 0