Files
computer-playbook/roles/web-app-openwebui/tasks/utils/admin.yml
T
kevinveenbirkenbachandClaude Opus 5.5 8c7c32a312 fix(web-app-openwebui): keep the administrator helper from migrating the database a second time
The administrator convergence runs a Python helper inside the running container, and importing Open WebUI there started the database migrations again next to the app's own on first boot. The helper now runs with ENABLE_DB_MIGRATIONS=false. TODO.md records that logo and title stay Open WebUI's own under clause 4 of its license by operator decision, and that the first boot serves 502 until the embedding model is downloaded, with the measured timeline and options; the design spec's skip message names the decision.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 03:04:45 +02:00

39 lines
1.3 KiB
YAML

---
- name: "🔍 Resolve {{ application_id }} hosting node + container id"
ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/swarm/resolve_host_cid.yml') }}"
vars:
resolve_service_key: "{{ entity_name }}"
resolve_output_prefix: OPENWEBUI
resolve_compose_cid: "{{ OPENWEBUI_CONTAINER }}"
- name: "👤 Create the administrator or converge its password and role"
ansible.builtin.command:
argv:
- container
- exec
- -i
- -e
- ENABLE_DB_MIGRATIONS=false
- -e
- OPENWEBUI_ADMIN_EMAIL
- -e
- OPENWEBUI_ADMIN_NAME
- -e
- OPENWEBUI_ADMIN_PASSWORD
- "{{ OPENWEBUI_LOCAL_CID }}" # nocheck: container-exec-resolver OPENWEBUI_LOCAL_CID comes from resolve_host_cid.yml above
- python3
- "-"
stdin: "{{ lookup('file', 'python/administrator.py') }}"
environment:
OPENWEBUI_ADMIN_EMAIL: "{{ OPENWEBUI_ADMIN_USER.email }}"
OPENWEBUI_ADMIN_NAME: "{{ OPENWEBUI_ADMIN_USER.username }}"
OPENWEBUI_ADMIN_PASSWORD: "{{ OPENWEBUI_ADMIN_USER.password }}"
register: openwebui_admin
retries: 30
delay: 10
until: openwebui_admin.rc == 0
changed_when: openwebui_admin.stdout is search('(?m)^CHANGED')
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
delegate_to: "{{ OPENWEBUI_HOST_NODE }}"
run_once: true