kolla/docker/base/copy_cacerts.sh
Marcin Juszkiewicz bd90b02708 drop leftovers of RHEL support
As a project we never built RHEL based images so support for them
was not tested.

Change-Id: I27dfe34ade088228d71f6857ec4f3ab28ee63915
2021-07-28 16:04:21 +00:00

28 lines
985 B
Bash

#!/bin/bash
# Copy custom CA certificates to system trusted CA certificates folder
# and run CA update utility
# Remove old certificates
rm -f /usr/local/share/ca-certificates/kolla-customca-* \
/etc/pki/ca-trust/source/anchors/kolla-customca-*
if [[ -d /var/lib/kolla/config_files/ca-certificates ]] && \
[[ ! -z "$(ls -A /var/lib/kolla/config_files/ca-certificates/)" ]]; then
if [[ -e /etc/debian_version ]]; then
# Debian, Ubuntu
for cert in /var/lib/kolla/config_files/ca-certificates/*; do
file=$(basename "$cert")
cp $cert "/usr/local/share/ca-certificates/kolla-customca-$file"
done
update-ca-certificates
elif [[ -e /etc/redhat-release ]]; then
# CentOS
for cert in /var/lib/kolla/config_files/ca-certificates/*; do
file=$(basename "$cert")
cp $cert "/etc/pki/ca-trust/source/anchors/kolla-customca-$file"
done
update-ca-trust
fi
fi