Skip to content

Commit

Permalink
Merge pull request #190 from dosaboy/ps-vips
Browse files Browse the repository at this point in the history
Dynamically set VIP_ADDR_START
  • Loading branch information
nicolasbock authored May 23, 2024
2 parents e381d03 + 2a324b0 commit 6305078
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions common/generate_bundle_base
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ declare -a overlay_opts=()
update_master_opts ${MOD_PASSTHROUGH_OPTS[@]}

vip_start=${MASTER_OPTS[VIP_ADDR_START]}
if [[ -z $vip_start ]]; then
# prodstack
cidr=$(source ~/novarc; openstack subnet show subnet_${OS_USERNAME} -c cidr -f value 2>/dev/null)
if [[ -z $cidr ]]; then
# stsstack
cidr=$(source ~/novarc; openstack subnet show ${OS_USERNAME}_admin_subnet -c cidr -f value 2>/dev/null)
fi
if [[ -n $cidr ]]; then
vip_start=$(echo $cidr| sed -r 's/([0-9]+\.[0-9]+).+/\1/g').150.0
fi
fi
VIP_START_PREFIX=${vip_start%\.*}
VIP_START_SUFFIX=${vip_start##*\.}

Expand Down
2 changes: 1 addition & 1 deletion common/helpers
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare -A MASTER_OPTS=(
[BUNDLE_NAME]=''
[CLOUD_NAME]=''
[TARGET_RELEASE_NAME]=''
[VIP_ADDR_START]=10.5.100.0
[VIP_ADDR_START]=
[CHARM_REVISIONS]=
[CHARM_STORE]=ch:
)
Expand Down

0 comments on commit 6305078

Please sign in to comment.