33# Installs all the packages that a TryStack management node requires
44# and sets up the basic DHCP server, netboot install server and
55# Chef Server
6+ SCRIPTS_DIR=$( cd $( dirname " $0 " ) && pwd)
7+ ROOT_DIR=$( cd $SCRIPTS_DIR /../ && pwd)
8+ VAR_DIR=$( cd $ROOT_DIR /var && pwd)
9+ ETC_DIR=$( cd $ROOT_DIR /etc && pwd)
10+ PRECISE_DOWNLOAD_URI=" http://www.ubuntu.com/start-download?distro=server&bits=64&release=precise"
611
712if [ ! $USER == " root" ]; then
813 echo " Please run this script as root. Exiting."
@@ -18,15 +23,15 @@ if [ -z $ZONE_ID ]; then
1823 ZONE_ID=$1
1924fi
2025
26+ NODE_INFO_FILE=$VAR_DIR /zones/${ZONE_ID,,} .info
27+ if [ ! -f $NODE_INFO_FILE ]; then
28+ echo " Could not locate node info file for zone $ZONE_ID . Expected $NODE_INFO_FILE ."
29+ exit 1
30+ fi
31+
2132# Exit on error to stop unexpected errors
2233set -o errexit
2334
24- SCRIPTS_DIR=$( cd $( dirname " $0 " ) && pwd)
25- ROOT_DIR=$( cd $SCRIPTS_DIR /../ && pwd)
26- VAR_DIR=$( cd $ROOT_DIR /var && pwd)
27- ETC_DIR=$( cd $ROOT_DIR /etc && pwd)
28- PRECISE_DOWNLOAD_URI=" http://www.ubuntu.com/start-download?distro=server&bits=64&release=precise"
29-
3035# Create the images download and mount directories
3136IMAGES_DIR=$ROOT_DIR /images
3237if [[ ! -d $IMAGES_DIR ]]; then
@@ -80,12 +85,6 @@ umount $PRECISE_MNT_PATH
8085# and other things are set up on individual service nodes
8186cobbler profile add --name=service_node --distro=precise-x86_64
8287
83- # In bash ${VAR,,} will lowercase VAR
84- NODE_INFO_FILE=$VAR_DIR /zones/${ZONE_ID,,} .info
85- if [ ! -f $NODE_INFO_FILE ]; then
86- die " Could not locate node info file for zone $ZONE_ID . Expected $NODE_INFO_FILE ."
87- fi
88-
8988# Create a record in Cobbler for each service node in the zone
9089OIFS=$IFS
9190IFS=$' \n '
0 commit comments