Skip to content
Snippets Groups Projects
Commit 897a6d60 authored by Juraj Paluba's avatar Juraj Paluba
Browse files

Merge branch '17-add-option-to-signalize-user-ansible-cleanup-stage' into 'master'

Resolve: "add option to signalize user ansible cleanup stage"

Closes #17

See merge request muni-kypo-crp/backend-python/kypo-ansible-runner!19
parents d3b8ef0d 91006dff
No related branches found
No related tags found
No related merge requests found
...@@ -2,12 +2,15 @@ ...@@ -2,12 +2,15 @@
usage() { echo "kypo-ansible-runner.sh -r [git repo url] -i [inventory file path]"; } usage() { echo "kypo-ansible-runner.sh -r [git repo url] -i [inventory file path]"; }
while getopts ":u:r:i:a:h" opt; do USER_CLEANUP=false
while getopts ":u:r:i:a:hc" opt; do
case ${opt} in case ${opt} in
u) REPO_URL=$OPTARG ;; u) REPO_URL=$OPTARG ;;
r) REVISION=$OPTARG ;; r) REVISION=$OPTARG ;;
i) INVENTORY=$OPTARG ;; # realpath -e on some systems i) INVENTORY=$OPTARG ;; # realpath -e on some systems
a) ANSWERS_STORAGE_API=$OPTARG ;; a) ANSWERS_STORAGE_API=$OPTARG ;;
c) USER_CLEANUP=true ;;
h) h)
usage usage
exit exit
...@@ -86,4 +89,6 @@ if [ -f $PRE_PLAYBOOK_FILE ]; then ...@@ -86,4 +89,6 @@ if [ -f $PRE_PLAYBOOK_FILE ]; then
fi fi
PLAYBOOK_FILE="playbook.yml" PLAYBOOK_FILE="playbook.yml"
if ! $USER_CLEANUP; then
ansible-playbook $PLAYBOOK_FILE -i "${INVENTORY_FILE}" -e "@$ANSWERS_FILE" -vv || exit "$?" ansible-playbook $PLAYBOOK_FILE -i "${INVENTORY_FILE}" -e "@$ANSWERS_FILE" -vv || exit "$?"
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment