---
- name: "β³ Wait until database container for '{{ application_id }}' is healthy"
ansible.builtin.command: >-
container inspect --type container
--format={% raw %}{{.State.Health.Status}}{% endraw %}
{{ lookup('database', application_id, 'container') }}
register: _app_db_health
retries: 60
delay: 2
changed_when: false
until: (_app_db_health.stdout | trim) == 'healthy'
when:
- (compose_mode_force | default('') or DEPLOYMENT_MODE) == 'compose'
- lookup('database', application_id, 'enabled') | bool
- name: "π For '{{ application_id }}': realign a dedicated postgres"
ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-rdbms/tasks/utils/realign_dedicated_db.yml') }}"
- name: "β³ Wait until swarm tasks of '{{ application_id | entity_name }}' are running"
ansible.builtin.script: "{{ lookup('path_absolute', 'roles/sys-svc-compose/files/shell/swarm/stack_ready.sh') }}"
environment:
STACK: "{{ application_id | entity_name }}"
FATAL_GRACE: "{{ swarm_stack_fatal_grace }}"
register: _swarm_tasks_ready
retries: "{{ swarm_stack_converge_retries }}"
delay: 2
changed_when: false
until: _swarm_tasks_ready.rc in [0, 2]
when: (compose_mode_force | default('') or DEPLOYMENT_MODE) == 'swarm'