Skip to content
Snippets Groups Projects
Commit 562a732e authored by Kamil Andoniadis's avatar Kamil Andoniadis Committed by Daniel Tovarňák
Browse files

Resolve "Networking Ansible Stage doesn't fail when it cannot access the remote repository"

parent ff575e40
No related branches found
No related tags found
No related merge requests found
...@@ -49,22 +49,27 @@ if [ $? != 0 ]; then ...@@ -49,22 +49,27 @@ if [ $? != 0 ]; then
exit 1 exit 1
fi fi
git clone $REPO_URL ansible_repo git clone $REPO_URL ansible_repo || exit 1
cd ansible_repo cd ansible_repo || exit 1
if [ $REVISION ]; then if [ $REVISION ]; then
git checkout $REVISION || exit 1 git checkout $REVISION || exit 1
fi fi
git submodule update --init --recursive git submodule update --init --recursive || exit 1
cd provisioning || exit 1 cd provisioning || exit 1
REQUIREMENTS_FILE="requirements.yml" REQUIREMENTS_FILE="requirements.yml"
if [ -f $REQUIREMENTS_FILE ]; then if [ -f $REQUIREMENTS_FILE ]; then
ansible-galaxy install -r $REQUIREMENTS_FILE -p roles ansible-galaxy install -r $REQUIREMENTS_FILE -p roles || exit 1
fi fi
PRE_PLAYBOOK_FILE="pre-playbook.yml" PRE_PLAYBOOK_FILE="pre-playbook.yml"
if [ -f $PRE_PLAYBOOK_FILE ]; then if [ -f $PRE_PLAYBOOK_FILE ]; then
ansible-playbook $PRE_PLAYBOOK_FILE -i "${INVENTORY_FILE}" -vv ansible-playbook $PRE_PLAYBOOK_FILE -i "${INVENTORY_FILE}" -vv
ANSIBLE_ERROR=$?
if [ "$ANSIBLE_ERROR" != 0 ]
then
exit $ANSIBLE_ERROR
fi
fi fi
PLAYBOOK_FILE="playbook.yml" PLAYBOOK_FILE="playbook.yml"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment