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

Merge pull request #1769 from holta/ansible-deprecations

Ansible deprecations
This commit is contained in:
A Holt 2019-06-23 18:22:52 -04:00 committed by GitHub
commit 8fb3620309
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 405 deletions

View file

@ -1,106 +0,0 @@
#!/bin/bash -x
#TODO.md
yum_makecache_retry() {
tries=0
until [ $tries -ge 5 ]
do
yum makecache && break
let tries++
sleep 1
done
}
if [ "x$KITCHEN_LOG" = "xDEBUG" -o "x$OMNIBUS_ANSIBLE_LOG" = "xDEBUG" ]; then
export PS4='(${BASH_SOURCE}:${LINENO}): - [${SHLVL},${BASH_SUBSHELL},$?] $ '
set -x
fi
if [ ! $(which ansible-playbook) ]; then
if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ] || [ -f /etc/oracle-release ] || [ -f /etc/system-release ] || grep -q 'Amazon Linux' /etc/system-release; then
# Install required Python libs and pip
# Fix EPEL Metalink SSL error
# - workaround: https://community.hpcloud.com/article/centos-63-instance-giving-cannot-retrieve-metalink-repository-epel-error
# - SSL secure solution: Update ca-certs!!
# - http://stackoverflow.com/q/26734777/645491#27667111
# - http://serverfault.com/q/637549/77156
# - http://unix.stackexchange.com/a/163368/7688
yum -y install ca-certificates nss
yum clean all
rm -rf /var/cache/yum
yum_makecache_retry
yum -y install epel-release
# One more time with EPEL to avoid failures
yum_makecache_retry
yum -y install python-pip PyYAML python-jinja2 python-httplib2 python-keyczar python-paramiko git
# If python-pip install failed and setuptools exists, try that
if [ -z "$(which pip)" -a -z "$(which easy_install)" ]; then
yum -y install python-setuptools
easy_install pip
elif [ -z "$(which pip)" -a -n "$(which easy_install)" ]; then
easy_install pip
fi
# Install passlib for encrypt
yum -y groupinstall "Development tools"
yum -y install python-devel MySQL-python sshpass && pip install pyrax pysphere boto passlib dnspython
# Install Ansible module dependencies
yum -y install bzip2 file findutils git gzip hg svn sudo tar which unzip xz zip libselinux-python
[ -n "$(yum search procps-ng)" ] && yum -y install procps-ng || yum -y install procps
elif [ -f /etc/debian_version ] || [ grep -qi ubuntu /etc/lsb-release ] || grep -qi ubuntu /etc/os-release; then
apt-get update
# Install via package
# apt-get update && \
# apt-get install --no-install-recommends -y software-properties-common && \
# apt-add-repository ppa:ansible/ansible && \
# apt-get update && \
# apt-get install -y ansible
# Install required Python libs and pip
apt-get install -y python-pip python-yaml python-jinja2 python-httplib2 python-paramiko python-pkg-resources
[ -n "$( apt-cache search python-keyczar )" ] && apt-get install -y python-keyczar
if ! apt-get install -y git ; then
apt-get install -y git-core
fi
# If python-pip install failed and setuptools exists, try that
if [ -z "$(which pip)" -a -z "$(which easy_install)" ]; then
apt-get -y install python-setuptools
easy_install pip
elif [ -z "$(which pip)" -a -n "$(which easy_install)" ]; then
easy_install pip
fi
# If python-keyczar apt package does not exist, use pip
[ -z "$( apt-cache search python-keyczar )" ] && sudo pip install python-keyczar
# Install passlib for encrypt
apt-get install -y build-essential
apt-get install -y python-all-dev python-mysqldb sshpass && pip install pyrax pysphere boto passlib dnspython
# Install Ansible module dependencies
apt-get install -y bzip2 file findutils git gzip mercurial procps subversion sudo tar debianutils unzip xz-utils zip python-selinux
else
echo 'WARN: Could not detect distro or distro unsupported'
echo 'WARN: Trying to install ansible via pip without some dependencies'
echo 'WARN: Not all functionality of ansible may be available'
fi
mkdir /etc/ansible/
echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts
pip install ansible==2.2
if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ] || [ -f /etc/oracle-release ] || [ -f /etc/system-release ] || grep -q 'Amazon Linux' /etc/system-release; then
# Fix for pycrypto pip / yum issue
# https://github.com/ansible/ansible/issues/276
if ansible --version 2>&1 | grep -q "AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'" ; then
echo 'WARN: Re-installing python-crypto package to workaround ansible/ansible#276'
echo 'WARN: https://github.com/ansible/ansible/issues/276'
pip uninstall -y pycrypto
yum erase -y python-crypto
yum install -y python-crypto python-paramiko
fi
fi
fi

