Forgejo admin user only created on first deploy, not re-run

This commit is contained in:
Graham McIntire 2026-07-24 14:08:08 -05:00
parent a496efa816
commit 95b3f40dba
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -103,15 +103,7 @@
until: web_ready.status == 200
changed_when: false
- name: Check if admin user exists
ansible.builtin.uri:
url: http://127.0.0.1:3000/api/v1/users/{{ forgejo_admin_user }}
method: GET
status_code: [200, 404]
register: admin_check
changed_when: false
- name: Create admin user
- name: Create admin user (first deploy only)
ansible.builtin.command:
cmd: >
docker exec -u git -w /data/gitea forgejo forgejo admin user create
@ -120,9 +112,7 @@
--password {{ forgejo_admin_password }}
--email {{ forgejo_admin_email }}
--admin
when:
- forgejo_data_exists.stat.exists
- admin_check.status == 404
when: not forgejo_data_exists.stat.exists
no_log: true
- name: Create runner data directory