Do not fail if haproxy container UUID changes

There is a possibility that haproxy container crashed and restarted
with another UUID, while the deployment is trying to reload it
after reconfiguring the certificates, by sending a
`kill -HUP <uuid-of-the-container>`. In that case, ingore errors
for the commands block, since there is no longer need to reload the
newly created container.

Related rhbz#1973674

Change-Id: I4b40d73ab329dc219ee7a387201b0747a6233ed4
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2021-06-29 09:15:46 +02:00
parent d534731b1d
commit 810b81991f
1 changed files with 4 additions and 0 deletions

View File

@ -182,4 +182,8 @@ outputs:
fi
{{ container_cli }} exec --user root {{ item }} chgrp haproxy {{ cert_path }}
{{ container_cli }} kill --signal=HUP {{ item }}
register: container_kill_result
failed_when:
- ("no such container" not in container_kill_result.stderr)
- ("container state improper" not in container_kill_result.stderr)
with_items: "{{ container_id.stdout.split('\n') }}"