+ notify "[WARN] Could not retrieve PDF (Pod Descriptor File)!\n" 3
+ fi
+elif ! curl -o "${LOCAL_IDF}" "${BASE_CONFIG_IDF}"; then
+ notify "[WARN] POD has no IDF (Installer Descriptor File)!\n" 3
+elif ! "${PHAROS_GEN_CONFIG_SCRIPT}" -y "${LOCAL_PDF}" \
+ -j "${PHAROS_INSTALLER_ADAPTER}" > "${LOCAL_PDF_RECLASS}"; then
+ notify "[ERROR] Could not convert PDF to reclass model input!\n" 1>&2
+ exit 1
+fi
+
+# Check scenario file existence
+SCENARIO_DIR="../config/scenario"
+if [ ! -f "${SCENARIO_DIR}/${DEPLOY_TYPE}/${DEPLOY_SCENARIO}.yaml" ]; then
+ notify "[WARN] ${DEPLOY_SCENARIO}.yaml not found! \
+ Setting simplest scenario (os-nosdn-nofeature-noha)\n" 3
+ DEPLOY_SCENARIO='os-nosdn-nofeature-noha'
+ if [ ! -f "${SCENARIO_DIR}/${DEPLOY_TYPE}/${DEPLOY_SCENARIO}.yaml" ]; then
+ notify "[ERROR] Scenario definition file is missing!\n" 1>&2
+ exit 1
+ fi
+fi
+
+# Check defaults file existence
+if [ ! -f "${SCENARIO_DIR}/defaults-$(uname -i).yaml" ]; then
+ notify "[ERROR] Scenario defaults file is missing!\n" 1>&2
+ exit 1
+fi
+
+# Get required infra deployment data
+source lib.sh
+eval "$(parse_yaml "${SCENARIO_DIR}/defaults-$(uname -i).yaml")"
+eval "$(parse_yaml "${SCENARIO_DIR}/${DEPLOY_TYPE}/${DEPLOY_SCENARIO}.yaml")"
+eval "$(parse_yaml "${LOCAL_PDF_RECLASS}")"
+
+export CLUSTER_DOMAIN=${cluster_domain}
+
+declare -A virtual_nodes_ram virtual_nodes_vcpus
+for node in "${virtual_nodes[@]}"; do
+ virtual_custom_ram="virtual_${node}_ram"
+ virtual_custom_vcpus="virtual_${node}_vcpus"
+ virtual_nodes_ram[$node]=${!virtual_custom_ram:-$virtual_default_ram}
+ virtual_nodes_vcpus[$node]=${!virtual_custom_vcpus:-$virtual_default_vcpus}
+done
+
+# Expand reclass and virsh network templates
+for tp in "${RECLASS_CLUSTER_DIR}/all-mcp-ocata-common/opnfv/"*.template \
+ net_*.template; do
+ eval "cat <<-EOF
+ $(<"${tp}")
+ EOF" 2> /dev/null > "${tp%.template}"
+done
+
+# Map PDF networks 'admin', 'mgmt', 'private' and 'public' to bridge names
+BR_NAMES=('admin' 'mgmt' 'private' 'public')
+BR_NETS=( \
+ "${parameters__param_opnfv_maas_pxe_address}" \
+ "${parameters__param_opnfv_infra_config_address}" \
+ "${parameters__param_opnfv_openstack_compute_node01_tenant_address}" \
+ "${parameters__param_opnfv_openstack_compute_node01_external_address}" \
+)
+for ((i = 0; i < ${#BR_NETS[@]}; i++)); do
+ br_jump=$(eval echo "\$parameters__param_opnfv_jump_bridge_${BR_NAMES[i]}")
+ if [ -n "${br_jump}" ] && [ "${br_jump}" != 'None' ] && \
+ [ -d "/sys/class/net/${br_jump}/bridge" ]; then
+ notify "[OK] Bridge found for '${BR_NAMES[i]}': ${br_jump}\n" 2
+ OPNFV_BRIDGES[${i}]="${br_jump}"
+ elif [ -n "${BR_NETS[i]}" ]; then
+ bridge=$(ip addr | awk "/${BR_NETS[i]%.*}./ {print \$NF; exit}")
+ if [ -n "${bridge}" ] && [ -d "/sys/class/net/${bridge}/bridge" ]; then
+ notify "[OK] Bridge found for net ${BR_NETS[i]%.*}.0: ${bridge}\n" 2
+ OPNFV_BRIDGES[${i}]="${bridge}"
+ fi