forked from docc-lab/openstack-build-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-basic.sh
executable file
·70 lines (55 loc) · 1.37 KB
/
setup-basic.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
##
## Initialize some basic useful stuff.
##
set -x
DIRNAME=`dirname $0`
# Gotta know the rules!
if [ $EUID -ne 0 ] ; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Grab our libs
. "$DIRNAME/setup-lib.sh"
if [ "$HOSTNAME" != "$CONTROLLER" ]; then
exit 0;
fi
logtstart "basic"
if [ -f $SETTINGS ]; then
. $SETTINGS
fi
. $OURDIR/admin-openrc.sh
#
# Fork off a bunch of parallelizable tasks, then do some misc stuff,
# then wait.
#
echo "*** Backgrounding quota setup..."
$DIRNAME/setup-basic-quotas.sh >> $OURDIR/setup-basic-quotas.log 2>&1 &
quotaspid=$!
echo "*** Backgrounding network setup..."
$DIRNAME/setup-basic-networks.sh >> $OURDIR/setup-basic-networks.log 2>&1 &
networkspid=$!
echo "*** Backgrounding user setup..."
$DIRNAME/setup-basic-users.sh >> $OURDIR/setup-basic-users.log 2>&1 &
userspid=$!
. $DIRNAME/setup-images-lib.sh
$LOCKFILE $IMAGESETUPLOCKFILE
if [ -f $IMAGEUPLOADCMDFILE ]; then
echo "*** Adding Images ..."
. $OURDIR/admin-openrc.sh
. $IMAGEUPLOADCMDFILE
fi
$RMLOCKFILE $IMAGESETUPLOCKFILE
ARCH=`uname -m`
if [ "$ARCH" = "aarch64" ] ; then
echo "*** Doing aarch64-specific setup..."
$DIRNAME/setup-basic-aarch64.sh
else
echo "*** Doing x86_64-specific setup..."
$DIRNAME/setup-basic-x86_64.sh
fi
for pid in "$quotaspid $networkspid $userspid" ; do
wait $pid
done
logtend "basic"
exit 0