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:
parent
787288405d
commit
6db2df873e
1 changed files with 7 additions and 2 deletions
9
runrole
9
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 <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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue