homeserver/roles/l3d.gitea/tasks/create_user.yml
mg 7e6284bc4f gitea: replace role (#519)
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: #519
2023-04-25 16:25:50 +02:00

23 lines
605 B
YAML

---
- name: "Create Gitea Group"
become: true
ansible.builtin.group:
name: "{{ gitea_group }}"
system: true
state: "present"
- name: Switch shell when not using the builtin ssh server
ansible.builtin.set_fact:
gitea_shell: "/bin/bash"
when: "not gitea_start_ssh and gitea_shell == '/bin/false'"
- name: "Create Gitea user"
become: true
ansible.builtin.user:
name: "{{ gitea_user }}"
comment: "Gitea user"
group: "{{ gitea_group }}"
groups: "{{ gitea_groups | default(omit) }}"
home: "{{ gitea_user_home }}"
shell: "{{ gitea_shell }}"
system: true