mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 11:12:06 +00:00
Try 'skip_role_on_error: True' in default_vars
This commit is contained in:
parent
bd62849584
commit
2d6943e966
3 changed files with 11 additions and 7 deletions
|
@ -6,7 +6,7 @@
|
|||
PLAYBOOK=iiab-stages.yml
|
||||
INVENTORY=ansible_hosts
|
||||
IIAB_STATE_FILE=/etc/iiab/iiab_state.yml
|
||||
ARGS=""
|
||||
ARGS="--extra-vars {\"skip_role_on_error\":False" # bash forces {...} to '{...}' for Ansible
|
||||
CWD=`pwd`
|
||||
OS=`grep ^ID= /etc/os-release | cut -d= -f2`
|
||||
OS=${OS//\"/}
|
||||
|
@ -127,7 +127,8 @@ if [ -f /etc/iiab/iiab.env ]; then
|
|||
|
||||
if [ "$1" == "--reinstall" ]; then
|
||||
STAGE=0
|
||||
ARGS="$ARGS"" --extra-vars reinstall=True"
|
||||
#ARGS="$ARGS"" --extra-vars reinstall=True"
|
||||
ARGS="$ARGS,\"reinstall\":True" # Needs boolean not string so use JSON list
|
||||
sed -i 's/^STAGE=.*/STAGE=0/' /etc/iiab/iiab.env
|
||||
echo "Wrote STAGE=0 (counter) to /etc/iiab/iiab.env"
|
||||
elif [ "$STAGE" -ge 2 ] && [ "$1" == "--debug" ]; then
|
||||
|
@ -168,6 +169,8 @@ export ANSIBLE_LOG_PATH="$CWD""/iiab-install.log"
|
|||
|
||||
ansible -m setup -i $INVENTORY localhost --connection=local | grep python
|
||||
ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null # So vars are recorded in /opt/iiab/iiab/iiab-install.log
|
||||
ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local
|
||||
ARGS="$ARGS}"
|
||||
echo -e "\nNOW RUN: ansible-playbook -i $INVENTORY $PLAYBOOK $ARGS --connection=local\n"
|
||||
ansible-playbook -i $INVENTORY $PLAYBOOK $ARGS --connection=local
|
||||
|
||||
echo -e "./iiab-install $* COMPLETED IN $CWD\n\n"
|
||||
|
|
5
runrole
5
runrole
|
@ -8,7 +8,8 @@ INSTALL=false
|
|||
ENABLED=false
|
||||
REINSTALL=false
|
||||
CWD=`pwd`
|
||||
ARGS="--extra-vars {" # bash forces {...} to '{...}' for Ansible, SEE BOTTOM
|
||||
#ARGS="--extra-vars {"
|
||||
ARGS="--extra-vars {\"skip_role_on_error\":False," # bash forces {...} to '{...}' for Ansible, SEE BOTTOM (IFS-like issue)
|
||||
INVENTORY=ansible_hosts
|
||||
PLAYBOOK=run-one-role.yml
|
||||
|
||||
|
@ -110,7 +111,7 @@ else
|
|||
export ANSIBLE_LOG_PATH="$CWD/iiab-debug.log"
|
||||
fi
|
||||
|
||||
ARGS="$ARGS\"role_to_run\":\"$1\"}" # $1 works like \"$1\" if str validated
|
||||
ARGS="$ARGS\"role_to_run\":\"$1\"}" # $1 works like \"$1\" if str type validated
|
||||
CMD="ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local $ARGS"
|
||||
echo -e "\e[1mbash will now run this, adding single quotes around the {...} curly braces:\e[0m\n\n$CMD\n"
|
||||
ansible -m setup -i $INVENTORY localhost --connection=local | grep python
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
iiab_base_ver: 8.0
|
||||
iiab_revision: 0
|
||||
|
||||
skip_role_on_error: False
|
||||
skip_role_on_error: True
|
||||
|
||||
iiab_etc_path: /etc/iiab
|
||||
|
||||
|
|
Loading…
Reference in a new issue