system-config/playbooks/roles/mailman3/handlers/restart_mailman.yaml
Jeremy Stanley 188ea92675 Mailman3: check docker-compose stderr not stdout
For the conditional check as to whether docker-compose up was a
no-op, we look for a recognizable string in the output it generates.
This information is emitted on the stderr descriptor, not stdout, so
correct the match condition accordingly.

Change-Id: I82015e615071458c95342eaea2e6a17aeae44c07
2023-08-17 20:04:09 +00:00

16 lines
553 B
YAML

- name: mailman check for running containers
command: pgrep -f uwsgi
ignore_errors: yes
register: uwsgi_pids
- name: mailman restart containers if running
# Also makes sure the containers weren't just restarted by an image update
when: uwsgi_pids.rc == 0 and "is up-to-date" in mailman_dcup.stderr
block:
- name: down containers
shell:
cmd: docker-compose -f /etc/mailman-compose/docker-compose.yaml down
- name: up containers
shell:
cmd: docker-compose -f /etc/mailman-compose/docker-compose.yaml up -d