diff options
author | Amitay Isaacs <amitay@gmail.com> | 2012-03-05 13:19:04 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2012-03-05 15:21:07 +1100 |
commit | 32cb98da4a4b93d87ac4e997dbf6c4c1620fa3e4 (patch) | |
tree | b50b1f7166430f90d23d7b9ea7ecfe632e2cf539 /autocluster | |
parent | 4578af8f248e4d1069d4f6ffcfced145128c54c3 (diff) | |
download | autocluster-32cb98da4a4b93d87ac4e997dbf6c4c1620fa3e4.tar.gz autocluster-32cb98da4a4b93d87ac4e997dbf6c4c1620fa3e4.tar.xz autocluster-32cb98da4a4b93d87ac4e997dbf6c4c1620fa3e4.zip |
Change public addresses output format from make_public_addresses()
@@@PUBLIC_ADDRESSES@@@ will be replaced with
firstip,num_ips,iface firstip,num_ips,iface ...
Diffstat (limited to 'autocluster')
-rwxr-xr-x | autocluster | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/autocluster b/autocluster index 411fcd5..113950e 100755 --- a/autocluster +++ b/autocluster @@ -1087,7 +1087,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}}" @@ -1123,6 +1123,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= |