Skip to content

Commit

Permalink
Merge pull request #284 from ben-ballot/add_ps5
Browse files Browse the repository at this point in the history
Add PS5 cloud support
  • Loading branch information
dosaboy authored Dec 12, 2024
2 parents e7fe91a + 106cf4e commit da328b8
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions openstack/profiles/prodstack5
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash -ex
source ~/novarc
# this is currently assumed to be a /25 network
EXT_SUBNET=subnet_${OS_USERNAME}-psd-extra
CIDR=`openstack subnet show $EXT_SUBNET -c cidr -f value`
# We reserve the last 64 of the /25 to FIP.
# We get the last usable IP on the subnet
FIP_RANGE_LASTIP=`openstack subnet show ${EXT_SUBNET} -c allocation_pools -f json | jq -r '.allocation_pools[0].end'`
# Get the first major subnet information, IE, 10.149.123 on a 10.149.123.0/25 subnet
SUBNET_RANGE=${FIP_RANGE_LASTIP%.*}

# We figure out from the last usable IP the last 64 usable IPs and concatenate it into the SUBNET_RANGE.
FIP_RANGE_FIRSTIP="${SUBNET_RANGE}.$((${FIP_RANGE_LASTIP##*.} - 64))"


export GATEWAY=`openstack subnet show $EXT_SUBNET -c gateway_ip -f value`

[[ -z "$NAMESERVER" ]] && export NAMESERVER="91.189.91.131"
[[ -z "$SWIFT_IP" ]] && export SWIFT_IP="10.130.56.34"

# Set defaults, if not already set.
[[ -z "$GATEWAY" ]] && export GATEWAY="$GATEWAY"
[[ -z "$CIDR_EXT" ]] && export CIDR_EXT="$CIDR"
[[ -z "$FIP_RANGE" ]] && export FIP_RANGE="${FIP_RANGE_FIRSTIP}:${FIP_RANGE_LASTIP}"
[[ -z "$CIDR_PRIV" ]] && export CIDR_PRIV="192.168.21.0/24"

export UNDERCLOUD_OAM_NET="$(sed -E --quiet "s/.+OS_PROJECT_NAME=(.+)_project/net_\1-psd/p" ~/novarc)"
export UNDERCLOUD_EXT_NET="$(sed -E --quiet "s/.+OS_PROJECT_NAME=(.+)_project/net_\1-psd-extra/p" ~/novarc)"

./profiles/default "$@"

0 comments on commit da328b8

Please sign in to comment.