mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 11:12:06 +00:00
use shift to filter --reinstall
This commit is contained in:
parent
b07b25789b
commit
94261c5bf1
1 changed files with 6 additions and 6 deletions
12
runrole
12
runrole
|
@ -4,9 +4,13 @@ INVENTORY="ansible_hosts"
|
|||
PLAYBOOK="run-one-role.yml"
|
||||
ARGS=""
|
||||
CWD=`pwd`
|
||||
if [ "$1" == "--reinstall" ]; then
|
||||
ARGS="$ARGS --extra-vars reinstall=True"
|
||||
shift 1
|
||||
fi
|
||||
|
||||
if [ $# -eq 3 ]; then
|
||||
export ANSIBLE_LOG_PATH="$3"
|
||||
if [ $# -eq 2 ]; then
|
||||
export ANSIBLE_LOG_PATH="$2"
|
||||
else
|
||||
export ANSIBLE_LOG_PATH="$CWD/iiab-debug.log"
|
||||
fi
|
||||
|
@ -23,10 +27,6 @@ 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."
|
||||
|
|
Loading…
Reference in a new issue