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

Update iiab-install

This commit is contained in:
A Holt 2018-07-23 17:49:34 -04:00 committed by GitHub
parent f5857b1468
commit bb1c0448e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,10 +12,28 @@ OS=${OS//\"/}
MIN_RPI_KERN=4.9.59-v7+
MIN_ANSIBLE_VER=2.5.6
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
echo -e "\n\n./iiab-install $* BEGUN IN $CWD\n"
if [ ! -f /etc/iiab/local_vars.yml ]; then
echo -e "EXITING: /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) NEED 4 SPEED? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2
echo -e " http://download.iiab.io\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
if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then
mkdir -p /etc/ansible/facts.d
fi
@ -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