diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 2fb2004d71..a39d025197 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -34,6 +34,7 @@ GITDIR["python-ironicclient"]=$DEST/python-ironicclient GITDIR["ironic-lib"]=$DEST/ironic-lib IRONIC_DIR=$DEST/ironic +IRONIC_DEVSTACK_DIR=$IRONIC_DIR/devstack IRONIC_PYTHON_AGENT_DIR=$DEST/ironic-python-agent IRONIC_DATA_DIR=$DATA_DIR/ironic IRONIC_STATE_PATH=/var/lib/ironic @@ -60,8 +61,8 @@ IRONIC_IPMIINFO_FILE=${IRONIC_IPMIINFO_FILE:-$IRONIC_DATA_DIR/hardware_info} # Set up defaults for functional / integration testing IRONIC_NODE_UUID=${IRONIC_NODE_UUID:-`uuidgen`} -IRONIC_SCRIPTS_DIR=${IRONIC_SCRIPTS_DIR:-$TOP_DIR/tools/ironic/scripts} -IRONIC_TEMPLATES_DIR=${IRONIC_TEMPLATES_DIR:-$TOP_DIR/tools/ironic/templates} +IRONIC_SCRIPTS_DIR=${IRONIC_SCRIPTS_DIR:-$IRONIC_DEVSTACK_DIR/tools/ironic/scripts} +IRONIC_TEMPLATES_DIR=${IRONIC_TEMPLATES_DIR:-$IRONIC_DEVSTACK_DIR/tools/ironic/templates} IRONIC_BAREMETAL_BASIC_OPS=$(trueorfalse False IRONIC_BAREMETAL_BASIC_OPS) IRONIC_ENABLED_DRIVERS=${IRONIC_ENABLED_DRIVERS:-fake,pxe_ssh,pxe_ipmitool} IRONIC_SSH_USERNAME=${IRONIC_SSH_USERNAME:-`whoami`} @@ -177,7 +178,7 @@ function is_deployed_with_ipa_ramdisk { return 1 } -# install_ironic() - Collect source and prepare +# install_ironic() - Install the things! function install_ironic { # make sure all needed service were enabled local req_services="key" @@ -195,7 +196,6 @@ function install_ironic { setup_dev_lib "ironic-lib" fi - git_clone $IRONIC_REPO $IRONIC_DIR $IRONIC_BRANCH setup_develop $IRONIC_DIR if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then diff --git a/devstack/override-defaults b/devstack/override-defaults new file mode 100755 index 0000000000..b312171c5b --- /dev/null +++ b/devstack/override-defaults @@ -0,0 +1,5 @@ +#!/bin/bash + +# NOTE(jroll) this is used for the transition to a devstack plugin in +# the ironic tree, and can be removed when the transition is complete. +IRONIC_USING_PLUGIN=True diff --git a/devstack/plugin.sh b/devstack/plugin.sh new file mode 100644 index 0000000000..fc2fd9734d --- /dev/null +++ b/devstack/plugin.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# plugin.sh - devstack plugin for ironic + +echo_summary "ironic's plugin.sh was called..." +source $DEST/ironic/devstack/lib/ironic + +if is_service_enabled ir-api ir-cond; then + if [[ "$1" == "stack" && "$2" == "install" ]]; then + echo_summary "Installing Ironic" + install_ironic + install_ironicclient + cleanup_ironic + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + echo_summary "Configuring Ironic" + configure_ironic + + if is_service_enabled key; then + create_ironic_accounts + fi + + elif [[ "$1" == "stack" && "$2" == "extra" ]]; then + # Initialize ironic + init_ironic + + # Start the ironic API and ironic taskmgr components + echo_summary "Starting Ironic" + start_ironic + + if [[ "$IRONIC_BAREMETAL_BASIC_OPS" = "True" ]]; then + prepare_baremetal_basic_ops + fi + fi + + if [[ "$1" == "unstack" ]]; then + stop_ironic + if [[ "$IRONIC_BAREMETAL_BASIC_OPS" = "True" ]]; then + cleanup_baremetal_basic_ops + fi + fi + + if [[ "$1" == "clean" ]]; then + cleanup_ironic + fi +fi diff --git a/devstack/settings b/devstack/settings new file mode 100644 index 0000000000..3dacb442c6 --- /dev/null +++ b/devstack/settings @@ -0,0 +1 @@ +enable_service ironic ir-api ir-cond