mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
2008 var names, output, comments, small bugs
This commit is contained in:
parent
6be97bba6c
commit
38fd86ac90
42 changed files with 144 additions and 137 deletions
|
@ -1,48 +1,51 @@
|
|||
#!/bin/bash
|
||||
|
||||
INVENTORY="ansible_hosts"
|
||||
PLAYBOOK="iiab-from-cmdline.yml"
|
||||
INVENTORY=ansible_hosts
|
||||
PLAYBOOK=iiab-from-cmdline.yml
|
||||
CWD=`pwd`
|
||||
APPS=/etc/iiab/iiab_state.yml
|
||||
ENV=/etc/iiab/iiab.env
|
||||
IIAB_STATE_FILE=/etc/iiab/iiab_state.yml
|
||||
IIAB_ENV_FILE=/etc/iiab/iiab.env
|
||||
|
||||
if [ ! -f $PLAYBOOK ]; then
|
||||
echo -e "\nExiting: IIAB Playbook not found."
|
||||
echo -e "\nExiting: IIAB Playbook $PLAYBOOK not found."
|
||||
echo -e "\nPlease run this in /opt/iiab/iiab (top level of the git repo)."
|
||||
exit 1
|
||||
fi
|
||||
if [ -f $ENV ]; then
|
||||
|
||||
if [ -f $IIAB_ENV_FILE ]; then
|
||||
STAGE=0
|
||||
if grep -q STAGE= /etc/iiab/iiab.env ; then
|
||||
source /etc/iiab/iiab.env
|
||||
echo -e "\nExtracted STAGE="$STAGE" (counter) from /etc/iiab/iiab.env"
|
||||
echo -e "\nExtracted STAGE=$STAGE (counter) from /etc/iiab/iiab.env"
|
||||
if ! [ "$STAGE" -eq "$STAGE" ] 2> /dev/null; then
|
||||
echo -e "\nEXITING: STAGE (counter) value == "$STAGE" is non-integer"
|
||||
echo -e "\nEXITING: STAGE (counter) value == $STAGE is non-integer"
|
||||
exit 1
|
||||
elif [ "$STAGE" -lt 0 ] || [ "$STAGE" -gt 9 ]; then
|
||||
echo -e "\nEXITING: STAGE (counter) value == "$STAGE" is out-of-range"
|
||||
echo -e "\nEXITING: STAGE (counter) value == $STAGE is out-of-range"
|
||||
exit 1
|
||||
elif [ "$STAGE" -lt 3 ]; then
|
||||
echo -e "\nEXITING: STAGE (counter) value == "$STAGE""
|
||||
echo -e "\nIIAB stage 3 not complete"
|
||||
echo -e "\nPlease run iiab-install"
|
||||
echo -e "\nEXITING: STAGE (counter) value == $STAGE"
|
||||
echo -e "\nIIAB Stage 3 not complete."
|
||||
echo -e "\nPlease run: ./iiab-install"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo -e "\nEXITING: STAGE (counter) not found"
|
||||
echo -e "\nIIAB not installed"
|
||||
echo -e "\nPlease run iiab-install"
|
||||
echo -e "\nIIAB not installed."
|
||||
echo -e "\nPlease run: ./iiab-install"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo -e "\nEXITING: /etc/iiab/iiab.env not found"
|
||||
echo -e "\nIIAB not installed"
|
||||
echo -e "\nPlease run iiab-install"
|
||||
echo -e "\nIIAB not installed."
|
||||
echo -e "\nPlease run: ./iiab-install"
|
||||
exit 1
|
||||
fi
|
||||
# workaround for image go away later
|
||||
if grep -q sugar $APPS; then
|
||||
if ! grep -q mongodb $APPS; then
|
||||
echo "mongodb_installed: True" >> $APPS
|
||||
|
||||
# Workaround for (web-published) images; will go away later
|
||||
if grep -q sugar $IIAB_STATE_FILE; then
|
||||
if ! grep -q mongodb $IIAB_STATE_FILE; then
|
||||
echo "mongodb_installed: True" >> $IIAB_STATE_FILE
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue