2024-04-04 09:48:09 +02:00
|
|
|
---
|
|
|
|
# die Variablen kommen aus
|
|
|
|
# - https://docs.gitea.com/administration/command-line
|
|
|
|
# - https://github.com/lldap/lldap/blob/main/example_configs/gitea.md
|
|
|
|
# und
|
|
|
|
# den jeweiligen group/host-Vars!
|
2024-05-13 11:44:33 +02:00
|
|
|
|
|
|
|
- name: Check if Admin-User exists
|
2024-05-13 11:49:36 +02:00
|
|
|
# no_log: true
|
2024-04-04 09:48:09 +02:00
|
|
|
become_user: gitea
|
|
|
|
become: true
|
|
|
|
ansible.builtin.command: |
|
2024-05-13 11:50:19 +02:00
|
|
|
forgejo admin user list \
|
2024-05-13 11:44:33 +02:00
|
|
|
--config "{{ gitea_configuration_path }}/gitea.ini"
|
|
|
|
register: check
|
|
|
|
|
|
|
|
- name: Ensure Admin-User exists
|
2024-05-13 11:49:36 +02:00
|
|
|
#no_log: true
|
2024-05-13 11:44:33 +02:00
|
|
|
become_user: gitea
|
|
|
|
become: true
|
|
|
|
ansible.builtin.command: |
|
|
|
|
forgejo admin user create \
|
|
|
|
--config "{{ gitea_configuration_path }}/gitea.ini"
|
|
|
|
--username "{{ gitea_admin_user }}" \
|
|
|
|
--password "{{ gitea_admin_user_pass }}" \
|
|
|
|
--email "{{ gitea_admin_user }}@mgrote.net" \
|
|
|
|
--admin
|
2024-05-13 11:50:56 +02:00
|
|
|
when: 'not "{{ gitea_admin_user }}@mgrote.net" in check.stdout'
|
2024-04-04 09:48:09 +02:00
|
|
|
...
|