diff --git a/scripts/ansible b/scripts/ansible index 6a70ff781..876ce6863 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -6,11 +6,14 @@ GOOD_VER="2.6.4" # For XO laptops (pip install) & CentOS (yum install rpm) export DEBIAN_FRONTEND=noninteractive -echo -e '\n\nSTRONGLY RECOMMENDED PREREQUISITE: (1) remove all prior versions of Ansible using "apt purge ansible" and/or "pip uninstall ansible" and (2) clear out all lines containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n' +echo -e "\n\nSTRONGLY RECOMMENDED PREREQUISITES: (1) remove all prior versions of Ansible" +echo -e "using 'apt purge ansible' &/or 'pip uninstall ansible' (2) clear out all lines" +echo -e "containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n" -echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n' +echo -e "COMPLETE INSTALL INSTRUCTIONS:" +echo -e "https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n" -echo -e 'VERIFY YOU'"'"'RE ONLINE BEFORE RUNNING THIS: /opt/iiab/iiab/scripts/ansible' +echo -e "VERIFY YOU'RE ONLINE BEFORE RUNNING THIS: /opt/iiab/iiab/scripts/ansible" echo -e 'Alternative: Run /opt/iiab/iiab/scripts/ansible-2.6.x ("slow food")\n' if [ $(command -v ansible-playbook) ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd" @@ -21,11 +24,11 @@ if [ $(command -v ansible-playbook) ]; then # "command -v" is POSIX compliant echo "Please use your system's package manager (or pip if nec) to update Ansible." exit 0 elif [ -f /etc/olpc-release ]; then - echo 'Please use pip package manager to update Ansible.' + echo "Please use pip package manager to update Ansible." exit 0 fi else - echo -e 'Ansible NOT found on this computer.' + echo -e "Ansible NOT found on this computer!" echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher" fi @@ -60,7 +63,7 @@ elif [ -f /etc/centos-release ]; then #elif [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && [ ! -f /etc/olpc-release ]; then elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian - echo -e '\napt update; install dirmngr; PPA to /etc/apt/sources.list.d/iiab-ansible.list\n' + echo -e "\napt update; install dirmngr; PPA to /etc/apt/sources.list.d/iiab-ansible.list\n" apt update apt -y install dirmngr # Raspbian needs. Formerly: python-pip python-setuptools python-wheel patch echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \ @@ -69,10 +72,10 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367"\n' apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 - echo -e '\napt update; apt install ansible\n' + echo -e "\napt update; apt install ansible\n" apt update apt -y --allow-downgrades install ansible - echo -e '\nPlease verify Ansible using "ansible --version" and/or "apt -a list ansible"' + echo -e "\nPlease verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") #pip install ansible==2.4.4 @@ -83,8 +86,11 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian #wget http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb #apt -y --allow-downgrades install ./ansible_2.4.2.0-1ppa~xenial_all.deb - echo -e '\n\nPPA source "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" successfully saved to /etc/apt/sources.list.d/iiab-ansible.list' - echo -e '\nIF *OTHER* ANSIBLE SOURCES APPEAR BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' + echo -e 'PPA source "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main"' + echo -e "successfully saved to /etc/apt/sources.list.d/iiab-ansible.list\n" + + echo -e "IF *OTHER* ANSIBLE SOURCES APPEAR BELOW, PLEASE MANUALLY REMOVE THEM TO" + echo -e "ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -v '^/etc/apt/sources.list.d/iiab-ansible.list:' || true # Override bash -e (instead of aborting at 1st error) else echo -e "\nEXITING: Could not detect your OS (unsupported?)\n"