-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup-driver.sh
executable file
·51 lines (44 loc) · 1.24 KB
/
setup-driver.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
#!/bin/bash
set -x
# Preserve legacy main logfile location
ln -s /local/logs/setup.log /local/setup/setup-driver.log
ALLNODESCRIPTS="setup-ssh.sh setup-disk-space.sh"
HEADNODESCRIPTS="setup-nfs-server.sh setup-nginx.sh setup-ssl.sh setup-kubespray.sh setup-kubernetes-extra.sh setup-dsb.sh setup-end.sh"
WORKERNODESCRIPTS="setup-nfs-client.sh"
export SRC=`dirname $0`
cd $SRC
. $SRC/setup-lib.sh
chmod +x $SRC/setup-dsb.sh
# Don't run setup-driver.sh twice
if [ -f $OURDIR/setup-driver-done ]; then
echo "setup-driver already ran; not running again"
exit 0
fi
for script in $ALLNODESCRIPTS ; do
cd $SRC
$SRC/$script | tee - /local/logs/${script}.log 2>&1
if [ ! $PIPESTATUS -eq 0 ]; then
echo "ERROR: ${script} failed; aborting driver!"
exit 1
fi
done
if [ "$HOSTNAME" = "node-0" ]; then
for script in $HEADNODESCRIPTS ; do
cd $SRC
$SRC/$script | tee - /local/logs/${script}.log 2>&1
if [ ! $PIPESTATUS -eq 0 ]; then
echo "ERROR: ${script} failed; aborting driver!"
exit 1
fi
done
else
for script in $WORKERNODESCRIPTS ; do
cd $SRC
$SRC/$script | tee - /local/logs/${script}.log 2>&1
if [ ! $PIPESTATUS -eq 0 ]; then
echo "ERROR: ${script} failed; aborting driver!"
exit 1
fi
done
fi
exit 0