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

Update ansible-2.6.x

This commit is contained in:
A Holt 2018-09-25 15:33:39 -04:00 committed by GitHub
parent a890c169a5
commit d637444b32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,13 +6,19 @@ GOOD_VER="2.6.4" # For XO laptops (pip install) & CentOS (yum install rpm)
export DEBIAN_FRONTEND=noninteractive 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\nYOU ARE RUNNING: /opt/iiab/iiab/scripts/ansible-2.6.x"
echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://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-2.6.x'
echo -e 'Alternative: Run /opt/iiab/iiab/scripts/ansible for the very latest Ansible\n' echo -e 'Alternative: Run /opt/iiab/iiab/scripts/ansible for the very latest Ansible\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 " /etc/apt/sources.list and /etc/apt/sources.list.d/*\n"
echo -e "COMPLETE INSTALL INSTRUCTIONS:"
echo -e "https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n"
if [ $(command -v ansible-playbook) ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd" if [ $(command -v ansible-playbook) ]; 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 " "` 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 "Currently installed Ansible: $CURR_VER" echo "Currently installed Ansible: $CURR_VER"
@ -21,11 +27,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." echo "Please use your system's package manager (or pip if nec) to update Ansible."
exit 0 exit 0
elif [ -f /etc/olpc-release ]; then 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 exit 0
fi fi
else 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" echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher"
fi fi
@ -60,7 +66,7 @@ elif [ -f /etc/centos-release ]; then
#elif [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && [ ! -f /etc/olpc-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 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 update
apt -y install dirmngr # Raspbian needs. Formerly: python-pip python-setuptools python-wheel patch apt -y install dirmngr # Raspbian needs. Formerly: python-pip python-setuptools python-wheel patch
echo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" \ echo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" \
@ -69,10 +75,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' 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 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 update
apt -y --allow-downgrades install ansible 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") # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible")
#pip install ansible==2.4.4 #pip install ansible==2.4.4
@ -83,8 +89,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 #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 #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-2.6/ubuntu xenial main" successfully saved to /etc/apt/sources.list.d/iiab-ansible.list' echo -e 'PPA source "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main"'
echo -e '\nIF *OTHER* ANSIBLE SOURCES ARE ALSO IN THE LIST BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' 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) 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 else
echo -e "\nEXITING: Could not detect your OS (unsupported?)\n" echo -e "\nEXITING: Could not detect your OS (unsupported?)\n"