1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

runrole can take --reinstall as second arguement

This commit is contained in:
Jerry Vonau 2019-08-10 15:53:56 -05:00
parent 787288405d
commit 6db2df873e

View file

@ -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 <name of role>"
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"