1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00

scripts/ansible installs bionic-or-focal

This commit is contained in:
root 2021-02-24 23:29:59 -05:00
parent 82a768acf5
commit 37af289942

View file

@ -6,17 +6,36 @@
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.6" # 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
# IIAB implementers might instead consider these 2 GENERAL TECHNIQUES below
# We install the latest 'ansible-base' from PPA, using an OS 'CODENAME' below:
# https://launchpad.net/~ansible/+archive/ubuntu/ansible
# 'lsb_release -sc' gives Mint 20 codename 'ulyana' etc: (TOO FINE-GRAINED)
if grep -q buster /etc/os-release /etc/debian_version; then
CODENAME=bionic # Debian 10, RaspiOS 10 & Buster-like distros
else
CODENAME=focal # Debian 11+, RaspiOS 11+, Ubuntu 20.04+, Mint 20+ (ETC)
fi
# 'ansible-base' RELEASE LINKS FOR REFERENCE:
# http://ppa.launchpad.net/ansible/ansible/ubuntu/pool/main/a/ansible-base/
# https://launchpad.net/~ansible/+archive/ubuntu/ansible-2.10
# https://github.com/ansible/ansible/commits/stable-2.10/changelogs/CHANGELOG-v2.10.rst
# https://github.com/ansible/ansible/releases
# https://releases.ansible.com/ansible-base/
# FYI .travis.yml installs ansible-base in a slightly different way (PR #2689).
# IIAB implementers might instead consider these 3 GENERAL TECHNIQUES below
# ("in an emergency!") e.g. if you must install an older version of Ansible:
# TEMPORARILY USE ANSIBLE 2.9.17 (REMOVE IT WITH "pip uninstall ansible")
#pip install ansible==2.9.17
# TEMPORARILY USE ansible-base 2.10.6 (REMOVE W/ "pip3 uninstall ansible-base")
#pip3 install ansible-base==2.10.6 # Start new shell, so /usr/local/bin works
#ansible-galaxy collection install -r collections.yml
# TEMPORARILY USE ANSIBLE 2.9.18 (REMOVE IT WITH "pip uninstall ansible")
#apt install python-pip
#pip install ansible==2.9.18
# TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. Details: iiab/iiab#669
#echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb"
@ -61,7 +80,7 @@ fi
echo -e "\napt update; install dirmngr; PPA to /etc/apt/sources.list.d/iiab-ansible.list\n"
$APT_PATH/apt update
$APT_PATH/apt -y install dirmngr
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" \
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu $CODENAME main" \
> /etc/apt/sources.list.d/iiab-ansible.list
# In future we might instead consider 'add-apt-repository ppa:ansible/ansible'
# or 'apt-add-repository ppa:ansible/bionic/ansible' etc, e.g. for streamlined
@ -78,7 +97,7 @@ echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" \
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 'PPA source "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main"'
echo -e 'PPA source "deb http://ppa.launchpad.net/ansible/ansible/ubuntu '$CODENAME' 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'