188ea92675
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
16 lines
553 B
YAML
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
|