labs: split out vm_init_node
Move the initial creation and configuration of a node into a separate function. Follow-up patches give the option to omit a call to this function, which allows osbash to continue work on a node rather than having to recreate it for each run. Change-Id: Id58a5f572de0b6453cf24533b2b4e2337f35803f Implements: blueprint openstack-training-labs
This commit is contained in:
parent
9f9b691bc8
commit
fac92f615e
@ -35,13 +35,9 @@ function _vbox_boot_with_autostart {
|
|||||||
echo >&2 "VM \"$VM\": autostart files executed"
|
echo >&2 "VM \"$VM\": autostart files executed"
|
||||||
}
|
}
|
||||||
|
|
||||||
function vm_build_node {
|
# Create a new node VM and run basic configuration scripts
|
||||||
# XXX Run this function in sub-shell to protect our caller's environment
|
function vm_init_node {
|
||||||
# (which might be _our_ enviroment if we get called again)
|
|
||||||
(
|
|
||||||
|
|
||||||
NODE_NAME=$1
|
NODE_NAME=$1
|
||||||
source "$CONFIG_DIR/config.$NODE_NAME"
|
|
||||||
|
|
||||||
${WBATCH:-:} wbatch_begin_node "$NODE_NAME"
|
${WBATCH:-:} wbatch_begin_node "$NODE_NAME"
|
||||||
|
|
||||||
@ -70,7 +66,17 @@ function vm_build_node {
|
|||||||
# Rename to pass the node name to the script
|
# Rename to pass the node name to the script
|
||||||
autostart_and_rename osbash init_xxx_node.sh "init_${NODE_NAME}_node.sh"
|
autostart_and_rename osbash init_xxx_node.sh "init_${NODE_NAME}_node.sh"
|
||||||
autostart_from_config scripts.nodeinit_osbash
|
autostart_from_config scripts.nodeinit_osbash
|
||||||
|
}
|
||||||
|
|
||||||
|
function vm_build_node {
|
||||||
|
# XXX Run this function in sub-shell to protect our caller's environment
|
||||||
|
# (which might be _our_ enviroment if we get called again)
|
||||||
|
(
|
||||||
|
|
||||||
|
NODE_NAME=$1
|
||||||
|
source "$CONFIG_DIR/config.$NODE_NAME"
|
||||||
|
|
||||||
|
vm_init_node "$NODE_NAME"
|
||||||
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
autostart_reset
|
autostart_reset
|
||||||
autostart_from_config "scripts.$NODE_NAME"
|
autostart_from_config "scripts.$NODE_NAME"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user