blob: 5fcfe177707d91c55bdb36acae6ccc6866fa7821 [file] [log] [blame]
Jesse Andrewsba23cc72011-09-11 03:22:13 -07001#!/bin/bash
2
3# TODO: make dest not hardcoded
4
5NAME=$1
Jesse Andrews1639ed62011-09-11 15:42:17 -07006DEST="/nfs/$NAME"
Jesse Andrewsba23cc72011-09-11 03:22:13 -07007
8# remove old nfs filesystem if one exists
9rm -rf $DEST
10
11# build a proto image - natty + packages that will install (optimization)
12if [ ! -d nfs ]; then
Jesse Andrews1639ed62011-09-11 15:42:17 -070013 debootstrap natty proto
14 cp 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)"`
17 chroot proto pip install `cat pips/* | cut -d\# -f1`
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
Jesse Andrewsba23cc72011-09-11 03:22:13 -070025fi
26
Jesse Andrews1639ed62011-09-11 15:42:17 -070027cp -pr proto $DEST
Jesse Andrewsba23cc72011-09-11 03:22:13 -070028
29# set hostname
30echo $NAME > $DEST/etc/hostname
31echo "127.0.0.1 localhost $NAME" > $DEST/etc/hosts
32
33# copy kernel modules
34cp -pr /lib/modules/`uname -r` $DEST/lib/modules
35
36# copy openstack installer and requirement lists to a new directory.
37mkdir -p $DEST/opt
38cp stack.sh $DEST/opt/stack.sh
39cp -r pips $DEST/opt
40cp -r apts $DEST/opt
41
42# injecting root's ssh key
43# FIXME: only do this if id_rsa.pub exists
44mkdir $DEST/root/.ssh
45chmod 700 $DEST/root/.ssh
46cp /root/.ssh/id_rsa.pub $DEST/root/.ssh/authorized_keys
47
48# set root password to password
49echo root:password | chroot $DEST chpasswd
50