pre-cache git repos, add mysql perms

This commit is contained in:
Anthony Young 2011-09-14 02:33:43 -07:00
parent 005abf03c7
commit 3859f73760
2 changed files with 12 additions and 2 deletions

View file

@ -51,12 +51,19 @@ fi
# Warm the base image on first install
CACHEDIR=/var/cache/lxc/natty/rootfs-amd64
if [ ! -d $CACHEDIR ]; then
if [ -d $CACHEDIR ]; then
# trigger the initial debootstrap
lxc-create -n $CONTAINER -t natty -f $LXC_CONF
chroot $CACHEDIR apt-get update
chroot $CACHEDIR apt-get install -y `cat apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"`
chroot $CACHEDIR pip install `cat pips/*`
git clone https://github.com/cloudbuilders/nova.git $CACHEDIR/opt/nova
git clone https://github.com/cloudbuilders/openstackx.git $CACHEDIR/opt/openstackx
git clone https://github.com/cloudbuilders/noVNC.git $CACHEDIR/opt/noVNC
git clone https://github.com/cloudbuilders/openstack-dashboard.git $CACHEDIR/opt/dash
git clone https://github.com/cloudbuilders/python-novaclient.git $CACHEDIR/opt/python-novaclient
git clone https://github.com/cloudbuilders/keystone.git $CACHEDIR/opt/keystone
git clone https://github.com/cloudbuilders/glance.git $CACHEDIR/opt/glance
fi
# Destroy the old container

View file

@ -60,7 +60,7 @@ EC2_DMZ_HOST=${EC2_DMZ_HOST:-$HOST_IP}
LIBVIRT_TYPE=${LIBVIRT_TYPE:-qemu}
# Mysql connection info
MYSQL_USER=${MYSQL_USER:-root}
MYSQL_USER=${MYSQL_USER:-nova}
MYSQL_PASS=${MYSQL_PASS:-nova}
MYSQL_HOST=${MYSQL_HOST:-localhost}
# don't specify /db in this string, so we can use it for multiple services
@ -168,6 +168,9 @@ sudo sed -e "s,%DASH_DIR%,$DASH_DIR,g" -i /etc/apache2/sites-enabled/000-default
# dashboard can run
sudo chown -R www-data:www-data $DASH_DIR
# Update the DB to give user $MYSQL_USER@% full control of the all databases:
sudo mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'%' WITH GRANT OPTION;"
# 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:
sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
sudo service mysql restart