| 1 | 1 |
deleted file mode 100755 |
| ... | ... |
@@ -1,55 +0,0 @@ |
| 1 |
-#!/bin/bash |
|
| 2 |
- |
|
| 3 |
-# TODO: make dest not hardcoded |
|
| 4 |
- |
|
| 5 |
-NAME=$1 |
|
| 6 |
-DEST="/nfs/$NAME" |
|
| 7 |
- |
|
| 8 |
-# remove old nfs filesystem if one exists |
|
| 9 |
-rm -rf $DEST |
|
| 10 |
- |
|
| 11 |
-# build a proto image - natty + packages that will install (optimization) |
|
| 12 |
-if [ ! -d proto ]; then |
|
| 13 |
- debootstrap natty proto |
|
| 14 |
- cp files/sources.list proto/etc/apt/sources.list |
|
| 15 |
- chroot proto apt-get update |
|
| 16 |
- chroot proto apt-get install -y `cat apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"` |
|
| 17 |
- chroot proto pip install `cat pips/*` |
|
| 18 |
- git clone https://github.com/cloudbuilders/nova.git proto/opt/nova |
|
| 19 |
- git clone https://github.com/cloudbuilders/openstackx.git proto/opt/openstackx |
|
| 20 |
- git clone https://github.com/cloudbuilders/noVNC.git proto/opt/noVNC |
|
| 21 |
- git clone https://github.com/cloudbuilders/openstack-dashboard.git proto/opt/dash |
|
| 22 |
- git clone https://github.com/cloudbuilders/python-novaclient.git proto/opt/python-novaclient |
|
| 23 |
- git clone https://github.com/cloudbuilders/keystone.git proto/opt/keystone |
|
| 24 |
- git clone https://github.com/cloudbuilders/glance.git proto/opt/glance |
|
| 25 |
- wget -c http://images.ansolabs.com/tty.tgz -O proto/opt/tty.tgz |
|
| 26 |
-fi |
|
| 27 |
- |
|
| 28 |
-cp -pr proto $DEST |
|
| 29 |
- |
|
| 30 |
-# set hostname |
|
| 31 |
-echo $NAME > $DEST/etc/hostname |
|
| 32 |
-echo "127.0.0.1 localhost $NAME" > $DEST/etc/hosts |
|
| 33 |
- |
|
| 34 |
-# copy kernel modules |
|
| 35 |
-cp -pr /lib/modules/`uname -r` $DEST/lib/modules |
|
| 36 |
- |
|
| 37 |
-# inject stack.sh files |
|
| 38 |
-cp -r files $DEST/opt/files |
|
| 39 |
- |
|
| 40 |
-# copy openstack installer and requirement lists to a new directory. |
|
| 41 |
-mkdir -p $DEST/opt |
|
| 42 |
-cp stack.sh $DEST/opt/stack.sh |
|
| 43 |
-cp -r pips $DEST/opt |
|
| 44 |
-cp -r apts $DEST/opt |
|
| 45 |
- |
|
| 46 |
-# injecting root's public ssh key if it exists |
|
| 47 |
-if [ -f /root/.ssh/id_rsa.pub ]; then |
|
| 48 |
- mkdir $DEST/root/.ssh |
|
| 49 |
- chmod 700 $DEST/root/.ssh |
|
| 50 |
- cp /root/.ssh/id_rsa.pub $DEST/root/.ssh/authorized_keys |
|
| 51 |
-fi |
|
| 52 |
- |
|
| 53 |
-# set root password to password |
|
| 54 |
-echo root:password | chroot $DEST chpasswd |
|
| 55 |
- |
| 56 | 1 |
new file mode 100755 |
| ... | ... |
@@ -0,0 +1,55 @@ |
| 0 |
+#!/bin/bash |
|
| 1 |
+ |
|
| 2 |
+# TODO: make dest not hardcoded |
|
| 3 |
+ |
|
| 4 |
+NAME=$1 |
|
| 5 |
+DEST="/nfs/$NAME" |
|
| 6 |
+ |
|
| 7 |
+# remove old nfs filesystem if one exists |
|
| 8 |
+rm -rf $DEST |
|
| 9 |
+ |
|
| 10 |
+# build a proto image - natty + packages that will install (optimization) |
|
| 11 |
+if [ ! -d proto ]; then |
|
| 12 |
+ debootstrap natty proto |
|
| 13 |
+ cp files/sources.list proto/etc/apt/sources.list |
|
| 14 |
+ chroot proto apt-get update |
|
| 15 |
+ chroot proto apt-get install -y `cat apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"` |
|
| 16 |
+ chroot proto pip install `cat pips/*` |
|
| 17 |
+ git clone https://github.com/cloudbuilders/nova.git proto/opt/nova |
|
| 18 |
+ git clone https://github.com/cloudbuilders/openstackx.git proto/opt/openstackx |
|
| 19 |
+ git clone https://github.com/cloudbuilders/noVNC.git proto/opt/noVNC |
|
| 20 |
+ git clone https://github.com/cloudbuilders/openstack-dashboard.git proto/opt/dash |
|
| 21 |
+ git clone https://github.com/cloudbuilders/python-novaclient.git proto/opt/python-novaclient |
|
| 22 |
+ git clone https://github.com/cloudbuilders/keystone.git proto/opt/keystone |
|
| 23 |
+ git clone https://github.com/cloudbuilders/glance.git proto/opt/glance |
|
| 24 |
+ wget -c http://images.ansolabs.com/tty.tgz -O proto/opt/tty.tgz |
|
| 25 |
+fi |
|
| 26 |
+ |
|
| 27 |
+cp -pr proto $DEST |
|
| 28 |
+ |
|
| 29 |
+# set hostname |
|
| 30 |
+echo $NAME > $DEST/etc/hostname |
|
| 31 |
+echo "127.0.0.1 localhost $NAME" > $DEST/etc/hosts |
|
| 32 |
+ |
|
| 33 |
+# copy kernel modules |
|
| 34 |
+cp -pr /lib/modules/`uname -r` $DEST/lib/modules |
|
| 35 |
+ |
|
| 36 |
+# inject stack.sh files |
|
| 37 |
+cp -r files $DEST/opt/files |
|
| 38 |
+ |
|
| 39 |
+# copy openstack installer and requirement lists to a new directory. |
|
| 40 |
+mkdir -p $DEST/opt |
|
| 41 |
+cp stack.sh $DEST/opt/stack.sh |
|
| 42 |
+cp -r pips $DEST/opt |
|
| 43 |
+cp -r apts $DEST/opt |
|
| 44 |
+ |
|
| 45 |
+# injecting root's public ssh key if it exists |
|
| 46 |
+if [ -f /root/.ssh/id_rsa.pub ]; then |
|
| 47 |
+ mkdir $DEST/root/.ssh |
|
| 48 |
+ chmod 700 $DEST/root/.ssh |
|
| 49 |
+ cp /root/.ssh/id_rsa.pub $DEST/root/.ssh/authorized_keys |
|
| 50 |
+fi |
|
| 51 |
+ |
|
| 52 |
+# set root password to password |
|
| 53 |
+echo root:password | chroot $DEST chpasswd |
|
| 54 |
+ |