Undercloud/Certmonger: Only attempt to reload haproxy is it's active

Previously, certmonger tried to reload haproxy every time after a
certificate is requested. This is useful for certificate resubmits or
renewals. However, it turned out problematic on installation, when
haproxy is not yet active, as it would try many times and end up having
a race-condition with puppet.

This checks if haproxy is active and only then will it attempt to reload
it.

Closes-Bug: #1712377
Change-Id: I4edd42b888a0bbbb8eb0e71f5c17750bac46c2ce
(cherry picked from commit fe25c53fe9)
This commit is contained in:
Juan Antonio Osorio Robles 2017-08-23 12:02:43 +03:00 committed by Emilien Macchi
parent 976ef0146b
commit 830554939b
1 changed files with 3 additions and 1 deletions

View File

@ -24,4 +24,6 @@ getcert resubmit -i "$REQUEST_NICKNAME" -w -v -U id-kp-clientAuth \
-U id-kp-serverAuth
cat $CERT_FILE $KEY_FILE > $OUTPUT_FILE
systemctl reload haproxy
if systemctl -q is-active haproxy; then
systemctl reload haproxy
fi