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

Add explanations to scripts/ansible

This commit is contained in:
A Holt 2020-09-15 02:05:55 -04:00 committed by GitHub
parent d612b8fb06
commit a7909a6d32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,20 +2,26 @@
APT_PATH=/usr/bin # Avoids problematic /usr/local/bin/apt on Linux Mint
CURR_VER="undefined" # Ansible version you currently have installed
GOOD_VER="2.10.1" # For XO laptops (pip install) & CentOS (yum install rpm)
# On most/other OS's we install the latest (likely more recent!) from PPA:
GOOD_VER="2.10.1" # Orig for 'yum install [rpm]' & XO laptops (pip install)
# We install latest ansible-base from PPA: (may be more recent than GOOD-VER)
# https://launchpad.net/~ansible/+archive/ubuntu/ansible
# https://launchpad.net/~ansible/+archive/ubuntu/ansible-2.10
# http://ppa.launchpad.net/ansible/ansible/ubuntu/pool/main/a/ansible-base/
# https://github.com/ansible/ansible/commits/stable-2.10/changelogs/CHANGELOG-v2.10.rst
export DEBIAN_FRONTEND=noninteractive
# Why 'noninteractive' appears needed:
# https://github.com/iiab/iiab/issues/564#issuecomment-347264985
echo -e "\n\nYOU ARE RUNNING: /opt/iiab/iiab/scripts/ansible (TO INSTALL ANSIBLE)"
#echo -e 'Alternative: /opt/iiab/iiab/scripts/ansible-2.9.x ("Slow Food")\n'
echo -e "RECOMMENDED PREREQUISITES:"
echo -e "(1) Verify you're online"
echo -e "(2) Remove all prior versions of Ansible using"
echo -e " 'apt purge ansible' and/or 'pip uninstall ansible'"
echo -e "(3) Remove all lines containing 'ansible' from"
echo -e "(2) Remove all prior versions of Ansible using..."
echo -e " 'apt purge ansible-base' and/or 'pip uninstall ansible-base' and/or"
echo -e " 'apt purge ansible' and/or 'pip uninstall ansible'"
echo -e "(3) Remove all lines containing 'ansible' from..."
echo -e " /etc/apt/sources.list and /etc/apt/sources.list.d/*\n"
echo -e "IIAB INSTALL INSTRUCTIONS: (OLDER, MANUAL APPROACH)"
@ -24,11 +30,10 @@ echo -e "https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-
if [ $(command -v ansible) ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd"
CURR_VER=`ansible --version | head -1 | awk '{print $2}'` # To match iiab-install. Was: CURR_VER=`ansible --version | head -n 1 | cut -f 2 -d " "`
echo -e "CURRENTLY INSTALLED ANSIBLE: $CURR_VER -- LET'S TRY TO UPGRADE IT!"
echo -e "(Internet-in-a-Box requests Ansible $GOOD_VER or higher)\n"
else
echo -e "ANSIBLE NOT FOUND ON THIS COMPUTER -- LET'S TRY TO INSTALL IT!"
echo -e "(Internet-in-a-Box requests Ansible $GOOD_VER or higher)\n"
fi
echo -e "(Internet-in-a-Box requests Ansible $GOOD_VER or higher)\n"
if [ ! -f /etc/debian_version ]; then # e.g. Raspbian, Ubuntu, Mint & Debian
echo -e "\nEXITING: /etc/debian_version FILE NOT FOUND. Linux OS support info here:"
@ -61,9 +66,9 @@ $APT_PATH/apt -y --allow-downgrades install ansible-base \
python3-pymysql python3-psycopg2 python3-passlib python3-pip \
python3-setuptools python3-venv virtualenv
# IIAB requires these 2 Ansible Collections: (starting with Ansible 2.10)
ansible-galaxy collection install community.general
ansible-galaxy collection install community.mysql
# IIAB requires these 2 Ansible Collections: (with ansible-base 2.10.0 or higher)
ansible-galaxy collection install community.general # Re-running these
ansible-galaxy collection install community.mysql # appears to be safe!?
echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible-base'\n\n"