diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index c19df1a1..1e4ce2a5 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -2623,7 +2623,22 @@ if [ -n "${BOOTIF}" ] ; then if [ -z "${mgmt_ip}" -o "${mgmt_ip}" == "None" -o -z "${mgmt_nm}" -o "${mgmt_nm}" = "None" ] ; then report_failure_with_msg "Unable to parse management ip and netmask from sysinv queried mgmt_ip info : value:${host_info}. Aborting Installation." else - mgmt_gw=$(echo "${mgmt_ip}" | awk -F'.' -v OFS='.' '{$NF=1}1') + # the mgmt floating address is running on the active controller, so it is our gateway + mgmt_gw=$(echo "${host_info}" | grep -o '"floating": "[^"]*' | cut -d'"' -f4) + if [ -z "${mgmt_gw}" -o "${mgmt_gw}" == "None" ] ; then + ilog "invalid mgmt_gw=${mgmt_gw}, extrapolate gateway from ${mgmt_ip}" + # this step is done only to have a valid address value for mgmt_gw, to not create + # parsing errors for ifupdown, no need to interrupt installation, as all traffic + # post install will run locally on the management network until puppet executes + # the manifest and with it the definitive network configuration is applied. + if [[ ${mgmt_ip} =~ ^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$ ]]; then + # IPv6 + mgmt_gw=$(echo "${mgmt_ip}" | awk -F':' -v OFS=':' '{$NF=1}1') + else + # IPv4 + mgmt_gw=$(echo "${mgmt_ip}" | awk -F'.' -v OFS='.' '{$NF=1}1') + fi + fi ilog "... mgmt_gw=${mgmt_gw}" fi