mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
Merge pull request #962 from holta/iiab-install-cleaner
iiab-install code cleanup (clarifies that /etc/iiab/local_vars.yml MUST already be in place)
This commit is contained in:
commit
a04a58f359
1 changed files with 21 additions and 20 deletions
41
iiab-install
41
iiab-install
|
@ -12,7 +12,25 @@ OS=${OS//\"/}
|
|||
MIN_RPI_KERN=4.9.59-v7+
|
||||
MIN_ANSIBLE_VER=2.5.6
|
||||
|
||||
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
|
||||
if [ ! -f /etc/iiab/local_vars.yml ]; then
|
||||
echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2
|
||||
echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more" >&2
|
||||
echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2
|
||||
echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2
|
||||
echo -e ' http://download.iiab.io (click on "6.6" or a more recent version!)\n' >&2
|
||||
#case $OS in
|
||||
# OLPC | fedora)
|
||||
# echo -e "Please examine /opt/iiab/iiab/vars/local_vars_olpc.yml for XO laptops.\n" >&2
|
||||
# ;;
|
||||
# centos | debian | ubuntu | raspbian)
|
||||
# echo -e "Please consider /opt/iiab/iiab/vars/local_vars_medium.yml or similar.\n" >&2
|
||||
# ;;
|
||||
# *)
|
||||
# echo -e "EXITING: IIAB requires Raspbian, Debian, Ubuntu, CentOS or OLPC/Fedora.\n" >&2
|
||||
# ;;
|
||||
#esac
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\n\n./iiab-install $* BEGUN IN $CWD\n"
|
||||
|
||||
|
@ -120,28 +138,11 @@ if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then
|
|||
echo -e "\n'--debug' *ignored* as STAGE (counter) < 2."
|
||||
fi
|
||||
|
||||
# If /etc/iiab/local_vars.yml is missing, put a default file in place.
|
||||
if [ ! -f /etc/iiab/local_vars.yml ]; then
|
||||
case $OS in
|
||||
OLPC | fedora)
|
||||
cp ./vars/local_vars_olpc.yml /etc/iiab/local_vars.yml
|
||||
echo -e "\n/etc/iiab/local_vars.yml created from /opt/iiab/iiab/vars/local_vars_olpc.yml defaults."
|
||||
;;
|
||||
centos | debian | ubuntu | raspbian)
|
||||
cp ./vars/local_vars_medium.yml /etc/iiab/local_vars.yml
|
||||
echo -e "\n/etc/iiab/local_vars.yml created from /opt/iiab/iiab/vars/local_vars_medium.yml defaults."
|
||||
echo "See MIN/MEDIUM/BIG options @ http://wiki.iiab.io/local_vars.yml"
|
||||
;;
|
||||
*)
|
||||
echo -e "\nEXITING: IIAB requires Raspbian, Debian, Ubuntu, CentOS or OLPC/Fedora."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo -e "\nTRY TO RERUN './iiab-install' IF IT FAILS DUE TO CONNECTIVITY ISSUES ETC!"
|
||||
echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages $(($STAGE + 1))-9"
|
||||
|
||||
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
|
||||
|
||||
ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null
|
||||
ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local
|
||||
|
||||
|
|
Loading…
Reference in a new issue