diff --git a/playbooks/roles/gitea/tasks/main.yaml b/playbooks/roles/gitea/tasks/main.yaml index 3965bccaab..0d8f75221c 100644 --- a/playbooks/roles/gitea/tasks/main.yaml +++ b/playbooks/roles/gitea/tasks/main.yaml @@ -41,14 +41,23 @@ - name: Install reverse proxy include_tasks: proxy.yaml +- name: Get list of image IDs pre pull + # The --quiet flag prints out only image IDs + command: docker image list --quiet + register: pre_pull_image_ids + - name: Run docker-compose pull shell: cmd: docker-compose pull chdir: /etc/gitea-docker/ - register: docker_compose_pull + +- name: Get list of image IDs post pull + # The --quiet flag prints out only image IDs + command: docker image list --quiet + register: post_pull_image_ids - name: Stop/Start gitea safely for Gerrit replication - when: "'downloaded newer image' in docker_compose_pull.stderr" + when: pre_pull_image_ids.stdout_lines|sort != post_pull_image_ids.stdout_lines|sort block: - name: Run docker-compose stop shell: diff --git a/playbooks/roles/jitsi-meet/tasks/main.yaml b/playbooks/roles/jitsi-meet/tasks/main.yaml index 05a88b1fec..6b3a6b0dd4 100644 --- a/playbooks/roles/jitsi-meet/tasks/main.yaml +++ b/playbooks/roles/jitsi-meet/tasks/main.yaml @@ -80,13 +80,23 @@ yes creates: /var/jitsi-meet/jvb/jvb-keystore.store +- name: Get list of image IDs pre pull + # The --quiet flag prints out only image IDs + command: docker image list --quiet + register: pre_pull_image_ids + - name: Run docker-compose pull shell: cmd: docker-compose pull chdir: /etc/jitsi-meet-docker/ - register: docker_compose_pull + +- name: Get list of image IDs post pull + # The --quiet flag prints out only image IDs + command: docker image list --quiet + register: post_pull_image_ids + - name: Stop/Start containers if needed - when: "'downloaded newer image' in docker_compose_pull.stderr" + when: pre_pull_image_ids.stdout_lines|sort != post_pull_image_ids.stdout_lines|sort block: - name: Run docker-compose down shell: