From 6db2df873e8384329819354def632df2f78527df Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sat, 10 Aug 2019 15:53:56 -0500 Subject: [PATCH] runrole can take --reinstall as second arguement --- runrole | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runrole b/runrole index 4d060c719..6d076b1be 100755 --- a/runrole +++ b/runrole @@ -2,8 +2,9 @@ INVENTORY="ansible_hosts" PLAYBOOK="run-one-role.yml" -#PLAYBOOK="iiab-stages.yml" +ARGS="" CWD=`pwd` + if [ $# -eq 2 ]; then export ANSIBLE_LOG_PATH="$2" else @@ -22,10 +23,14 @@ if [ ! -f /etc/iiab/config_vars.yml ]; then echo "{}" > /etc/iiab/config_vars.yml fi +if [ "$2" == "--reinstall" ]; then + ARGS="$ARGS --extra-vars reinstall=True" +fi + if [[ $# -eq 0 ]] ; then echo " usage: ./runrole " echo " Can only take a single value." exit 0 fi -ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local -e "role_to_run=$1" +ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -e "role_to_run=$1"