Scott Baker | f93a06c | 2016-07-11 17:04:49 -0700 | [diff] [blame] | 1 | FN=$SETUPDIR/virtualbng.json |
| 2 | |
| 3 | rm -f $FN |
| 4 | |
| 5 | cat >> $FN <<EOF |
| 6 | { |
| 7 | "localPublicIpPrefixes" : [ |
| 8 | "10.254.0.128/25" |
| 9 | ], |
| 10 | "nextHopIpAddress" : "10.254.0.1", |
| 11 | "publicFacingMac" : "00:00:00:00:00:66", |
| 12 | "xosIpAddress" : "10.11.10.1", |
| 13 | "xosRestPort" : "9999", |
| 14 | "hosts" : { |
| 15 | EOF |
| 16 | |
| 17 | NODES=$( sudo bash -c "source $SETUPDIR/admin-openrc.sh ; nova hypervisor-list" |grep -v ID|grep -v +|awk '{print $4}' ) |
| 18 | |
| 19 | NODECOUNT=0 |
| 20 | for NODE in $NODES; do |
| 21 | ((NODECOUNT++)) |
| 22 | done |
| 23 | |
| 24 | I=0 |
| 25 | for NODE in $NODES; do |
| 26 | echo $NODE |
| 27 | ((I++)) |
| 28 | if [[ "$I" -lt "$NODECOUNT" ]]; then |
| 29 | echo " \"$NODE\" : \"of:0000000000000001/1\"," >> $FN |
| 30 | else |
| 31 | echo " \"$NODE\" : \"of:0000000000000001/1\"" >> $FN |
| 32 | fi |
| 33 | done |
| 34 | |
| 35 | cat >> $FN <<EOF |
| 36 | } |
| 37 | } |
| 38 | EOF |