forked from openshift-metal3/dev-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
05_create_install_config.sh
executable file
·37 lines (30 loc) · 1.08 KB
/
05_create_install_config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -x
set -e
source logging.sh
source common.sh
source network.sh
source utils.sh
source ocp_install_env.sh
source rhcos.sh
source validation.sh
early_deploy_validation
set_api_and_ingress_vip
if [ ! -f ${OCP_DIR}/install-config.yaml ]; then
# Validate there are enough nodes to avoid confusing errors later..
NODES_LEN=$(jq '.nodes | length' ${NODES_FILE})
if (( $NODES_LEN < ( $NUM_MASTERS + $NUM_WORKERS ) )); then
echo "ERROR: ${NODES_FILE} contains ${NODES_LEN} nodes, but ${NUM_MASTERS} masters and ${NUM_WORKERS} workers requested"
exit 1
fi
# Create a nodes.json file
mkdir -p ${OCP_DIR}
jq '{nodes: .}' "${NODES_FILE}" | tee "${BAREMETALHOSTS_FILE}"
# Create install config for openshift-installer
generate_ocp_install_config ${OCP_DIR}
fi
# Generate the assets for extra worker VMs
if [ -f "${EXTRA_NODES_FILE}" ]; then
jq '.nodes' "${EXTRA_NODES_FILE}" | tee "${EXTRA_BAREMETALHOSTS_FILE}"
generate_ocp_host_manifest ${OCP_DIR} ${EXTRA_BAREMETALHOSTS_FILE} extra_host_manifests.yaml openshift-machine-api
fi