Add stack phases to extras.d handling
Add hooks to stack.sh, unstack.sh and clean.sh to call the extras.d
scripts at multiple points in stack.sh. This allows these scripts to
perform installation and startup tasks at similar times as they would
if integrated into stack.sh.
extras.d/70-tempest.sh is present as an example of the structure
of these scripts.
See extras.d/README.md for more information.
Change-Id: Ic1fe522559b94d204d6c0319a2e3d23684c8d028
diff --git a/extras.d/80-tempest.sh b/extras.d/80-tempest.sh
index f159955..75b702c 100644
--- a/extras.d/80-tempest.sh
+++ b/extras.d/80-tempest.sh
@@ -1,21 +1,29 @@
# tempest.sh - DevStack extras script
-source $TOP_DIR/lib/tempest
-
-if [[ "$1" == "stack" ]]; then
- # Configure Tempest last to ensure that the runtime configuration of
- # the various OpenStack services can be queried.
- if is_service_enabled tempest; then
- echo_summary "Configuring Tempest"
+if is_service_enabled tempest; then
+ if [[ "$1" == "source" ]]; then
+ # Initial source
+ source $TOP_DIR/lib/tempest
+ elif [[ "$1" == "stack" && "$2" == "install" ]]; then
+ echo_summary "Installing Tempest"
install_tempest
+ elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
+ # Tempest config must come after layer 2 services are running
+ :
+ elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
+ echo_summary "Initializing Tempest"
configure_tempest
init_tempest
fi
-fi
-if [[ "$1" == "unstack" ]]; then
- # no-op
- :
-fi
+ if [[ "$1" == "unstack" ]]; then
+ # no-op
+ :
+ fi
+ if [[ "$1" == "clean" ]]; then
+ # no-op
+ :
+ fi
+fi