Remove certificate before updating it

Containerized HAProxy always tries to load the SSL certificate; if TLS
is not enabled it will create the file as a directory. This messes up
with the script that actually injects the HAProxy certificate into the
undercloud. To address this, we update that script to take this into
account.

Change-Id: Ifc748648cc0f8caaf5a551fd0bc5724b94f3087d
Closes-Bug: #1728267
(cherry picked from commit d1f3b1f683)
This commit is contained in:
Juan Antonio Osorio Robles 2017-11-06 14:58:52 +02:00
parent bc60106eba
commit ef7da3e341
1 changed files with 5 additions and 0 deletions

View File

@ -52,6 +52,11 @@ resources:
- name: key_modulus
config: |
#!/bin/sh
# If the HAProxy container tried to load this, it'll be a directory and
# will make this fail.
if [ -d ${cert_path} ]; then
rm -rf ${cert_path}
fi
cat > ${cert_path} << EOF
${cert_chain_content}
EOF