From 92ca8c180d27a2b2008d2b33366769acf2af1937 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Thu, 14 Aug 2014 18:06:10 +0200 Subject: [PATCH] labs: allow building individual nodes So far, osbash can build either a basedisk or a cluster consisting of three nodes (controller, compute, network). With this patch, the user can choose to (re-)build only a single node. For instance, "osbash.sh compute" will build only the compute node while leaving controller and network nodes intact (if they exist). Change-Id: I9c260cb600d7bfcba8f18252d8116c7473a10839 Implements: blueprint openstack-training-labs --- labs/osbash.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/labs/osbash.sh b/labs/osbash.sh index 6ddbd366..cfd6326f 100755 --- a/labs/osbash.sh +++ b/labs/osbash.sh @@ -85,8 +85,10 @@ shift $(( OPTIND - 1 )); # Make sure we have exactly one argument, either basedisk or cluster if [ $# -eq 1 ]; then CMD=$1 - if ! [[ $CMD =~ (basedisk|cluster) ]]; then - usage + if [ "$CMD" = cluster ]; then + nodes="controller compute network" + else + nodes="$CMD" fi else usage @@ -153,9 +155,9 @@ DATA_NET_IF=$(create_network "$DATA_NET") API_NET_IF=$(create_network "$API_NET") #------------------------------------------------------------------------------- source "$OSBASH_LIB_DIR/virtualbox.install_node" -vm_build_node "controller" -vm_build_node "network" -vm_build_node "compute" +for node in $nodes; do + vm_build_node "$node" +done #------------------------------------------------------------------------------- function export_appliance { if [ -n "${EXPORT_OVA:-}" ]; then