From 0eb9ccab3a3e515e25797343609b5bf511f1cd75 Mon Sep 17 00:00:00 2001 From: Damian Dabrowski Date: Sun, 4 Jun 2023 16:43:32 +0200 Subject: [PATCH] Allow to pass BOOTSTRAP_EXTRA_PARAMS to bootstrap-aio.yml This patch allows to pass custom parameters to the bootstrap-aio.yml playbook by the `BOOTSTRAP_EXTRA_PARAMS` variable. With `BOOTSTRAP_OPTS` it was only possible to set extra variables. As an exmaple, `BOOTSTRAP_EXTRA_PARAMS` can be used to define custom set of tags that should be executed. Change-Id: Ie53b51f4e4d5ccbd0e7ff638a9d5bce236a561bd --- scripts/bootstrap-aio.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/bootstrap-aio.sh b/scripts/bootstrap-aio.sh index 1fb1aea315..5a45dcefea 100755 --- a/scripts/bootstrap-aio.sh +++ b/scripts/bootstrap-aio.sh @@ -46,16 +46,13 @@ export GROUP_VARS_PATH="/dev/null" # Run AIO bootstrap playbook pushd tests - if [ -z "${BOOTSTRAP_OPTS}" ]; then - /usr/local/bin/ansible-playbook bootstrap-aio.yml - else - export BOOTSTRAP_OPTS_ITEMS='' - for BOOTSTRAP_OPT in ${BOOTSTRAP_OPTS}; do - BOOTSTRAP_OPTS_ITEMS=${BOOTSTRAP_OPTS_ITEMS}"-e "${BOOTSTRAP_OPT}" " - done - /usr/local/bin/ansible-playbook bootstrap-aio.yml \ - ${BOOTSTRAP_OPTS_ITEMS} - fi +export BOOTSTRAP_OPTS_ITEMS='' +for BOOTSTRAP_OPT in ${BOOTSTRAP_OPTS}; do + BOOTSTRAP_OPTS_ITEMS=${BOOTSTRAP_OPTS_ITEMS}"-e "${BOOTSTRAP_OPT}" " +done +/usr/local/bin/ansible-playbook bootstrap-aio.yml \ + ${BOOTSTRAP_OPTS_ITEMS} \ + ${BOOTSTRAP_EXTRA_PARAMS:-} popd # Now unset the env var overrides so that the defaults work again