Forgejo admin user only created on first deploy, not re-run
This commit is contained in:
parent
a496efa816
commit
95b3f40dba
1 changed files with 2 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue