From 3de884dc9f736734b0e9fd14aeab27f1c91e555a Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 01:14:58 -0400 Subject: [PATCH 01/39] Ansible 2.6.3 -> 2.6.4 --- scripts/ansible-2.6.x | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index 387f3a7e4..1a75015b1 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -12,7 +12,7 @@ echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/an echo -e 'ALTERNATIVES: Run scripts/ansible for the latest, or scripts/ansible-2.5.x-deprecated "slow food"\n\n' -GOOD_VER="2.6.3" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.6.4" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade/pin to the latest 2.6.x from PPA, which might provide an even more recent 2.6.x CURR_VER="undefined" # below are unused for future use @@ -26,7 +26,7 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant 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.6.3-1.el7.ans.noarch.rpm + yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.6.4-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 From 0ad37c6a12763ceb524590a1bc28245091290c58 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 01:15:06 -0400 Subject: [PATCH 02/39] Ansible 2.6.3 -> 2.6.4 --- scripts/ansible | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 1bdb1035f..f8f1b0370 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -12,7 +12,7 @@ echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/an echo -e 'ALTERNATIVES: Run scripts/ansible-2.6.x or scripts/ansible-2.5.x-deprecated\n\n' -GOOD_VER="2.6.3" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.6.4" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade THE latest from PPA, which might provide an even more recent version of Ansible. CURR_VER="undefined" # below are unused for future use @@ -26,7 +26,7 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant 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.6.3-1.el7.ans.noarch.rpm + yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.6.4-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 From 8a017cee1e7a934aa00b6a8e0abde881da53f3fa Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 01:54:26 -0400 Subject: [PATCH 03/39] output far more understandable (if upgrading Ansible) --- scripts/ansible | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index f8f1b0370..c12580715 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -15,8 +15,6 @@ echo -e 'ALTERNATIVES: Run scripts/ansible-2.6.x or scripts/ansible-2.5.x-deprec GOOD_VER="2.6.4" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade THE latest from PPA, which might provide an even more recent version of Ansible. CURR_VER="undefined" -# below are unused for future use -# URL="NA" export DEBIAN_FRONTEND=noninteractive @@ -71,13 +69,19 @@ else 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 + #elif [[ `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 + #elif grep -r ansible /etc/apt; then + elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then #echo "Ansible repo(s) found within /etc/apt/sources.list*" - echo -e 'CONSIDER MANUAL INTERVENTION:\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/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n' + #echo -e '\nCONSIDER MANUAL INTERVENTION:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- SHOULD CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n' + echo -e '\nThe latest Ansible will be installed using line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' + echo -e '\nIF OTHER ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script to be sure:\n' + grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list + echo 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.' + echo -e '\nAnsible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' + echo -e '\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 From 82350f8c87344e0a6aba0c142985a28a8f4afe80 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:02:06 -0400 Subject: [PATCH 04/39] Update ansible --- scripts/ansible | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index c12580715..256a47008 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -76,8 +76,7 @@ else #echo "Ansible repo(s) found within /etc/apt/sources.list*" #echo -e '\nCONSIDER MANUAL INTERVENTION:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- SHOULD CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n' echo -e '\nThe latest Ansible will be installed using line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' - echo -e '\nIF OTHER ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script to be sure:\n' - grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list + echo -e '\nIF OTHER ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list echo else echo -e '\nAnsible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' From ae863c180ef8a904e9723db9b20b706a8ac6934c Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:03:17 -0400 Subject: [PATCH 05/39] verify /etc/apt & output understandably (if upgrading Ansible 2.6.x) --- scripts/ansible-2.6.x | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index 1a75015b1..0963acdca 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -71,13 +71,19 @@ else 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 + #elif [[ `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 + #elif grep -r ansible /etc/apt; then + elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then #echo "Ansible repo(s) found within /etc/apt/sources.list*" - echo -e 'CONSIDER MANUAL INTERVENTION:\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.6/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE 2.6.x -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n' + #echo -e 'CONSIDER MANUAL INTERVENTION:\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.6/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE 2.6.x -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n' + echo -e '\nThe latest Ansible 2.6.x will be installed using line "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' + echo -e '\nIF OTHER ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' + grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list + echo 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.' + echo -e '\nAnsible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' + echo -e '\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 From 2d8750fa5fb3ffb61382446ad36248d774cf4c03 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:10:01 -0400 Subject: [PATCH 06/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index 0963acdca..a37e00d6e 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -82,7 +82,7 @@ else grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list echo else - echo -e '\nAnsible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' + echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' echo -e '\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 From ed0d19d09d020e660ff1d4b45e79811d40a81fd0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:10:22 -0400 Subject: [PATCH 07/39] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 256a47008..0e9e9e76d 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -79,7 +79,7 @@ else echo -e '\nIF OTHER ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list echo else - echo -e '\nAnsible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' + echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' echo -e '\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 From ce7c953e4c1259c4a2454d4c6be3901037e72492 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:19:40 -0400 Subject: [PATCH 08/39] Update ansible --- scripts/ansible | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 0e9e9e76d..1e0f5f54d 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -76,8 +76,9 @@ else #echo "Ansible repo(s) found within /etc/apt/sources.list*" #echo -e '\nCONSIDER MANUAL INTERVENTION:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- SHOULD CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n' echo -e '\nThe latest Ansible will be installed using line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' - echo -e '\nIF OTHER ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list - echo + echo -e '\nIF *OTHER* ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' + grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list + echo -e '\n' else echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' echo -e '\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.' From 9124128c0d8c8171c805e2c861a3ddc174583e36 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:26:24 -0400 Subject: [PATCH 09/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index a37e00d6e..54275718e 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -74,13 +74,12 @@ else #elif [[ `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 #elif grep -r ansible /etc/apt; then + # "grep -x" matches whole lines (confirms it's not commented out) elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - #echo "Ansible repo(s) found within /etc/apt/sources.list*" - #echo -e 'CONSIDER MANUAL INTERVENTION:\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.6/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE 2.6.x -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n' echo -e '\nThe latest Ansible 2.6.x will be installed using line "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' - echo -e '\nIF OTHER ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' + echo -e '\nIF *OTHER* ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list - echo + echo -e '\n' else echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' echo -e '\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.' From 9c7b3af79e78871e0ff2ae4d7846ca84037c3ffd Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:27:17 -0400 Subject: [PATCH 10/39] Update ansible --- scripts/ansible | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 1e0f5f54d..be06ffc8d 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -72,9 +72,8 @@ else #elif [[ `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 #elif grep -r ansible /etc/apt; then + # "grep -x" matches whole lines (confirms it's not commented out) elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - #echo "Ansible repo(s) found within /etc/apt/sources.list*" - #echo -e '\nCONSIDER MANUAL INTERVENTION:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- SHOULD CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n' echo -e '\nThe latest Ansible will be installed using line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' echo -e '\nIF *OTHER* ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list From 7ac719ecfce7df71d6c4b58e8ce04b28e883b801 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:31:00 -0400 Subject: [PATCH 11/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index 54275718e..8239f8cf2 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -81,7 +81,7 @@ else grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list echo -e '\n' else - echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' + echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' echo -e '\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 From 68fe0b59783e86dc0d7a918004dd77707999d329 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:31:04 -0400 Subject: [PATCH 12/39] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index be06ffc8d..f15c9a5c9 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -79,7 +79,7 @@ else grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list echo -e '\n' else - echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list:' + echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' echo -e '\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 From 493f51aa5342798b43bf861ce04dab95992694f4 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:55:31 -0400 Subject: [PATCH 13/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index 8239f8cf2..f4847f835 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -50,10 +50,12 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant 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.6/ubuntu xenial main" \ - >> /etc/apt/sources.list.d/iiab-ansible.list + if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then + #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.6/ubuntu xenial main" \ + >> /etc/apt/sources.list.d/iiab-ansible.list + fi apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 fi else @@ -75,13 +77,13 @@ else #elif (grep -qi ansible /etc/apt/sources.list) || (ls /etc/apt/sources.list.d/*ansible*.list >/dev/null 2>&1) ; then #elif grep -r ansible /etc/apt; then # "grep -x" matches whole lines (confirms it's not commented out) - elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - echo -e '\nThe latest Ansible 2.6.x will be installed using line "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' + elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu .* main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then + echo -e '\nThe latest Ansible 2.6.x will be installed using line "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu ... main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' echo -e '\nIF *OTHER* ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list echo -e '\n' else - echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' + echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu ... main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' echo -e '\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 From 4d9c90dbcbc0c759608564d2cdabc177912ecb64 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 02:55:36 -0400 Subject: [PATCH 14/39] Update ansible --- scripts/ansible | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index f15c9a5c9..d3854cc09 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -48,10 +48,12 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant 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.4/ubuntu xenial main" \ - # >> /etc/apt/sources.list.d/iiab-ansible.list + if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then + 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 + fi apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 fi else @@ -73,13 +75,13 @@ else #elif (grep -qi ansible /etc/apt/sources.list) || (ls /etc/apt/sources.list.d/*ansible*.list >/dev/null 2>&1) ; then #elif grep -r ansible /etc/apt; then # "grep -x" matches whole lines (confirms it's not commented out) - elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - echo -e '\nThe latest Ansible will be installed using line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' + elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu .* main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then + echo -e '\nThe latest Ansible will be installed using line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu ... main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' echo -e '\nIF *OTHER* ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list echo -e '\n' else - echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' + echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu ... main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' echo -e '\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 From 1e619e6bbe83eb943c7df635904c970677c84874 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:08:50 -0400 Subject: [PATCH 15/39] Update ansible --- scripts/ansible | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index d3854cc09..934273c00 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -51,8 +51,6 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then 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 fi apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 fi From a12012a500ee82a4fcd8c73d764d87a9185ebbec Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:10:02 -0400 Subject: [PATCH 16/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index f4847f835..a0ec1e535 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -51,10 +51,8 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant #apt -y install dirmngr python-pip python-setuptools python-wheel patch apt -y install dirmngr if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - #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.6/ubuntu xenial main" \ - >> /etc/apt/sources.list.d/iiab-ansible.list + > /etc/apt/sources.list.d/iiab-ansible.list fi apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 fi From d72b1aad1c1bc4d4483881e76a0f597c7cf9b589 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:16:14 -0400 Subject: [PATCH 17/39] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 934273c00..8881f138a 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -87,7 +87,7 @@ 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" + echo -e "Using apt to check for updates, then install/upgrade ansible:\n" apt update apt -y --allow-downgrades install ansible From 85efa6c694ea895c3ffdbc8a35345975628db010 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:16:19 -0400 Subject: [PATCH 18/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index a0ec1e535..bf0908202 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -89,7 +89,7 @@ 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" + echo -e "Using apt to check for updates, then install/upgrade ansible:\n" apt update apt -y --allow-downgrades install ansible=2.6* From 4ef95dc0271b70654e2829fe910183c0da613f58 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:25:56 -0400 Subject: [PATCH 19/39] Update ansible --- scripts/ansible | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 8881f138a..e8cbb0cfc 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -39,9 +39,9 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant # 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 # 2018-09-05: fails on @kananigit's Ubuntu 18.04/Server. Fix @ https://github.com/iiab/iiab/pull/1091 + apt update 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 - #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 @@ -77,7 +77,7 @@ else echo -e '\nThe latest Ansible will be installed using line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu ... main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' echo -e '\nIF *OTHER* ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list - echo -e '\n' + echo else echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu ... main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' echo -e '\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.' @@ -87,7 +87,7 @@ 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 -e "Using apt to check for updates, then install/upgrade ansible:\n" + echo -e "\nUsing apt to check for updates, then install/upgrade ansible:\n" apt update apt -y --allow-downgrades install ansible From e3bbf6eaf7520b48f5c370a834314e7ffe9f5725 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:30:12 -0400 Subject: [PATCH 20/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index bf0908202..ffa6b944d 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -40,10 +40,10 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant 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 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-2.6 # adds correct line to correct file e.g. adds line "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu bionic main" to /etc/apt/sources.list.d/ansible-ubuntu-ansible-bionic.list - #apt-add-repository -y ppa:ansible/ansible # 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 @@ -79,7 +79,7 @@ else echo -e '\nThe latest Ansible 2.6.x will be installed using line "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu ... main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' echo -e '\nIF *OTHER* ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list - echo -e '\n' + echo else echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu ... main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' echo -e '\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.' @@ -89,7 +89,7 @@ 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 -e "Using apt to check for updates, then install/upgrade ansible:\n" + echo -e "\nUsing apt to check for updates, then install/upgrade ansible:\n" apt update apt -y --allow-downgrades install ansible=2.6* From 8a442dd1fb53739d6c3d7c71b8ca12d78f58336e Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:30:43 -0400 Subject: [PATCH 21/39] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index e8cbb0cfc..c5e8efc97 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -38,8 +38,8 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant 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 # 2018-09-05: fails on @kananigit's Ubuntu 18.04/Server. Fix @ https://github.com/iiab/iiab/pull/1091 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) From b81001e506495795627085b28c47f9d9a9646723 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:38:54 -0400 Subject: [PATCH 22/39] Update ansible --- scripts/ansible | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index c5e8efc97..76e0c0fa3 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -9,7 +9,7 @@ echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB- echo -e 'NOW ATTEMPTING TO INSTALL THE LATEST ANSIBLE:' echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/ansible)\n' -echo -e 'ALTERNATIVES: Run scripts/ansible-2.6.x or scripts/ansible-2.5.x-deprecated\n\n' +echo -e 'ALTERNATIVE: Run scripts/ansible-2.6.x for "slow food"\n\n' GOOD_VER="2.6.4" # Ansible version for OLPC XO laptops (pip install). @@ -19,7 +19,7 @@ CURR_VER="undefined" export DEBIAN_FRONTEND=noninteractive if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd" - echo "scripts/ansible will now try to install Ansible --- Please Wait" + echo -e "scripts/ansible will now try to install Ansible --- Please Wait\n" 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 From 4a7c0b408cff09fcc36d5a35c3d6a1feb002efd2 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:38:58 -0400 Subject: [PATCH 23/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index ffa6b944d..a0da9135f 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -9,7 +9,7 @@ echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB- echo -e 'NOW ATTEMPTING TO INSTALL THE LATEST ANSIBLE 2.6.x:' echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/ansible-2.6.x)\n' -echo -e 'ALTERNATIVES: Run scripts/ansible for the latest, or scripts/ansible-2.5.x-deprecated "slow food"\n\n' +echo -e 'ALTERNATIVE: Run scripts/ansible for the latest\n\n' GOOD_VER="2.6.4" # Ansible version for OLPC XO laptops (pip install). @@ -21,7 +21,7 @@ CURR_VER="undefined" export DEBIAN_FRONTEND=noninteractive if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd" - echo "scripts/ansible-2.6.x will now try to install Ansible --- Please Wait" + echo -e "scripts/ansible will now try to install Ansible --- Please Wait\n" 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 From 56366bddce21f9da70c24b7cffa20dc7841aab2d Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:58:19 -0400 Subject: [PATCH 24/39] Update ansible --- scripts/ansible | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 76e0c0fa3..fd41b24ca 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -48,10 +48,10 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant apt update #apt -y install dirmngr python-pip python-setuptools python-wheel patch apt -y install dirmngr - if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \ - > /etc/apt/sources.list.d/iiab-ansible.list - fi + #if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then + echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \ + > /etc/apt/sources.list.d/iiab-ansible.list + #fi apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 fi else From 7ce16bc1968e5c0b07363fd2f49d9b02395f6c3f Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 03:58:52 -0400 Subject: [PATCH 25/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index a0da9135f..e0f621071 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -50,10 +50,10 @@ if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant apt update #apt -y install dirmngr python-pip python-setuptools python-wheel patch apt -y install dirmngr - if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - echo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" \ - > /etc/apt/sources.list.d/iiab-ansible.list - fi + #if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then + echo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" \ + > /etc/apt/sources.list.d/iiab-ansible.list + #fi apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 fi else From 0f5d2d240ff555b46dcd76494cec2bc9e3401649 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 09:14:08 -0400 Subject: [PATCH 26/39] Update ansible --- scripts/ansible | 145 +++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 77 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index fd41b24ca..d9ca18c0e 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -1,95 +1,78 @@ #!/bin/bash -e +CURR_VER="undefined" # Ansible version you currently have installed +GOOD_VER="2.6.4" # 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\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 'IF 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 '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:' -echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/ansible)\n' +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' -echo -e 'ALTERNATIVE: Run scripts/ansible-2.6.x for "slow food"\n\n' - - -GOOD_VER="2.6.4" # Ansible version for OLPC XO laptops (pip install). - # On other OS's we attempt to install/upgrade THE latest from PPA, which might provide an even more recent version of Ansible. -CURR_VER="undefined" - -export DEBIAN_FRONTEND=noninteractive - -if [ ! `command -v ansible-playbook` ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd" - echo -e "scripts/ansible will now try to install Ansible --- Please Wait\n" - 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.6.4-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 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 - 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 - #if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \ - > /etc/apt/sources.list.d/iiab-ansible.list - #fi - 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 [ $(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 "Currently installed Ansible: $CURR_VER" + echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher" 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." + echo 'Please use pip package manager to update Ansible.' exit 0 - #elif [[ `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 - #elif grep -r ansible /etc/apt; then - # "grep -x" matches whole lines (confirms it's not commented out) - elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible/ubuntu .* main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - echo -e '\nThe latest Ansible will be installed using line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu ... main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' - echo -e '\nIF *OTHER* ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' - grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list - echo - else - echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu ... main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' - echo -e '\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 +else + echo -e 'Ansible NOT found on this computer.' + echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher" 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 -e "\nUsing apt to check for updates, then install/upgrade ansible:\n" +echo -e 'scripts/ansible will now try to install the very latest Ansible...\n' +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 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/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 "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' apt update apt -y --allow-downgrades install ansible + echo -e '\nPlease verify Ansible using "ansible --version" and/or "apt -a list ansible"' # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") #pip install ansible==2.4.4 @@ -99,8 +82,16 @@ if [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && [ ! -f /etc/o #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 '\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' + grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -v '^/etc/apt/sources.list.d/iiab-ansible.list:' + echo +else + echo -e "\nEXITING: Could not detect your OS (unsupported?)\n" + exit 1 fi -# needed? -mkdir -p /etc/ansible/ +# Needed? +mkdir -p /etc/ansible echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts From 4cfd7a79c07be2816e5b480657154ed26388d575 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 09:14:15 -0400 Subject: [PATCH 27/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 149 +++++++++++++++++++----------------------- 1 file changed, 69 insertions(+), 80 deletions(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index e0f621071..3733b00ab 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -1,97 +1,78 @@ #!/bin/bash -e +CURR_VER="undefined" # Ansible version you currently have installed +GOOD_VER="2.6.4" # 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\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 'IF 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 '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.6.x:' -echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/ansible-2.6.x)\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 scripts/ansible for the latest\n\n' - - -GOOD_VER="2.6.4" # Ansible version for OLPC XO laptops (pip install). - # On other OS's we attempt to install/upgrade/pin to the latest 2.6.x from PPA, which might provide an even more recent 2.6.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 -e "scripts/ansible will now try to install Ansible --- Please Wait\n" - 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.6.4-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 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-2.6 # adds correct line to correct file e.g. adds line "deb http://ppa.launchpad.net/ansible/ansible-2.6/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 - 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 - #if ! grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - echo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" \ - > /etc/apt/sources.list.d/iiab-ansible.list - #fi - 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 [ $(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 "Currently installed Ansible: $CURR_VER" + echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher" 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." + echo 'Please use pip package manager to update Ansible.' exit 0 - #elif [[ `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 - #elif grep -r ansible /etc/apt; then - # "grep -x" matches whole lines (confirms it's not commented out) - elif grep -qx "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu .* main" /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then - echo -e '\nThe latest Ansible 2.6.x will be installed using line "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu ... main" correctly found in /etc/apt/sources.list and/or /etc/apt/sources.list.d/*.list' - echo -e '\nIF *OTHER* ANSIBLE REPOS ARE ALSO FOUND BELOW, PLEASE MANUALLY REMOVE THEM TO ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n' - grep ansible /etc/apt/sources.list /etc/apt/sources.list.d/*.list - echo - else - echo -e '\nEXITING: Ansible repo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu ... main" not found in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list' - echo -e '\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 +else + echo -e 'Ansible NOT found on this computer.' + echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher" 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 -e "\nUsing apt to check for updates, then install/upgrade ansible:\n" +echo -e 'scripts/ansible will now try to install Ansible 2.6.x...\n' +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 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 --allow-downgrades install ansible=2.6* + 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 "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' + apt update + apt -y --allow-downgrades install ansible + echo -e '\nPlease verify Ansible using "ansible --version" and/or "apt -a list ansible"' # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") #pip install ansible==2.4.4 @@ -101,8 +82,16 @@ if [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && [ ! -f /etc/o #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 '\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 '\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' + grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -v '^/etc/apt/sources.list.d/iiab-ansible.list:' + echo +else + echo -e "\nEXITING: Could not detect your OS (unsupported?)\n" + exit 1 fi -# needed? -mkdir -p /etc/ansible/ +# Needed? +mkdir -p /etc/ansible echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts From 227623e3f0631571a6dbeb3e4512439c3facad62 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 09:36:39 -0400 Subject: [PATCH 28/39] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index d9ca18c0e..8936e1d6c 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -38,7 +38,7 @@ if [ -f /etc/olpc-release ]; then 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 install ansible + 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 From 2ebe84bac054f07f189bcbcdf5507c5541ca4950 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 09:36:54 -0400 Subject: [PATCH 29/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index 3733b00ab..aed997930 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -38,7 +38,7 @@ if [ -f /etc/olpc-release ]; then 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 install ansible + 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 From cf1d2f6374012a9c07878cf9c6a6011d908e7072 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 09:45:35 -0400 Subject: [PATCH 30/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index aed997930..884451c39 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -29,7 +29,7 @@ else echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher" fi -echo -e 'scripts/ansible will now try to install Ansible 2.6.x...\n' +echo -e 'scripts/ansible-2.6.x will now try to install Ansible 2.6.x...\n' 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 From b546fd8ab8546e78608cf0471a3ea1eccadf17fa Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 09:50:59 -0400 Subject: [PATCH 31/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index 884451c39..edcf190c6 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -13,7 +13,7 @@ echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB- 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' -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 " "` echo "Currently installed Ansible: $CURR_VER" echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher" From 9b8de1b17fde62045d3972738061274d45da4060 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 09:51:26 -0400 Subject: [PATCH 32/39] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 8936e1d6c..80546aee7 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -13,7 +13,7 @@ echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB- 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" +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 "Currently installed Ansible: $CURR_VER" echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher" From f867aaf0dfd56fd92c00c8efa732cfa6d7cb4352 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 10:43:49 -0400 Subject: [PATCH 33/39] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 80546aee7..cf3e76c7a 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -85,7 +85,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian 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' - grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -v '^/etc/apt/sources.list.d/iiab-ansible.list:' + 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) echo else echo -e "\nEXITING: Could not detect your OS (unsupported?)\n" From 7e4284aee4c26da801513a3a5955c70469011dbc Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 10:44:17 -0400 Subject: [PATCH 34/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index edcf190c6..bfe4968dc 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -85,7 +85,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian 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 '\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' - grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -v '^/etc/apt/sources.list.d/iiab-ansible.list:' + 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) echo else echo -e "\nEXITING: Could not detect your OS (unsupported?)\n" From 03cacc5bf4b736a4087011c3e1bd58f306dbf6ce Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 10:53:45 -0400 Subject: [PATCH 35/39] Update ansible --- scripts/ansible | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index cf3e76c7a..6a70ff781 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -86,7 +86,6 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian 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' 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) - echo else echo -e "\nEXITING: Could not detect your OS (unsupported?)\n" exit 1 From d5c38d4cb1e4f0dacdbcd62068eff435bf3180e1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 7 Sep 2018 10:54:58 -0400 Subject: [PATCH 36/39] Update ansible-2.6.x --- scripts/ansible-2.6.x | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index bfe4968dc..8ed275a07 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -86,7 +86,6 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian 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 '\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' 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) - echo else echo -e "\nEXITING: Could not detect your OS (unsupported?)\n" exit 1 From 746ce5f262af25a90540fd1d7048c0221652c00c Mon Sep 17 00:00:00 2001 From: Tim Moody Date: Sat, 8 Sep 2018 17:46:59 -0400 Subject: [PATCH 37/39] sync dhcpd so comes up at boot on rpi w --- roles/network/templates/dhcp/dhcpd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/templates/dhcp/dhcpd.service b/roles/network/templates/dhcp/dhcpd.service index f09734779..173478896 100644 --- a/roles/network/templates/dhcp/dhcpd.service +++ b/roles/network/templates/dhcp/dhcpd.service @@ -1,6 +1,6 @@ [Unit] Description=DHCPv4 Server Daemon -After=multi-user.target +After=network-online.target Requires=multi-user.target [Service] From 6c30eecfc5a09b93643d466a8b1a605dcb905ce1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 11 Sep 2018 13:44:13 -0400 Subject: [PATCH 38/39] MIN_ANSIBLE_VER 2.5.8. -> 2.6.4 --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index b1d1561fd..be6df417c 100755 --- a/iiab-install +++ b/iiab-install @@ -10,7 +10,7 @@ CWD=`pwd` OS=`grep ^ID= /etc/*release|cut -d= -f2` OS=${OS//\"/} MIN_RPI_KERN=4.9.59-v7+ -MIN_ANSIBLE_VER=2.5.8 +MIN_ANSIBLE_VER=2.6.4 if [ ! -f /etc/iiab/local_vars.yml ]; then From 62bc2fdb8ee9fd8734119188d300749fc6cc4586 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 11 Sep 2018 14:02:17 -0400 Subject: [PATCH 39/39] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index be6df417c..606f530b5 100755 --- a/iiab-install +++ b/iiab-install @@ -96,7 +96,7 @@ CURR_ANSIBLE_VER=0 if [[ `command -v ansible` ]]; then # "command -v" is POSIX compliant; it catches built-in commands like "cd" #CURR_ANSIBLE_VER=`ansible --version | head -1 | sed -e 's/.* //'` #CURR_ANSIBLE_VER=`ansible --version | head -1 | cut -f 2 -d " "` - CURR_ANSIBLE_VER=`ansible --version | head -1 | awk '{print $2}'` # to match scripts/ansible + CURR_ANSIBLE_VER=`ansible --version | head -1 | awk '{print $2}'` # to match scripts/ansible echo "Found Ansible "$CURR_ANSIBLE_VER"" fi if version_gt $MIN_ANSIBLE_VER $CURR_ANSIBLE_VER ; then