From 67377cd59e244ec6cd3a2bfeb306a157b0f425bf Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Thu, 1 Aug 2024 12:27:12 +0100 Subject: [PATCH] Fix prodstack6 VIP allocation --- common/generate_bundle_base | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/generate_bundle_base b/common/generate_bundle_base index 25b5f2ac..9d7fb752 100644 --- a/common/generate_bundle_base +++ b/common/generate_bundle_base @@ -23,7 +23,9 @@ if [[ -z $vip_start ]] && [[ -e ~/novarc ]]; then # Our primary network is /25 and we are arbitrarily using the # last 20 addresses for vips which is prone to collisions but # we have no alternative currently. - vip_start=$(echo $cidr| sed -r 's/([0-9]+\.[0-9]+\.[0-9]+).+/\1/g').106 + net_start=$(awk -F'.' '/HostMin/{print $NF}' <<<$(ipcalc -b $cidr)) + net_start_suffix=${net_start##*\.} + vip_start=$(echo $cidr| sed -r 's/([0-9]+\.[0-9]+\.[0-9]+).+/\1/g').$((net_start_suffix + 105)) fi fi VIP_START_PREFIX=${vip_start%\.*}