forked from WorksOnArm/OpenStackWorksOnArm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommonServerSetup.sh
60 lines (47 loc) · 1.58 KB
/
CommonServerSetup.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
# General setup - applies to Controller and Compute
# sanity check - make sure we can reach the controller
ping controller -c 5 -q
if [ $? -ne 0 ] ; then
echo "controller is unreachable via ping"
echo "check /etc/hosts and networking"
fi
# private IP addr (10...)
MY_IP=`hostname -I | xargs -n1 | grep "^10\." | head -1`
# disable restart prompts
echo '* libraries/restart-without-asking boolean true' | sudo debconf-set-selections
export DEBIAN_FRONTEND=noninteractive
# general system updates
apt-get -y update
apt-get -y -o Dpkg::Options::='--force-confold' upgrade
apt-get install -y tzdata
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata
# OpenStack needs precise time services
apt-get -y install chrony
service chrony restart
# OpenStack Train for Ubuntu 18.04 LTS
add-apt-repository -y cloud-archive:train
apt-get -y update
# Client for Ubuntu 18.04 LTS
apt-get -y install python3-openstackclient
# easy modification of .ini configuration files
apt-get -y install crudini
cat >> admin-openrc << EOF
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
EOF
cat >> demo-openrc << EOF
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=DEMO_PASS
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
EOF