summaryrefslogtreecommitdiffstats
path: root/autocluster
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-03-28 16:02:36 +1100
committerMartin Schwenke <martin@meltin.net>2012-03-28 16:02:36 +1100
commit8e5e49fc14f5a628ae8b6d66b6489cc4f9dca085 (patch)
tree39dbbf1a13cb88be3d3f6cac2bd66c40e7da5ac3 /autocluster
parent1d143080e5773545f6d1c724755690f348131056 (diff)
parent1012c486c791c53bfc972e27242283b7e46f122a (diff)
downloadautocluster-8e5e49fc14f5a628ae8b6d66b6489cc4f9dca085.tar.gz
autocluster-8e5e49fc14f5a628ae8b6d66b6489cc4f9dca085.tar.xz
autocluster-8e5e49fc14f5a628ae8b6d66b6489cc4f9dca085.zip
Merge remote-tracking branch 'amitay/master'
Diffstat (limited to 'autocluster')
-rwxr-xr-xautocluster17
1 files changed, 16 insertions, 1 deletions
diff --git a/autocluster b/autocluster
index 0d6a950..f5fae9f 100755
--- a/autocluster
+++ b/autocluster
@@ -1094,7 +1094,7 @@ has_public_addresses_DEFAULT ()
# * Excluded nodes: unless specified via comma-separated list of IP offsets,
# nodes are excluded via their node types
# * Number of public addresses per interface is either specified or $NUMNODES.
-make_public_addresses () {
+make_public_addresses_old () {
local firstip="${1:-$(($FIRSTIP + $PUBLIC_IP_OFFSET))}"
local excluded_nodes="$2"
local num_addrs="${3:-${NUMNODES}}"
@@ -1130,6 +1130,21 @@ make_public_addresses () {
hack_all_nodes_with make_public_addresses_for_node
}
+make_public_addresses() {
+ local firstip="${1:-$[${FIRSTIP} + ${PUBLIC_IP_OFFSET}]}"
+ local num_addrs="${2:-${NUMNODES}}"
+
+ if [ $[ $firstip + $num_addrs - 1 ] -gt 254 ]; then
+ die "make_public_addresses: last octet > 254 - change PUBLIC_IP_OFFSET"
+ fi
+
+ local e
+ for e in $IPNET0 $IPNET1 $IPNET2 ; do
+ echo -ne "${IPBASE}.${e}.${firstip},${num_addrs},eth${e} "
+ done
+ echo
+}
+
######################################################################
post_config_hooks=