Skip to content

Commit

Permalink
Add tls certs to fakeIPA config
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammed Boukhalfa <mohammed.boukhalfa@est.tech>
  • Loading branch information
mboukhalfa committed Oct 28, 2024
1 parent 45a403e commit a396498
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 03_launch_mgmt_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,15 @@ launch_fake_ipa() {
mkdir -p "${WORKING_DIR}/fake-ipa"
if [[ "${EPHEMERAL_CLUSTER}" == "kind" ]] && [[ "${IRONIC_TLS_SETUP}" == "true" ]]; then
cp "${IRONIC_CACERT_FILE}" "${WORKING_DIR}/fake-ipa/ironic-ca.crt"
cp "${IRONIC_CERT_FILE}" "${WORKING_DIR}/fake-ipa/ironic-tls.crt"
cp "${IRONIC_KEY_FILE}" "${WORKING_DIR}/fake-ipa/ironic-tls.key"
elif [[ "${IRONIC_TLS_SETUP}" == "true" ]]; then
# wait for ironic to be running to ensure ironic-cert is created
kubectl -n baremetal-operator-system wait --for=condition=available deployment/baremetal-operator-ironic --timeout=900s
# Extract ironic-cert to be used inside fakeIPA for TLS
kubectl get secret -n baremetal-operator-system ironic-cert -o json -o=jsonpath="{.data.ca\.crt}" | base64 -d > "${WORKING_DIR}/fake-ipa/ironic-ca.crt"
kubectl get secret -n baremetal-operator-system ironic-cert -o json -o=jsonpath="{.data.tls\.crt}" | base64 -d > "${WORKING_DIR}/fake-ipa/ironic-tls.crt"
kubectl get secret -n baremetal-operator-system ironic-cert -o json -o=jsonpath="{.data.tls\.key}" | base64 -d > "${WORKING_DIR}/fake-ipa/ironic-tls.key"
fi
# Create fake IPA custom config
cat << EOF > "${WORKING_DIR}/fake-ipa/config.py"
Expand All @@ -240,6 +244,8 @@ FAKE_IPA_INSPECTION_CALLBACK_URL = "${IRONIC_URL}/continue_inspection"
FAKE_IPA_ADVERTISE_ADDRESS_IP = "${EXTERNAL_SUBNET_V4_HOST}"
FAKE_IPA_INSECURE = ${FAKE_IPA_INSECURE:-False}
FAKE_IPA_CAFILE = "${FAKE_IPA_CAFILE:-/root/cert/ironic-ca.crt}"
FAKE_IPA_CERTFILE = "${FAKE_IPA_CERTFILE:-/root/cert/ironic-tls.crt}"
FAKE_IPA_KEYFILE = "${FAKE_IPA_KEYFILE:-/root/cert/ironic-tls.key}"
FAKE_IPA_MIN_BOOT_TIME = ${FAKE_IPA_MIN_BOOT_TIME:-20}
FAKE_IPA_MAX_BOOT_TIME = ${FAKE_IPA_MAX_BOOT_TIME:-30}
EOF
Expand Down

0 comments on commit a396498

Please sign in to comment.