Skip to content

Commit fad6268

Browse files
committed
OCPEDGE-1825: [TNF] Reworked TNF logic to render fencing block conditionally.
Two Node OpenShift with Fencing (TNF) is a deployment topology with two control-plane nodes that was introduce as a Dev Preview in OpenShift 4.19. This commit updates the logic around TNF to only render fencing credentials in releases 4.19 and up, and also the sslInsecure parameter so that it uses certificateVerification in 4.20 and up, as introduced in openshift/installer#9640.
1 parent 4035a38 commit fad6268

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

02_configure_host.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,17 @@ if [[ $(uname -m) == "aarch64" ]]; then
128128
echo "libvirt_cdrombus: scsi" >> vm_setup_vars.yml
129129
fi
130130

131+
ironic_prefix_env_var="ironic_prefix=${CLUSTER_NAME}_"
132+
# If this is a Two Node OpenShift with Fencing (TNF) installation
133+
# the name of the entry in the infra_nodes.json must match the hostname
134+
# of the created host so that the fencing secret can be found
135+
if [[ -z "${ENABLE_ARBITER:-}" ]] && [[ "${NUM_MASTERS}" -eq 2 ]]; then
136+
ironic_prefix_env_var="ironic_prefix=''"
137+
fi
138+
131139
ansible-playbook \
132140
-e @vm_setup_vars.yml \
133-
-e "ironic_prefix=${CLUSTER_NAME}_" \
141+
-e "${ironic_prefix_dev_env}" \
134142
-e "cluster_name=${CLUSTER_NAME}" \
135143
-e "provisioning_network_name=${PROVISIONING_NETWORK_NAME}" \
136144
-e "baremetal_network_name=${BAREMETAL_NETWORK_NAME}" \

utils.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,13 @@ EOF
304304
}
305305

306306
function node_map_to_install_config_fencing_credentials() {
307+
TNF_ENABLED_RELEASE=4.19
308+
309+
# If we didn't support TNF in this release, we skip rendering the fencing block
310+
if is_lower_version "$(openshift_version "${OCP_DIR}")" "$TNF_ENABLED_RELEASE"; then
311+
return 0
312+
fi
313+
307314
if [[ -z "${ENABLE_ARBITER:-}" ]] && [[ "${NUM_MASTERS}" -eq 2 ]]; then
308315
cat <<EOF
309316
fencing:
@@ -320,7 +327,15 @@ EOF
320327
address: ${address}
321328
username: ${username}
322329
password: ${password}
323-
sslInsecure: true
330+
EOF
331+
# We don't support overriding certificateVerification in 4.19
332+
if [ $(openshift_version "${OCP_DIR}") == "$TNF_ENABLED_RELEASE" ]; then
333+
continue
334+
fi
335+
336+
certificate_verification=$([ node_val ${idx} "driver_info.disableCertificateVerification" | tr '[:upper:]' '[:lower:]' == "true" ] && echo -n "Disabled" || echo -n "Enabled")
337+
cat <<EOF
338+
certificateVerification: ${certificate_verification}
324339
EOF
325340
done
326341
fi

0 commit comments

Comments
 (0)