From 810b81991fd0ae48fa0a0e2049780f35dddbc8c6 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Tue, 29 Jun 2021 09:15:46 +0200 Subject: [PATCH] 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 `. 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 --- deployment/haproxy/haproxy-public-tls-inject.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deployment/haproxy/haproxy-public-tls-inject.yaml b/deployment/haproxy/haproxy-public-tls-inject.yaml index 191a8c3079..592c3ede6b 100644 --- a/deployment/haproxy/haproxy-public-tls-inject.yaml +++ b/deployment/haproxy/haproxy-public-tls-inject.yaml @@ -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') }}"