Move pre, postinstall, scenario, and apps to stack
Preinstall, postinstall, scenario, and apps are specific
to stack composition and more appropriate to locate them
within the stacks themselves rather than the installers.
This makes it possible for different stacks to configure
target deployment according to their needs and use the
installer without thinking about potential effects the
changes could cause on other stacks that may be using the
same installer.
An example to this is Kubernetes and ONAP stacks and the
CEPH configuration. Both stacks use Kubespray but the
configuration of Kubernetes differs between them. By moving
the pre/post/scenario/app configuration into stacks
themselves, they become independent from each other as
much as possible.
Please note that this change depends on the corresponding
change sent for Kubernetes stack. Once that gets verified,
reviewed, and submitted, this change needs to be reverified,
reviewed and submitted in order to conclude the transition.
https://gerrit.nordix.org/c/infra/stack/kubernetes/+/5158
Change-Id: I571f1b5b5ee3d9e259c015346f9ea85cf5808d69
diff --git a/install.sh b/install.sh
index b5d9f2f..d38b4c2 100755
--- a/install.sh
+++ b/install.sh
@@ -21,7 +21,11 @@
set -o nounset
set -o pipefail
+#-------------------------------------------------------------------------------
+# Find and set where we are
+#-------------------------------------------------------------------------------
INSTALLER_ROOT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
+
export ANSIBLE_ROLES_PATH="$HOME/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:${ENGINE_PATH}/engine/playbooks/roles:${ENGINE_CACHE}/repos/bifrost/playbooks/roles"
export ANSIBLE_LIBRARY="$HOME/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:${ENGINE_CACHE}/repos/bifrost/playbooks/library"
@@ -45,17 +49,17 @@
# run scenario pre-deployment tasks
echo "-------------------------------------------------------------------------"
-echo "Info : Execute scenario preinstall tasks"
+echo "Info : Execute stack preinstall tasks"
echo "-------------------------------------------------------------------------"
cd "${ENGINE_PATH}"
ansible-playbook "${ENGINE_ANSIBLE_PARAMS[@]}" \
-i "${ENGINE_PATH}/engine/inventory/inventory.ini" \
--tags preinstall \
- "${INSTALLER_ROOT_DIR}/playbooks/scenarios/${DEPLOY_SCENARIO}.yaml"
+ "${STACK_ROOT_DIR}/scenarios/${DEPLOY_SCENARIO}.yaml"
-# install scenario
+# install stack
echo "-------------------------------------------------------------------------"
-echo "Info : Install scenario ${DEPLOY_SCENARIO}"
+echo "Info : Install stack ${STACK_TYPE} with scenario ${DEPLOY_SCENARIO}"
echo "-------------------------------------------------------------------------"
cd "${ENGINE_CACHE}/repos/kubespray"
ansible-playbook "${ENGINE_ANSIBLE_PARAMS[@]}" \
@@ -66,12 +70,12 @@
# run scenario post-deployment tasks
echo "-------------------------------------------------------------------------"
-echo "Info : Execute scenario postinstall tasks"
+echo "Info : Execute stack postinstall tasks"
echo "-------------------------------------------------------------------------"
cd "${ENGINE_PATH}"
ansible-playbook "${ENGINE_ANSIBLE_PARAMS[@]}" \
-i "${ENGINE_PATH}/engine/inventory/inventory.ini" \
--tags postinstall \
- "${INSTALLER_ROOT_DIR}/playbooks/scenarios/${DEPLOY_SCENARIO}.yaml"
+ "${STACK_ROOT_DIR}/scenarios/${DEPLOY_SCENARIO}.yaml"
# vim: set ts=2 sw=2 expandtab: