From 5c3a63e6337961497ec3d29c409d64301108a2e3 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 9 Jul 2014 11:27:42 -0500 Subject: [PATCH] Add pre-install phase for extras.d plugins An additional call hook for the extras.d plugins that is called before any service installation occurs turns out to be needed by Ceph and useful for other plugins. This is called between the installation of the system packages listed as prerequisites and the installation of the actual services. Change-Id: Id723bdc7542182d2b2eff40c0dc0127307f094c5 --- extras.d/README.md | 17 ++++++++++++++++- stack.sh | 12 ++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/extras.d/README.md b/extras.d/README.md index 1dd17da2d6..7c2e4fe970 100644 --- a/extras.d/README.md +++ b/extras.d/README.md @@ -22,9 +22,24 @@ sourced with one or more arguments, the first of which defines the hook phase: stack: called by stack.sh. There are four possible values for the second arg to distinguish the phase stack.sh is in: - arg 2: install | post-config | extra | post-extra + arg 2: pre-install | install | post-config | extra unstack: called by unstack.sh clean: called by clean.sh. Remember, clean.sh also calls unstack.sh so that work need not be repeated. + +The `stack` phase sub-phases are called from `stack.sh` in the following places: + + pre-install - After all system prerequisites have been installed but before any + DevStack-specific services are installed (including database and rpc). + + install - After all OpenStack services have been installed and configured + but before any OpenStack services have been started. Changes to OpenStack + service configurations should be done here. + + post-config - After OpenStack services have been initialized but still before + they have been started. (This is probably mis-named, think of it as post-init.) + + extra - After everything is started. + diff --git a/stack.sh b/stack.sh index f3d8d449f6..d095063290 100755 --- a/stack.sh +++ b/stack.sh @@ -668,6 +668,18 @@ fi # Do the ugly hacks for borken packages and distros $TOP_DIR/tools/fixup_stuff.sh + +# Extras Pre-install +# ------------------ + +# Phase: pre-install +if [[ -d $TOP_DIR/extras.d ]]; then + for i in $TOP_DIR/extras.d/*.sh; do + [[ -r $i ]] && source $i stack pre-install + done +fi + + install_rpc_backend if is_service_enabled $DATABASE_BACKENDS; then