From 4f0bed69981894d7c4a8d21b2c62c58fdc33c3bd Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 26 Sep 2024 17:48:36 +0000 Subject: [PATCH] Explicitly down Jitsi-Meet containers on upgrade We've been running into problems with Jitsi-Meet processes not restarting cleanly if we only docker-compose up after image pulls. Instead, check for whether the pull resulted in new image downloads and then cleanly down and up the containers, which seems to address the problem based on manual testing on the servers. Change-Id: Id551767e72102a4b8667aa9dacc81755f332a278 --- playbooks/roles/jitsi-meet/tasks/main.yaml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/playbooks/roles/jitsi-meet/tasks/main.yaml b/playbooks/roles/jitsi-meet/tasks/main.yaml index 3985c3fc07..05a88b1fec 100644 --- a/playbooks/roles/jitsi-meet/tasks/main.yaml +++ b/playbooks/roles/jitsi-meet/tasks/main.yaml @@ -84,10 +84,18 @@ shell: cmd: docker-compose pull chdir: /etc/jitsi-meet-docker/ -- name: Run docker-compose up - shell: - cmd: docker-compose up -d - chdir: /etc/jitsi-meet-docker/ -- name: Run docker prune to cleanup unneeded images - shell: - cmd: docker image prune -f + register: docker_compose_pull +- name: Stop/Start containers if needed + when: "'downloaded newer image' in docker_compose_pull.stderr" + block: + - name: Run docker-compose down + shell: + cmd: docker-compose down + chdir: /etc/jitsi-meet-docker/ + - name: Run docker-compose up + shell: + cmd: docker-compose up -d + chdir: /etc/jitsi-meet-docker/ + - name: Run docker prune to cleanup unneeded images + shell: + cmd: docker image prune -f