Commit 0e98185b authored by David Johnson's avatar David Johnson

Add a very simple extension mechanism.

User has to include a tarball containing a single dir which in turn
contains a script called setup.sh .  This tarball must be installed into
/tmp/setup/ext .  Minimal, but who cares, it works for now.
parent cce18e42
......@@ -2604,6 +2604,24 @@ if [ -e $OURDIR/random_admin_pass ]; then
RANDPASSSTRING="We generated a random OpenStack admin and instance VM password for you, since one wasn't supplied. The password is '${ADMIN_PASS}'"
fi
EXTDIRS=`find $DIRNAME/ext -maxdepth 1 -type d | grep -v ^\.\$ | grep -v $DIRNAME/ext\$ | xargs`
if [ ! -z "$EXTDIRS" ]; then
echo "***"
echo "*** ALMOST Done with OpenStack Setup -- running extension setup scripts $EXTDIRS !"
echo "***"
echo "*** Login to your shiny new cloud at "
echo " http://$CONTROLLER.$EEID.$EPID.${OURDOMAIN}/horizon/auth/login/?next=/horizon/project/instances/ ! ${RANDPASSSTRING}"
echo "***"
echo "Your OpenStack instance has almost completed setup -- running your extension setup scripts now ($EXTDIRS)! Browse to http://$CONTROLLER.$EEID.$EPID.${OURDOMAIN}/horizon/auth/login/?next=/horizon/project/instances/ . ${RANDPASSSTRING}" \
| mail -s "OpenStack Instance ALMOST Finished Setting Up" ${SWAPPER_EMAIL}
for dir in $EXTDIRS ; do
dirbase=`basename $dir`
$DIRNAME/ext/$dirbase/setup.sh 1> $OURDIR/setup-ext-$dirbase.log 2>&1 </dev/null
done
fi
echo "***"
echo "*** Done with OpenStack Setup!"
echo "***"
......@@ -2611,8 +2629,6 @@ echo "*** Login to your shiny new cloud at "
echo " http://$CONTROLLER.$EEID.$EPID.${OURDOMAIN}/horizon/auth/login/?next=/horizon/project/instances/ ! ${RANDPASSSTRING}"
echo "***"
echo "Your OpenStack instance has completed setup! Browse to http://$CONTROLLER.$EEID.$EPID.${OURDOMAIN}/horizon/auth/login/?next=/horizon/project/instances/ . ${RANDPASSSTRING}" \
| mail -s "OpenStack Instance Finished Setting Up" ${SWAPPER_EMAIL}
......
......@@ -43,6 +43,7 @@ DATATUNNELS=1
DATAFLATLANS="lan-1"
DATAVLANS=""
DATAVXLANS=0
DATAOTHERLANS=""
USE_EXISTING_IPS=1
DO_APT_INSTALL=1
DO_APT_UPGRADE=0
......@@ -616,7 +617,7 @@ if [ ! -f $OURDIR/mgmt-hosts -o $UPDATING -ne 0 ] ; then
# flat networks.
#
if [ ${USE_EXISTING_IPS} -eq 0 ]; then
for lan in $DATAFLATLANS $DATAVLANS; do
for lan in $DATAFLATLANS $DATAVLANS $DATAOTHERLANS ; do
if [ $UPDATING -eq 0 ]; then
prefix="10.$NEXTSPARESUBNET"
echo "$prefix" > $OURDIR/data-prefix.$lan
......@@ -692,7 +693,7 @@ if [ ! -f $OURDIR/mgmt-hosts -o $UPDATING -ne 0 ] ; then
fi
done
else
for lan in $DATAFLATLANS ; do
for lan in $DATAFLATLANS $DATAOTHERLANS ; do
cat $TOPOMAP | grep -v '^#' | sed -e 's/,/ /' \
| sed -n -e "s/\([a-zA-Z0-9_\-]*\) .*${lan}:\([0-9\.]*\).*\$/\2\t\1/p" \
> $OURDIR/data-hosts.$lan
......@@ -884,7 +885,7 @@ fi
# NB: this IP/mask is only valid after data ips have been assigned, because
# they might not be the Emulab ones.
#
for lan in $DATAFLATLANS ; do
for lan in $DATAFLATLANS $DATAOTHERLANS ; do
if [ -e $OURDIR/info.$lan ] ; then
continue
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment