Fix gitea admin deployment to be less brittle

Admin deployment was very timing-dependent: If the server took a while
to set it up, it would always error out while deploying. This commit
adds sufficient grace-time into the admin request call before the error
occurs which should avoid it in most deployments (unless the server is
severely underpowered or over-taxed).

Also fixes admin creation to avoid root usage in the container when it
is not called for.
This commit is contained in:
Marty Oehme 2022-12-18 12:00:33 +01:00
parent 32b1b13ef4
commit 8aaefd3f60
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9
2 changed files with 17 additions and 10 deletions

View file

@ -1,9 +1,10 @@
- name: Add admin user
community.docker.docker_container_exec:
community.docker.docker_container_exec:
container: "{{ gitea_app_container_name['stdout'] }}"
command: >
gitea admin user create --admin --username {{ gitea_app_admin_username }} --password {{ gitea_app_admin_password }} --email {{ gitea_app_admin_email }}
become: yes
user: git
become: true
listen: "no admin user"
## Register reverse proxy