Add flag, to be able fail on failed salt.master.env
* In test env's state: salt.master.env install all
required formulas. Sometime, due apt repo issues,
those step may fail.
No sence to continue test w\o failed formula
Change-Id: Ibad580d13dfacf603716436ccd3027b6cd69039d
diff --git a/bootstrap.sh b/bootstrap.sh
index da78964..6a867ec 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -74,6 +74,8 @@
# salt
export MINION_ID=${MINION_ID:-${HOSTNAME}.${DOMAIN}}
export MASTER_HOSTNAME=${MASTER_HOSTNAME:-${HOSTNAME}.${DOMAIN}}
+# Ignore state.apply salt.master.env error
+export SA_IGNORE_ERROR_SALT_MASTER_ENV=${SA_IGNORE_ERROR_SALT_MASTER_ENV:-False}
# saltstack
BOOTSTRAP_SALTSTACK=${BOOTSTRAP_SALTSTACK:-True}
@@ -648,6 +650,10 @@
log_info "State: salt.master.env,salt.master.pillar"
if ! $SUDO salt-call ${SALT_OPTS} state.apply salt.master.env,salt.master.pillar pillar="$PILLAR"; then
log_err "State \`salt.master.env,salt.master.pillar pillar=$PILLAR\` failed, keep your eyes wide open!"
+ if [[ $SA_IGNORE_ERROR_SALT_MASTER_ENV =~ ^(False|false|0|no)$ ]]; then
+ exit 1
+ fi
+
fi
# Revert temporary SaltMaster minimal configuration, if any
@@ -662,6 +668,9 @@
log_info "State: salt.master.env,salt.master.pillar"
if ! $SUDO salt-call ${SALT_OPTS} state.apply salt.master.env,salt.master.pillar pillar="$PILLAR"; then
log_err "State \`salt.master.env,salt.master.pillar pillar=$PILLAR\` failed, keep your eyes wide open!"
+ if [[ $SA_IGNORE_ERROR_SALT_MASTER_ENV =~ ^(False|false|0|no)$ ]]; then
+ exit 1
+ fi
fi
fi
popd