labs: add init_node command
This changeset adds a new init_node command for config/scripts.* and uses it to merge scripts.nodeinit_osbash and scripts.nodeinit_vagrant into the node specific config/scripts.*. This results in some redundancy, but it (hopefully) makes the script configuration easier to follow. It also makes the initial creation and configuration of the VM just another step that can be picked or omitted from script configuration. Implements: blueprint openstack-training-labs Change-Id: Ieadfe2b9540710556100051723e3e6f08855efa3
This commit is contained in:
parent
257c8fd0ca
commit
7e1864c7ba
@ -1,4 +1,13 @@
|
||||
# Scripts for compute node
|
||||
cmd init_node
|
||||
scripts etc_hosts.sh
|
||||
osbash enable_vagrant_ssh_keys.sh
|
||||
#osbash wait_debug.sh
|
||||
# Using scripts/osbash/shutdown.sh because we want Vagrant to ignore this
|
||||
osbash shutdown.sh
|
||||
cmd boot
|
||||
cmd wait_for_shutdown
|
||||
cmd snapshot "network_configured"
|
||||
scripts setup_nova_compute.sh
|
||||
scripts setup_neutron_compute.sh
|
||||
scripts shutdown.sh
|
||||
|
@ -1,4 +1,13 @@
|
||||
# Scripts for controller node
|
||||
cmd init_node
|
||||
scripts etc_hosts.sh
|
||||
osbash enable_vagrant_ssh_keys.sh
|
||||
#osbash wait_debug.sh
|
||||
# Using scripts/osbash/shutdown.sh because we want Vagrant to ignore this
|
||||
osbash shutdown.sh
|
||||
cmd boot
|
||||
cmd wait_for_shutdown
|
||||
cmd snapshot "network_configured"
|
||||
scripts apt_install_mysql.sh
|
||||
scripts install_rabbitmq.sh
|
||||
scripts setup_keystone.sh
|
||||
|
@ -1,4 +1,13 @@
|
||||
# Scripts for network node
|
||||
cmd init_node
|
||||
scripts etc_hosts.sh
|
||||
osbash enable_vagrant_ssh_keys.sh
|
||||
#osbash wait_debug.sh
|
||||
# Using scripts/osbash/shutdown.sh because we want Vagrant to ignore this
|
||||
osbash shutdown.sh
|
||||
cmd boot
|
||||
cmd wait_for_shutdown
|
||||
cmd snapshot "network_configured"
|
||||
scripts setup_neutron_network.sh
|
||||
scripts shutdown.sh
|
||||
cmd boot
|
||||
|
@ -1,8 +0,0 @@
|
||||
# Scripts for all nodes built by osbash
|
||||
scripts etc_hosts.sh
|
||||
osbash enable_vagrant_ssh_keys.sh
|
||||
#osbash wait_debug.sh
|
||||
scripts shutdown.sh
|
||||
cmd boot
|
||||
cmd wait_for_shutdown
|
||||
cmd snapshot "network_configured"
|
@ -1,2 +0,0 @@
|
||||
# Scripts for all nodes built using Vagrant
|
||||
scripts etc_hosts.sh
|
@ -273,6 +273,10 @@ function command_from_config {
|
||||
echo >&2 vm_wait_for_shutdown "$NODE_NAME"
|
||||
vm_wait_for_shutdown "$NODE_NAME"
|
||||
;;
|
||||
init_node)
|
||||
echo >&2 vm_init_node "$NODE_NAME"
|
||||
vm_init_node "$NODE_NAME"
|
||||
;;
|
||||
*)
|
||||
echo >&2 "Error: invalid cmd: $cmd"
|
||||
exit 1
|
||||
|
@ -39,8 +39,6 @@ function _vbox_boot_with_autostart {
|
||||
function vm_init_node {
|
||||
NODE_NAME=$1
|
||||
|
||||
${WBATCH:-:} wbatch_begin_node "$NODE_NAME"
|
||||
|
||||
vm_create "$NODE_NAME"
|
||||
|
||||
# Set VM_MEM in config/config.NODE_NAME to override
|
||||
@ -62,10 +60,8 @@ function vm_init_node {
|
||||
vm_add_share "$NODE_NAME" "$SHARE_DIR" "$SHARE_NAME"
|
||||
vm_attach_disk_multi "$NODE_NAME" "$BASE_DISK"
|
||||
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
autostart_reset
|
||||
# Rename to pass the node name to the script
|
||||
autostart_and_rename osbash init_xxx_node.sh "init_${NODE_NAME}_node.sh"
|
||||
autostart_from_config scripts.nodeinit_osbash
|
||||
}
|
||||
|
||||
function vm_build_node {
|
||||
@ -76,7 +72,7 @@ function vm_build_node {
|
||||
NODE_NAME=$1
|
||||
source "$CONFIG_DIR/config.$NODE_NAME"
|
||||
|
||||
vm_init_node "$NODE_NAME"
|
||||
${WBATCH:-:} wbatch_begin_node "$NODE_NAME"
|
||||
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
autostart_reset
|
||||
autostart_from_config "scripts.$NODE_NAME"
|
||||
|
@ -37,7 +37,7 @@ function vagrant_start_from_config {
|
||||
}
|
||||
|
||||
# The Vagrantfile uses Ubuntu
|
||||
for config_file in "scripts.nodeinit_vagrant" "scripts.ubuntu" "scripts.$HOSTNAME"; do
|
||||
for config_file in "scripts.ubuntu" "scripts.$HOSTNAME"; do
|
||||
echo "Config file $config_file"
|
||||
vagrant_start_from_config "$config_file"
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user