Files to automate devstack installation added.

This commit is contained in:
Dmitry Teselkin 2013-03-01 15:33:53 +04:00
parent c5a66bbac5
commit e885dd10f6
3 changed files with 115 additions and 0 deletions

View File

@ -0,0 +1,30 @@
lab_id=102
lab_password=swordfish
#--------------------------------------
HOST_IP=172.18.124.${lab_id}
FIXED_RANGE=10.0.${lab_id}.0/24
NETWORK_GATEWAY=10.0.${lab_id}.1
FLAT_INTERFACE=eth1
PUBLIC_INTERFACE=eth0
ADMIN_PASSWORD=$lab_password
MYSQL_PASSWORD=$lab_password
RABBIT_PASSWORD=$lab_password
SERVICE_PASSWORD=$lab_password
SERVICE_TOKEN=tokentoken
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
LOGFILE=/opt/stack/devstack/stack.sh.log
SCREEN_LOGDIR=/var/log/devstack
#SCREEN_LOGDIR=/dev/null
EXTRA_OPTS=(force_config_drive=true)

View File

@ -0,0 +1,57 @@
#!/bin/bash
source openrc admin admin
if [ -z "$(sudo rabbitmqctl list_users | grep keero)" ] ; then
echo "Adding RabbitMQ 'keero' user"
sudo rabbitmqctl add_user keero keero
else
echo "User 'Keero' already exists."
fi
if [ -z "$(sudo rabbitmq-plugins list -e | grep rabbitmq_management)" ] ; then
echo "Enabling RabbitMQ management plugin"
sudo rabbitmq-plugins enable rabbitmq_management
else
echo "RabbitMQ management plugin already enabled."
fi
echo "Restarting RabbitMQ ..."
sudo service rabbitmq-server restart
echo "* Removing nova flavors ..."
for id in $(nova flavor-list | awk '$2 ~ /[[:digit:]]/ {print $2}') ; do
echo "** Removing flavor '$id'"
nova flavor-delete $id
done
echo "* Creating new flavors ..."
nova flavor-create m1.small auto 2048 40 1
nova flavor-create m1.medium auto 4096 60 2
nova flavor-create m1.large auto 8192 80 4
if [ -z "$(nova keypair-list | grep keero_key)" ] ; then
echo "Creating keypair 'keero_key' ..."
nova keypair-add keero_key
else
echo "Keypair 'keero_key' already exists"
fi
echo "Removing existing image"
glance image-delete ws-2012-full-agent
echo "* Importing image into glance ..."
glance image-create \
--name ws-2012-full-agent \
--disk-format qcow2 \
--container-format ovf \
--is-public true \
--location http://172.18.124.100:8888/ws-2012-full-agent.qcow2
# --file /opt/keero/iso/ws-2012-full-agent.qcow2

View File

@ -0,0 +1,28 @@
#!/bin/bash
source openrc admin admin
if [ -z "$TOP_DIR" ] ; then
echo "Environment variable TOP_DIR is not set."
exit
fi
echo "Devstack installed in '$TOP_DIR'"
#Remove certificates
echo "* Removing certificate files ..."
for file in $(sudo find $TOP_DIR/accrc/ -type f -regex ".+.pem.*") ; do
echo "Removing file '$file'"
sudo rm -f "$file"
done
# Remove logs
echo "* Removing 'devstack' logs ..."
sudo rm -f /var/log/devstack/*
echo "* Removing 'apache2' logs ..."
for file in $(sudo find /var/log/apache2 -type f) ; do
echo "Removing file '$file'"
sudo rm -f "$file"
done