proxmox ansible bootstrapping
This commit is contained in:
parent
2d1a363a50
commit
bdf3bc6b02
20 changed files with 481 additions and 4 deletions
20
roles/ci_user/tasks/main.yml
Normal file
20
roles/ci_user/tasks/main.yml
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue