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

add --debug --upgrade

This commit is contained in:
Jerry Vonau 2017-10-28 20:12:23 -05:00
parent b8db298203
commit 8d822ab4f9

View file

@ -3,8 +3,9 @@
PLAYBOOK="iiab-steps.yml" PLAYBOOK="iiab-steps.yml"
INVENTORY="ansible_hosts" INVENTORY="ansible_hosts"
CWD=`pwd` CWD=`pwd`
# Pass cmdline options for ansible # Add cmdline options for passing to ansible
ARGS="$@" # todo add proper shift to gobble up --debug --upgrade
ARGS=""
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
@ -17,21 +18,24 @@ STAGE=""
if [ -f /etc/iiab/iiab.env ]; then if [ -f /etc/iiab/iiab.env ]; then
OLD=`grep XSCE /etc/iiab/iiab.env | wc -l` OLD=`grep XSCE /etc/iiab/iiab.env | wc -l`
if [ "$OLD" != 0 ]; then if [ "$OLD" != 0 ] || [ "$1" = "--upgrade" ]; then
echo "Found old XSCE install - re-installing from scratch" echo "Found old XSCE install - re-installing from scratch"
rm /etc/iiab/iiab.env rm /etc/iiab/iiab.env
# check ansible version here and force ansible upgrade if needed # check ansible version here and force ansible upgrade if needed
else else
source /etc/iiab/iiab.env source /etc/iiab/iiab.env
if [ ! $STAGE == 9 ]; then if [ $STAGE == 9 ] && [ "$1" = "--debug" ]; then
echo "Entering debug mode"
sed -i -e 's/^STAGE=.*/STAGE=2/' /etc/iiab/iiab.env
elif [ ! $STAGE == 9 ]; then
echo "Restarting from STAGE $STAGE" echo "Restarting from STAGE $STAGE"
fi else
if [ $STAGE == 9 ]; then # place keeper add read response
# place keeper echo "offer 'Y' dialog box option to override"
echo "offer 'Y' dialog box and --debug option to override" echo "'runansible' has already been completed"
echo "need to rewrite STAGE= before ansible is called or rm iiab.env" echo "use --debug to override "
sleep 5 echo "Exiting."
#exit 0 exit 1
fi fi
fi fi
else else