4 DOWNLOAD_PATH=${DOWNLOAD_PATH:-/opt/icn}
7 IRONIC_IMAGE=${IRONIC_IMAGE:-"integratedcloudnative/ironic:v1.0-icn"}
8 IRONIC_INSPECTOR_IMAGE=${IRONIC_INSPECTOR_IMAGE:-"integratedcloudnative/ironic-inspector:v1.0-icn"}
9 IRONIC_BAREMETAL_IMAGE=${IRONIC_BAREMETAL_IMAGE:-"integratedcloudnative/baremetal-operator:v2.0-icn"}
10 IPA_DOWNLOADER_IMAGE=${IPA_DOWNLOADER_IMAGE:-"integratedcloudnative/ironic-ipa-downloader:v1.0-icn"}
12 IRONIC_DATA_DIR=${IRONIC_DATA_DIR:-"/opt/ironic"}
13 #IRONIC_PROVISIONING_INTERFACE is required to be provisioning, don't change it
14 IRONIC_INTERFACE=${IRONIC_INTERFACE:-}
15 IRONIC_PROVISIONING_INTERFACE=${IRONIC_PROVISIONING_INTERFACE:-"provisioning"}
16 IRONIC_IPMI_INTERFACE=${IRONIC_IPMI_INTERFACE:-}
17 IRONIC_PROVISIONING_INTERFACE_IP=${IRONIC_PROVISIONING_INTERFACE_IP:-"172.22.0.1"}
18 BM_IMAGE_URL=${BM_IMAGE_URL:-"https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img"}
19 BM_IMAGE=${BM_IMAGE:-"bionic-server-cloudimg-amd64.img"}
21 #Path to clone the metal3 dev env repo
22 M3PATH="$(go env GOPATH)/src/github.com/metal3-io"
23 #Path to clone the baremetal operator repo
24 BMOPATH="${M3PATH}/baremetal-operator"
25 #Baremetal operator repository URL
26 BMOREPO="${BMOREPO:-https://github.com/metal3-io/baremetal-operator.git}"
27 #Baremetal operator repository branch to checkout
28 BMOBRANCH="${BMOBRANCH:-10eb5aa3e614d0fdc6315026ebab061cbae6b929}"
29 #Discard existing baremetal operator repo directory
30 FORCE_REPO_UPDATE="${FORCE_REPO_UPDATE:-true}"
34 #Runs curl with passed flags and provides
35 #additional error handling and debug information
37 #Function outputs server response body
38 #and performs validation of http_code
41 local curl_response_file="$(mktemp -p /tmp)"
42 local curl_common_flags=(-s -w "%{http_code}" -o "${curl_response_file}")
43 local command=(curl "${curl_common_flags[@]}" "$@")
45 echo "[INFO] Running '${command[@]}'" >&2
46 if ! status="$("${command[@]}")"; then
47 echo "[ERROR] Internal curl error! '$status'" >&2
48 cat "${curl_response_file}"
49 rm "${curl_response_file}"
52 echo "[INFO] Server replied with status: ${status}" >&2
53 cat "${curl_response_file}"
54 rm "${curl_response_file}"
55 if [[ "${status:0:1}" =~ [45] ]]; then
64 NODES_FILE="${IRONIC_DATA_DIR}/nodes.json"
66 if [ ! -f "$NODES_FILE" ]; then
73 .ipmi_driver_info.username,
74 .ipmi_driver_info.password,
75 .ipmi_driver_info.address,
83 function node_networkdata {
86 NODES_FILE="${IRONIC_DATA_DIR}/nodes.json"
88 if [ ! -f "$NODES_FILE" ]; then
92 cat $NODES_FILE | jq -r --arg name "$name" '.nodes[] | select(.name==$name) | .net'