---
- 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: "pretix"
resolve_output_prefix: PRETIX_ADMIN
resolve_compose_cid: "{{ PRETIX_CONTAINER }}"
- name: "π€ Converge the Pretix administrator, lock the default account"
ansible.builtin.command:
argv:
- container
- exec
- -i
- -e
- ADMIN_EMAIL
- -e
- ADMIN_PASSWORD
- "{{ PRETIX_ADMIN_LOCAL_CID }}" # nocheck: container-exec-resolver
- pretix
- shell_scoped
- --override
stdin: "{{ lookup('file', 'python/admin_account.py') }}"
environment:
ADMIN_EMAIL: "{{ PRETIX_NATIVE_ADMIN_EMAIL }}"
ADMIN_PASSWORD: "{{ lookup('users', 'platform_administrator').password }}"
register: pretix_admin
retries: 10
delay: 6
until: pretix_admin.stdout is search('(?m)PRETIX_RESULT=[A-Z+]+$')
changed_when: pretix_admin.stdout is search('(?m)PRETIX_RESULT=CHANGED(\+FOREIGN)?$')
failed_when: pretix_admin.stdout is not search('(?m)PRETIX_RESULT=(UNCHANGED|CHANGED)(\+FOREIGN)?$')
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
delegate_to: "{{ PRETIX_ADMIN_HOST_NODE }}"
run_once: true