Skip to content

Commit

Permalink
manager: ensure that all containers are up (#1234)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <berendt@osism.tech>
  • Loading branch information
berendt committed Dec 7, 2023
1 parent fb237b9 commit 810677e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion roles/manager/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
state: restarted
when: manager_service_restart|bool
notify:
- Wait for an healthy manager service
- Ensure that all containers are up
- Register that manager service was restarted

# NOTE: This handler prevents a 2nd manager restart in the
Expand All @@ -15,6 +15,13 @@
ansible.builtin.set_fact:
manager_service_restart: false

- name: Ensure that all containers are up
ansible.builtin.command:
cmd: docker compose --project-directory /opt/manager up -d
changed_when: true
notify:
- Wait for an healthy manager service

# NOTE: The command returns a list of IDs of containers from the service
# that are currently starting or unhealthy. As long as the list is not empty
# the service is not in a good state.
Expand Down

0 comments on commit 810677e

Please sign in to comment.