5 UBUNTU_BIONIC=${UBUNTU_BIONIC:-Ubuntu 18.04.2 LTS}
8 DOWNLOAD_PATH=${DOWNLOAD_PATH:-/opt/icn}
9 LOCAL_APT_REPO=${LOCAL_APT_REPO:-$DOWNLOAD_PATH/apt}
10 PIP_CACHE_DIR=${PIP_CACHE_DIR:-$DOWNLOAD_PATH/pip-cache-dir}
11 BUILD_DIR=${BUILD_DIR:-$DOWNLOAD_PATH/build-dir}
12 CONTAINER_IMAGES_DIR=${CONTAINER_IMAGES_DIR:-$DOWNLOAD_PATH/docker-dir}
15 #Todo include over all variables here
16 KUBE_VERSION=${KUBE_VERSION:-"v1.15.0"}
17 POD_NETWORK_CIDR=${POD_NETWORK_CIDR:-"10.244.0.0/16"}
18 PODMAN_CNI_CONFLIST=${PODMAN_CNI_CONFLIST:-"https://raw.githubusercontent.com/containers/libpod/v1.4.4/cni/87-podman-bridge.conflist"}
21 IRONIC_IMAGE=${IRONIC_IMAGE:-"integratedcloudnative/ironic:v1.0-icn"}
22 IRONIC_INSPECTOR_IMAGE=${IRONIC_INSPECTOR_IMAGE:-"integratedcloudnative/ironic-inspector:v1.0-icn"}
23 IRONIC_BAREMETAL_IMAGE=${IRONIC_BAREMETAL_IMAGE:-"integratedcloudnative/baremetal-operator:v2.0-icn"}
24 IPA_DOWNLOADER_IMAGE=${IPA_DOWNLOADER_IMAGE:-"integratedcloudnative/ironic-ipa-downloader:v1.0-icn"}
25 IRONIC_BAREMETAL_SOCAT_IMAGE=${IRONIC_BAREMETAL_SOCAT_IMAGE:-"alpine/socat:latest"}
27 IRONIC_DATA_DIR=${IRONIC_DATA_DIR:-"/opt/ironic"}
28 #IRONIC_PROVISIONING_INTERFACE is required to be provisioning, don't change it
29 IRONIC_INTERFACE=${IRONIC_INTERFACE:-}
30 IRONIC_PROVISIONING_INTERFACE=${IRONIC_PROVISIONING_INTERFACE:-"provisioning"}
31 IRONIC_IPMI_INTERFACE=${IRONIC_IPMI_INTERFACE:-}
32 IRONIC_PROVISIONING_INTERFACE_IP=${IRONIC_PROVISIONING_INTERFACE_IP:-"172.22.0.1"}
33 IRONIC_IPMI_INTERFACE_IP=${IRONIC_IPMI_INTERFACE_IP:-}
34 BM_IMAGE_URL=${BM_IMAGE_URL:-"https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img"}
35 BM_IMAGE=${BM_IMAGE:-"bionic-server-cloudimg-amd64.img"}
37 #Path to clone the metal3 dev env repo
38 M3PATH="$(go env GOPATH)/src/github.com/metal3-io"
39 #Path to clone the baremetal operator repo
40 BMOPATH="${M3PATH}/baremetal-operator"
41 #Baremetal operator repository URL
42 BMOREPO="${BMOREPO:-https://github.com/metal3-io/baremetal-operator.git}"
43 #Baremetal operator repository branch to checkout
44 BMOBRANCH="${BMOBRANCH:-10eb5aa3e614d0fdc6315026ebab061cbae6b929}"
45 #Discard existing baremetal operator repo directory
46 FORCE_REPO_UPDATE="${FORCE_REPO_UPDATE:-true}"
50 #Runs curl with passed flags and provides
51 #additional error handling and debug information
53 #Function outputs server response body
54 #and performs validation of http_code
57 local curl_response_file="$(mktemp -p /tmp)"
58 local curl_common_flags=(-s -w "%{http_code}" -o "${curl_response_file}")
59 local command=(curl "${curl_common_flags[@]}" "$@")
61 echo "[INFO] Running '${command[@]}'" >&2
62 if ! status="$("${command[@]}")"; then
63 echo "[ERROR] Internal curl error! '$status'" >&2
64 cat "${curl_response_file}"
65 rm "${curl_response_file}"
68 echo "[INFO] Server replied with status: ${status}" >&2
69 cat "${curl_response_file}"
70 rm "${curl_response_file}"
71 if [[ "${status:0:1}" =~ [45] ]]; then
80 NODES_FILE="${IRONIC_DATA_DIR}/nodes.json"
82 if [ ! -f "$NODES_FILE" ]; then
89 .ipmi_driver_info.username,
90 .ipmi_driver_info.password,
91 .ipmi_driver_info.address,
99 function node_networkdata {
102 NODES_FILE="${IRONIC_DATA_DIR}/nodes.json"
104 if [ ! -f "$NODES_FILE" ]; then
108 cat $NODES_FILE | jq -r --arg name "$name" '.nodes[] | select(.name==$name) | .net'