View file

@ -1,93 +0,0 @@
#!/bin/bash -e
echo -e '\nATTEMPTING TO INSTALL THE LATEST ANSIBLE 2.4.x'
echo -e 'Ensure you'"'"'re online before running this script!'
echo -e 'OR: consider scripts/ansible-2.5.x\nOR: consider scripts/ansible to keep up-to-date with Ansible'"'"'s evolution.\n'
GOOD_VER="2.4.4" # Ansible version for OLPC XO laptops (pip install).
# On other OS's we attempt to install/upgrade/pin to the latest Ansible 2.4.x
# WARNING: IIAB 6.6 will likely recommend the very latest Ansible 2.5.x or higher.
CURR_VER="undefined"
# below are unused for future use
# URL="NA"
export DEBIAN_FRONTEND=noninteractive
if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd"
echo "Installing --- Please Wait"
if [ -f /etc/centos-release ]; then
yum -y install ca-certificates nss epel-release
yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
yum -y install python-pip python-setuptools python-wheel patch
yum -y install http://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.4.4.0-1.el7.ans.noarch.rpm
# elif [ -f /etc/fedora-release ]; then
# CURR_VER=`grep VERSION_ID /etc/*elease | cut -d= -f2`
# URL=https://github.com/jvonau/iiab/blob/ansible/vars/fedora-$CURR_VER.yml
# dnf -y install ansible git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
# dnf -y install python-pip python-setuptools python-wheel patch
elif [ -f /etc/olpc-release ]; then
yum -y install ca-certificates nss
yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
yum -y install python-pip python-setuptools python-wheel patch
pip install --upgrade pip setuptools wheel #EOL just do it
pip install ansible==$GOOD_VER --disable-pip-version-check
# Parens are optional, but greatly clarify :)
elif (grep -qi ubuntu /etc/lsb-release 2> /dev/null) || (grep -qi ubuntu /etc/os-release); then
apt -y install python-pip python-setuptools python-wheel patch
#apt-add-repository -y ppa:ansible/ansible
apt-add-repository -y ppa:ansible/ansible-2.4
# elif UBUNTU MUST REMAIN ABOVE (as Ubuntu ALSO contains /etc/debian_version, which would trigger the line just below)
elif [ -f /etc/debian_version ] || (grep -qi raspbian /etc/*elease) ; then
if ( ! grep -qi ansible /etc/apt/sources.list) && [ ! -f /etc/apt/sources.list.d/ansible ]; then
apt update
apt -y install dirmngr python-pip python-setuptools python-wheel patch
#echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \
# >> /etc/apt/sources.list.d/iiab-ansible.list
echo "deb http://ppa.launchpad.net/ansible/ansible-2.4/ubuntu xenial main" \
>> /etc/apt/sources.list.d/iiab-ansible.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
fi
else
echo "WARN: Could not detect distro or distro unsupported"
exit 1
fi
else
#CURR_VER=`ansible --version | head -n 1 | cut -f 2 -d " "`
CURR_VER=`ansible --version | head -1 | awk '{print $2}'` # to match iiab-install
echo "Current ansible version installed is $CURR_VER"
if [ -f /etc/centos-release ] || [ -f /etc/fedora-release ]; then
echo "Please use your system's package manager to update ansible"
exit 0
elif [ -f /etc/olpc-release ]; then
echo "Please use pip package manager to update ansible"
exit 0
#fi
#if [[ `grep -qi ansible /etc/apt/sources.list` ]] || [ -f /etc/apt/sources.list.d/ansible*.list ]; then
elif (grep -qi ansible /etc/apt/sources.list) || (ls /etc/apt/sources.list.d/*ansible*.list >/dev/null 2>&1) ; then
#echo "Ansible repo(s) found within /etc/apt/sources.list*"
echo -e '\nMANUAL INTERVENTION URGED: ANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- MUST CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible-2.4/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE 2.4.x -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n'
else
echo "Upstream ansible source repo not found, please uninstall ansible and re-run this script"
exit 1
fi
fi
if [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && [ ! -f /etc/olpc-release ]; then
# Align IIAB with Ansible community's latest official release
echo "Using apt to check for updates, then install/upgrade ansible"
apt update
apt -y --allow-downgrades install ansible=2.4*
# TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible")
#pip install ansible==2.4.4
# TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. DETAILS @ https://github.com/iiab/iiab/issues/669
#echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb"
#cd /tmp
#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
fi
# needed?
mkdir -p /etc/ansible/
echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts

View file

@ -1,102 +0,0 @@
#!/bin/bash -e
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 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirror.\n'
echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n'
echo -e 'NOW ATTEMPTING TO INSTALL THE LATEST ANSIBLE 2.5.x:'
echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/ansible-2.5.x)\n'
echo -e 'ALTERNATIVES: Run scripts/ansible-2.6.x, or scripts/ansible for the latest.\n\n'
GOOD_VER="2.5.6" # Ansible version for OLPC XO laptops (pip install).
# On other OS's we attempt to install/upgrade/pin to the latest Ansible 2.5.x
CURR_VER="undefined"
# below are unused for future use
# URL="NA"
export DEBIAN_FRONTEND=noninteractive
if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd"
echo "Installing --- Please Wait"
if [ -f /etc/centos-release ]; then
yum -y install ca-certificates nss epel-release
yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
yum -y install python-pip python-setuptools python-wheel patch
yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.5.5-1.el7.ans.noarch.rpm
# elif [ -f /etc/fedora-release ]; then
# CURR_VER=`grep VERSION_ID /etc/*elease | cut -d= -f2`
# URL=https://github.com/jvonau/iiab/blob/ansible/vars/fedora-$CURR_VER.yml
# dnf -y install ansible git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
# dnf -y install python-pip python-setuptools python-wheel patch
elif [ -f /etc/olpc-release ]; then
yum -y install ca-certificates nss
yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
yum -y install python-pip python-setuptools python-wheel patch
pip install --upgrade pip setuptools wheel #EOL just do it
pip install ansible==$GOOD_VER --disable-pip-version-check
# Parens are optional, but greatly clarify :)
elif (grep -qi ubuntu /etc/lsb-release 2> /dev/null) || (grep -qi ubuntu /etc/os-release); then
apt -y install python-pip python-setuptools python-wheel patch
#apt-add-repository -y ppa:ansible/ansible
apt-add-repository -y ppa:ansible/ansible-2.5
# elif UBUNTU MUST REMAIN ABOVE (as Ubuntu ALSO contains /etc/debian_version, which would trigger the line just below)
elif [ -f /etc/debian_version ] || (grep -qi raspbian /etc/*elease) ; then
if ( ! grep -qi ansible /etc/apt/sources.list) && [ ! -f /etc/apt/sources.list.d/ansible ]; then
apt update
#apt -y install dirmngr python-pip python-setuptools python-wheel patch
apt -y install dirmngr
#echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \
# >> /etc/apt/sources.list.d/iiab-ansible.list
echo "deb http://ppa.launchpad.net/ansible/ansible-2.5/ubuntu xenial main" \
>> /etc/apt/sources.list.d/iiab-ansible.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
fi
else
echo "WARN: Could not detect distro or distro unsupported"
exit 1
fi
else
#CURR_VER=`ansible --version | head -n 1 | cut -f 2 -d " "`
CURR_VER=`ansible --version | head -1 | awk '{print $2}'` # to match iiab-install
echo "Currently installed Ansible version is: $CURR_VER"
echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher\n"
if [ -f /etc/centos-release ] || [ -f /etc/fedora-release ]; then
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."
exit 0
#fi
#if [[ `grep -qi ansible /etc/apt/sources.list` ]] || [ -f /etc/apt/sources.list.d/ansible*.list ]; then
elif (grep -qi ansible /etc/apt/sources.list) || (ls /etc/apt/sources.list.d/*ansible*.list >/dev/null 2>&1) ; then
#echo "Ansible repo(s) found within /etc/apt/sources.list*"
echo -e 'MANUAL INTERVENTION URGED:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- MUST CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible-2.5/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE 2.5.x -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n'
else
echo -e 'Upstream ansible source repo not found:\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.'
exit 1
fi
fi
if [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && [ ! -f /etc/olpc-release ]; then
# Align IIAB with Ansible community's latest official release
echo "Using apt to check for updates, then install/upgrade ansible"
apt update
apt -y --allow-downgrades install ansible=2.5*
# TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible")
#pip install ansible==2.4.4
# TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. DETAILS @ https://github.com/iiab/iiab/issues/669
#echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb"
#cd /tmp
#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
fi
# needed?
mkdir -p /etc/ansible/
echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts

View file

@ -1,104 +0,0 @@
#!/bin/bash -e
CURR_VER="undefined" # Ansible version you currently have installed
GOOD_VER="2.7.10" # For XO laptops (pip install) & CentOS (yum install rpm)
# On other OS's we attempt the latest from PPA, which might be more recent
export DEBIAN_FRONTEND=noninteractive
echo -e "\n\nYOU ARE RUNNING: /opt/iiab/iiab/scripts/ansible-2.6.x (TO INSTALL ANSIBLE)"
echo -e 'Alternative: /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"
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"
if [ -f /etc/centos-release ] || [ -f /etc/fedora-release ]; then
echo "Please use your system's package manager (or pip if nec) to update Ansible.\n"
exit 0
elif [ -f /etc/olpc-release ]; then
echo "Please use pip package manager to update Ansible.\n"
exit 0
fi
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
if [ -f /etc/olpc-release ]; then
yum -y install ca-certificates nss
yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
yum -y install python-pip python-setuptools python-wheel patch
# Can above 3 lines be merged into 1 line?
pip install --upgrade pip setuptools wheel #EOL just do it
pip install ansible==$GOOD_VER --disable-pip-version-check
elif [ -f /etc/centos-release ]; then
yum -y install ansible
# 2018-09-07: the next 4 lines aren't needed according to https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#latest-release-via-dnf-or-yum
# yum -y install ca-certificates nss epel-release
# yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
# yum -y install python-pip python-setuptools python-wheel patch
# yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-$GOOD_VER-1.el7.ans.noarch.rpm
#elif [ -f /etc/fedora-release ]; then
# CURR_VER=`grep VERSION_ID /etc/*elease | cut -d= -f2`
# URL=https://github.com/jvonau/iiab/blob/ansible/vars/fedora-$CURR_VER.yml
# dnf -y install ansible git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
# dnf -y install python-pip python-setuptools python-wheel patch
## Parens are optional, but greatly clarify :)
#elif (grep -qi ubuntu /etc/lsb-release 2> /dev/null) || (grep -qi ubuntu /etc/os-release); then
# apt update
# #apt -y install python-pip python-setuptools python-wheel patch # 2018-09-05: fails on @kananigit's Ubuntu 18.04/Server. Fix @ https://github.com/iiab/iiab/pull/1091
# apt -y install software-properties-common # adds command "apt-add-repository"
# apt-add-repository -y ppa:ansible/ansible # adds correct line to correct file e.g. adds line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" to /etc/apt/sources.list.d/ansible-ubuntu-ansible-bionic.list
## elif UBUNTU MUST REMAIN ABOVE (as Ubuntu ALSO contains /etc/debian_version, which would trigger the line just below)
#elif [ -f /etc/debian_version ] || (grep -qi raspbian /etc/*elease) ; 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"
apt update
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" \
> /etc/apt/sources.list.d/iiab-ansible.list
echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367"\n'
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367
echo -e "\napt update; apt install ansible\n"
apt update
apt -y --allow-downgrades install ansible
echo -e "\nSUCCESS: 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
# TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. DETAILS @ https://github.com/iiab/iiab/issues/669
#echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb"
#cd /tmp
#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 'PPA source "deb http://ppa.launchpad.net/ansible/ansible-2.6/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"
exit 1
fi
# Needed?
mkdir -p /etc/ansible
echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts