forked from docc-lab/openstack-build-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-ovs.sh
executable file
·52 lines (38 loc) · 1.15 KB
/
setup-ovs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
#
# For a neutron setup, we have to move the external interface into
# br-ex, and copy its config to br-ex; move the data lan (ethX) into br-int,
# and copy its config to br-int . For now, we assume the default route of
# the machine is associated with eth0/br-ex .
#
set -x
# Gotta know the rules!
if [ $EUID -ne 0 ] ; then
echo "This script must be run as root" 1>&2
exit 1
fi
DIRNAME=`dirname $0`
# Grab our libs
. "$DIRNAME/setup-lib.sh"
if [ "$HOSTNAME" != "$NETWORKMANAGER" ]; then
exit 0;
fi
logtstart "ovs"
maybe_install_packages pssh
PSSH='/usr/bin/parallel-ssh -t 0 -O StrictHostKeyChecking=no '
PHOSTS=""
mkdir -p $OURDIR/pssh.setup-ovs-node.stdout $OURDIR/pssh.setup-ovs-node.stderr
# Do the network manager node first, no ssh
echo "*** Setting up OpenVSwitch on $HOSTNAME"
$DIRNAME/setup-ovs-node.sh
for node in $NODES
do
[ "$node" = "$NETWORKMANAGER" ] && continue
fqdn=`getfqdn $node`
PHOSTS="$PHOSTS -H $fqdn"
done
echo "*** Setting up OpenVSwitch via pssh: $PHOSTS"
$PSSH -o $OURDIR/pssh.setup-ovs-node.stdout -e $OURDIR/pssh.setup-ovs-node.stderr \
$PHOSTS $DIRNAME/setup-ovs-node.sh
logtend "ovs"
exit 0