|
...
|
...
|
@@ -2,6 +2,11 @@
|
|
2
|
2
|
|
|
3
|
3
|
# **stack.sh** is rackspace cloudbuilder's opinionated openstack dev installation.
|
|
4
|
4
|
|
|
|
5
|
+# To keep this script simple we assume you are running on an **Ubuntu 11.04 i
|
|
|
6
|
+# Natty** machine. It should work in a VM or physical server. Additionally we
|
|
|
7
|
+# put the list of *apt* and *pip* dependencies and other configuration files in
|
|
|
8
|
+# this repo. So start by grabbing this script and the dependencies.
|
|
|
9
|
+
|
|
5
|
10
|
# Settings/Options
|
|
6
|
11
|
# ================
|
|
7
|
12
|
|
|
...
|
...
|
@@ -23,6 +28,7 @@ set -o errexit
|
|
23
|
23
|
set -o xtrace
|
|
24
|
24
|
|
|
25
|
25
|
# Warn users who aren't on natty
|
|
|
26
|
+## TODO: alter flow to exit unless the user sets environment FORCE=true
|
|
26
|
27
|
if ! grep -q natty /etc/lsb-release; then
|
|
27
|
28
|
echo "WARNING: this script has only been tested on natty"
|
|
28
|
29
|
fi
|
|
...
|
...
|
@@ -141,15 +147,29 @@ cp $DIR/files/screenrc ~/.screenrc
|
|
141
|
141
|
# TODO: update current user to allow sudo for all commands in files/sudo/*
|
|
142
|
142
|
|
|
143
|
143
|
|
|
|
144
|
+# Mysql
|
|
|
145
|
+# ---------
|
|
|
146
|
+#
|
|
|
147
|
+if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then
|
|
|
148
|
+ # Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases:
|
|
|
149
|
+ sudo mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'%' identified by '$MYSQL_PASS';"
|
|
|
150
|
+
|
|
|
151
|
+ # Edit /etc/mysql/my.cnf to change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0) and restart the mysql service:
|
|
|
152
|
+ sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
|
|
|
153
|
+ sudo service mysql restart
|
|
|
154
|
+fi
|
|
|
155
|
+
|
|
|
156
|
+
|
|
144
|
157
|
# Dashboard
|
|
145
|
158
|
# ---------
|
|
146
|
159
|
#
|
|
147
|
160
|
# Setup the django application to serve via apache/wsgi
|
|
148
|
161
|
|
|
149
|
|
-# Dash currently imports quantum even if you aren't using it. Instead
|
|
150
|
|
-# of installing quantum we can create a simple module that will pass the
|
|
151
|
|
-# initial imports
|
|
152
|
162
|
if [[ "$ENABLED_SERVICES" =~ "dash" ]]; then
|
|
|
163
|
+
|
|
|
164
|
+ # Dash currently imports quantum even if you aren't using it. Instead
|
|
|
165
|
+ # of installing quantum we can create a simple module that will pass the
|
|
|
166
|
+ # initial imports
|
|
153
|
167
|
sudo mkdir -p $DASH_DIR/openstack-dashboard/quantum || true
|
|
154
|
168
|
sudo touch $DASH_DIR/openstack-dashboard/quantum/__init__.py
|
|
155
|
169
|
sudo touch $DASH_DIR/openstack-dashboard/quantum/client.py
|
|
...
|
...
|
@@ -172,22 +192,10 @@ if [[ "$ENABLED_SERVICES" =~ "dash" ]]; then
|
|
172
|
172
|
fi
|
|
173
|
173
|
|
|
174
|
174
|
|
|
175
|
|
-# Mysql
|
|
176
|
|
-# ---------
|
|
177
|
|
-#
|
|
178
|
|
-if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then
|
|
179
|
|
- # Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases:
|
|
180
|
|
- sudo mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'%' identified by '$MYSQL_PASS';"
|
|
181
|
|
-
|
|
182
|
|
- # Edit /etc/mysql/my.cnf to change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0) and restart the mysql service:
|
|
183
|
|
- sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
|
|
184
|
|
- sudo service mysql restart
|
|
185
|
|
-fi
|
|
186
|
|
-
|
|
187
|
|
-
|
|
188
|
175
|
# Munin
|
|
189
|
176
|
# -----
|
|
190
|
177
|
|
|
|
178
|
+# Munin is accessable via apache and was configured in the dashboard section.
|
|
191
|
179
|
|
|
192
|
180
|
if [[ "$ENABLED_SERVICES" =~ "munin" ]]; then
|
|
193
|
181
|
# allow connections from other hosts
|
|
...
|
...
|
@@ -381,3 +389,18 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
|
|
381
|
381
|
glance add name="tty-ramdisk" is_public=true container_format=ari disk_format=ari < ari-tty/image
|
|
382
|
382
|
glance add name="tty" is_public=true container_format=ami disk_format=ami kernel_id=1 ramdisk_id=2 < ami-tty/image
|
|
383
|
383
|
fi
|
|
|
384
|
+
|
|
|
385
|
+# Using the cloud
|
|
|
386
|
+# ===============
|
|
|
387
|
+
|
|
|
388
|
+# If you installed the dashboard on this server, then you should be able
|
|
|
389
|
+# to access the site using your browser.
|
|
|
390
|
+if [[ "$ENABLED_SERVICES" =~ "dash" ]]; then
|
|
|
391
|
+ echo "dashboard is now available at http://$HOST_IP/"
|
|
|
392
|
+fi
|
|
|
393
|
+
|
|
|
394
|
+# If keystone is present, you can point nova cli to this server
|
|
|
395
|
+if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
|
|
|
396
|
+ echo "keystone is serving at http://$HOST_IP:5000/v2.0/"
|
|
|
397
|
+ echo "examples on using novaclient command line is in exercise.sh"
|
|
|
398
|
+fi
|