From ead6a2375a8b8335bad97eed39bd5e8cd409ad20 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 18 Apr 2021 14:12:26 -0400 Subject: [PATCH 01/39] ansible-base (2.10) -> ansible-core (2.11+) transition very soon --- .travis.yml | 17 ++++++++--------- scripts/ansible | 35 +++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index aeed81a09..d22cabca1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ addons: - sourceline: ppa:ansible/ansible packages: # - python-pip # @arky had used this starting in 2018 - - ansible-base # Install latest ansible-base e.g. 2.10.7+, similar to https://github.com/iiab/iiab/blob/master/scripts/ansible -# - python3-pymysql # These 7-or-8 packages are not needed during this very rapid --syntax-check + - ansible-core # MUCH FASTER pip3 OPTION IS BELOW. Conversely: apt (SLOW WAY) may be desired in future to mimic https://github.com/iiab/iiab/blob/master/scripts/ansible for linting etc? +# - python3-pymysql # These 7-or-8 packages are not needed during the very rapid --syntax-check (below) # - python3-psycopg2 # - python3-passlib # - python3-pip @@ -20,14 +20,13 @@ addons: install: # - scripts/ansible # See #2105: fails to install latest Ansible (& ~4 Ansible Collections from collections.yml) due to Travis VM's disk layout/perms being different -# - pip install ansible # SLOW/OVERWEIGHT: installs Ansible 3.0.0+ with ~80 Ansible Collections -# - pip install ansible-base # ALSO WORKS (FASTER THAN ALL ABOVE!) e.g. if the above addons: / apt: section is commented out. To install latest ansible-base e.g. 2.10.7+, similar to https://github.com/iiab/iiab/blob/master/scripts/ansible -# - pip3 install ansible-core # APRIL 2021: ansible-base is being renamed to ansible-core -- latest version number is listed at https://pypi.org/project/ansible-core/ +# - pip3 install ansible # SLOW / OVERWEIGHT: installs Ansible 3.1.0+ superset, with more than 80 (far more than we need) Ansible Collections +# - pip3 install ansible-core # MUCH FASTER / MAY BE CONSIDERED IN FUTURE e.g. if above apt install of ansible-core is commented out. APRIL 2021: ansible-base (2.10) was renamed to ansible-core (2.11+) with the latest version number shown at https://pypi.org/project/ansible-core/ - ansible-galaxy collection install -r collections.yml # Install ~4 Ansible Collections - - "{ echo 'roles_path = ./roles/'; } >> ansible.cfg" # Add correct roles_path to ansible.cfg, appending to https://github.com/iiab/iiab/blob/master/ansible.cfg -# - "{ echo '[defaults]'; echo 'roles_path = ./roles/'; } >> ansible.cfg" # 2021-02-24: suddenly no longer works, with the newer ansible-base install methods above (error arises due to '[defaults]' appearing twice) -# - cat ansible.cfg # UNCOMMENT TO VERIFY! - - apt -a list ansible-base # VERIFY ansible-base VERSIONS OFFERED BY apt + - echo 'roles_path = ./roles/' >> ansible.cfg" # Add correct roles_path to ansible.cfg, appending to https://github.com/iiab/iiab/blob/master/ansible.cfg +# - "{ echo '[defaults]'; echo 'roles_path = ./roles/'; } >> ansible.cfg" # 2021-02-24: suddenly no longer works, with the newer ansible-base -> ansible-core install methods above (error arises due to '[defaults]' appearing twice) + - cat ansible.cfg # VISUAL VERIFICATION OF ABOVE! + - apt -a list ansible-core # VERIFY ansible-core VERSIONS OFFERED BY apt, from https://launchpad.net/~ansible/+archive/ubuntu/ansible script: - ansible-playbook tests/test.yml -i tests/inventory --syntax-check diff --git a/scripts/ansible b/scripts/ansible index 0aa812e25..9d7c8b2e6 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -9,9 +9,9 @@ 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.8 # Orig for 'yum install [rpm]' & XO laptops (pip install) +GOOD_VER=2.11.0 # Orig for 'yum install [rpm]' & XO laptops (pip install) -# We install the latest 'ansible-base' from PPA, using an OS 'CODENAME' below: +# We install the latest 'ansible-core' 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) @@ -21,17 +21,23 @@ else CODENAME=focal # Debian 11+, RaspiOS 11+, Ubuntu 20.04+, Mint 20+ (ETC) fi -# 'ansible-base' being renamed 'ansible-code' early in 2021. RELEASE LINK REFS: -# 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/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_11.rst +# APRIL 2021 - ansible-base (2.10) is being renamed to ansible-core (2.11+): # https://www.ansible.com/blog/ansible-3.0.0-qa # https://github.com/ansible/ansible/releases +# https://pypi.org/project/ansible-base/ +# https://pypi.org/project/ansible-core/ # https://releases.ansible.com/ansible-base/ # https://releases.ansible.com/ansible-core/ +# https://launchpad.net/~ansible/+archive/ubuntu/ansible-2.10 +# https://launchpad.net/~ansible/+archive/ubuntu/ansible-2.11 ? +# http://ppa.launchpad.net/ansible/ansible/ubuntu/pool/main/a/ansible-base/ +# http://ppa.launchpad.net/ansible/ansible/ubuntu/pool/main/a/ansible-core/ ? +# https://github.com/ansible/ansible/blob/stable-2.10/changelogs/CHANGELOG-v2.10.rst +# https://github.com/ansible/ansible/blob/stable-2.11/changelogs/CHANGELOG-v2.11.rst +# https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_10.rst +# https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_11.rst -# FYI .travis.yml installs ansible-base in a slightly different way (PR #2689). +# FYI .travis.yml installs ansible-core in a slightly different way (PR #2689). # IIAB implementers might instead consider these 4 GENERAL TECHNIQUES below # ("in an emergency!") e.g. if apt fails & you need a newer/older Ansible: @@ -65,6 +71,7 @@ echo -e "\n\nYOU ARE RUNNING: /opt/iiab/iiab/scripts/ansible (TO INSTALL ANSIBLE 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-core' and/or 'pip3 uninstall ansible-core' and/or" echo -e " 'apt purge ansible-base' and/or 'pip3 uninstall ansible-base' and/or" echo -e " 'apt purge ansible' and/or 'pip uninstall ansible'" echo -e "(3) Remove all lines containing 'ansible' from..." @@ -82,7 +89,7 @@ if [ $(command -v ansible) ]; then # "command -v" is POSIX compliant; also ca else echo -e "ANSIBLE NOT FOUND ON THIS COMPUTER -- LET'S TRY TO INSTALL IT!" fi -echo -e "(Internet-in-a-Box requests ansible-base $GOOD_VER or higher)\n" +echo -e "(Internet-in-a-Box requests ansible-core $GOOD_VER or higher)\n" # Code above designed to work on all Linux distributions, to preserve options, # in support of any volunteer(s) wanting to port IIAB to a new Linux/distro. @@ -118,10 +125,10 @@ 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) -echo -e "\napt update; apt install ansible-base and python3 dependencies explained at:" +echo -e "\napt update; apt install ansible-core and python3 dependencies explained at:" echo -e "https://github.com/iiab/iiab/tree/master/scripts/ansible.md\n" $APT_PATH/apt update -$APT_PATH/apt -y --allow-downgrades install ansible-base \ +$APT_PATH/apt -y --allow-downgrades install ansible-core \ python3-pymysql python3-psycopg2 python3-passlib python3-pip \ python3-setuptools python3-packaging python3-venv virtualenv @@ -140,7 +147,7 @@ ansible-galaxy collection install --force-with-deps \ # /usr/share/ansible/collections/ansible_collections echo -e "\n\nCreating/verifying directory /etc/ansible & installing /etc/ansible/hosts\n" -mkdir -p /etc/ansible -echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts +mkdir -p /etc/ansible # LIKELY REDUNDANT, due to above installation of Ansible +echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts # LIKELY REDUNDANT, due to https://github.com/iiab/iiab/blob/master/ansible_hosts -echo -e "SUCCESS: VERIFY ANSIBLE WITH 'ansible --version' & 'apt -a list ansible-base'\n\n" +echo -e "SUCCESS: VERIFY ANSIBLE WITH 'ansible --version' & 'apt -a list ansible-core'\n\n" From 58b972cdf7d4bb190f48feeb6483857315acd4d1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 18 Apr 2021 16:20:08 -0400 Subject: [PATCH 02/39] scripts/ansible: further explain .travis.yml --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 9d7c8b2e6..9e407cee9 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -37,7 +37,7 @@ fi # https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_10.rst # https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_11.rst -# FYI .travis.yml installs ansible-core in a slightly different way (PR #2689). +# FYI .travis.yml installs ansible-core in a slightly different way (PRs #2689, #2742). # IIAB implementers might instead consider these 4 GENERAL TECHNIQUES below # ("in an emergency!") e.g. if apt fails & you need a newer/older Ansible: From 605adceebc2e98a1e2ccf39c89ffeb1ce51ad51a Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 19 Apr 2021 10:52:14 -0400 Subject: [PATCH 03/39] Update .travis.yml --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index d22cabca1..fe6acd878 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,12 +4,12 @@ dist: focal addons: apt: - sources: - - sourceline: ppa:ansible/ansible +# sources: +# - sourceline: ppa:ansible/ansible packages: # - python-pip # @arky had used this starting in 2018 - - ansible-core # MUCH FASTER pip3 OPTION IS BELOW. Conversely: apt (SLOW WAY) may be desired in future to mimic https://github.com/iiab/iiab/blob/master/scripts/ansible for linting etc? -# - python3-pymysql # These 7-or-8 packages are not needed during the very rapid --syntax-check (below) +# - ansible-core # MUCH FASTER pip3 OPTION IS BELOW. Conversely: apt (SLOW WAY) may be desired in future to mimic https://github.com/iiab/iiab/blob/master/scripts/ansible for linting etc? +# - python3-pymysql # These 7-or-8 packages (below) are not needed during the very rapid --syntax-check (bottom) # - python3-psycopg2 # - python3-passlib # - python3-pip @@ -21,7 +21,7 @@ addons: install: # - scripts/ansible # See #2105: fails to install latest Ansible (& ~4 Ansible Collections from collections.yml) due to Travis VM's disk layout/perms being different # - pip3 install ansible # SLOW / OVERWEIGHT: installs Ansible 3.1.0+ superset, with more than 80 (far more than we need) Ansible Collections -# - pip3 install ansible-core # MUCH FASTER / MAY BE CONSIDERED IN FUTURE e.g. if above apt install of ansible-core is commented out. APRIL 2021: ansible-base (2.10) was renamed to ansible-core (2.11+) with the latest version number shown at https://pypi.org/project/ansible-core/ + - pip3 install ansible-core # MUCH FASTER / MAY BE CONSIDERED IN FUTURE e.g. if above apt install of ansible-core is commented out. APRIL 2021: ansible-base (2.10) was renamed to ansible-core (2.11+) with the latest version number shown at https://pypi.org/project/ansible-core/ - ansible-galaxy collection install -r collections.yml # Install ~4 Ansible Collections - echo 'roles_path = ./roles/' >> ansible.cfg" # Add correct roles_path to ansible.cfg, appending to https://github.com/iiab/iiab/blob/master/ansible.cfg # - "{ echo '[defaults]'; echo 'roles_path = ./roles/'; } >> ansible.cfg" # 2021-02-24: suddenly no longer works, with the newer ansible-base -> ansible-core install methods above (error arises due to '[defaults]' appearing twice) From ac9ad2ef01d9484d90867ae760dc7a58d1761321 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 19 Apr 2021 10:57:07 -0400 Subject: [PATCH 04/39] Big: remove trailing " in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fe6acd878..b1ebff06a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ install: # - pip3 install ansible # SLOW / OVERWEIGHT: installs Ansible 3.1.0+ superset, with more than 80 (far more than we need) Ansible Collections - pip3 install ansible-core # MUCH FASTER / MAY BE CONSIDERED IN FUTURE e.g. if above apt install of ansible-core is commented out. APRIL 2021: ansible-base (2.10) was renamed to ansible-core (2.11+) with the latest version number shown at https://pypi.org/project/ansible-core/ - ansible-galaxy collection install -r collections.yml # Install ~4 Ansible Collections - - echo 'roles_path = ./roles/' >> ansible.cfg" # Add correct roles_path to ansible.cfg, appending to https://github.com/iiab/iiab/blob/master/ansible.cfg + - echo 'roles_path = ./roles/' >> ansible.cfg # Add correct roles_path to ansible.cfg, appending to https://github.com/iiab/iiab/blob/master/ansible.cfg # - "{ echo '[defaults]'; echo 'roles_path = ./roles/'; } >> ansible.cfg" # 2021-02-24: suddenly no longer works, with the newer ansible-base -> ansible-core install methods above (error arises due to '[defaults]' appearing twice) - cat ansible.cfg # VISUAL VERIFICATION OF ABOVE! - apt -a list ansible-core # VERIFY ansible-core VERSIONS OFFERED BY apt, from https://launchpad.net/~ansible/+archive/ubuntu/ansible From f7ee26ddfd46c8aa8df29d01e8cb30748be43305 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 19 Apr 2021 11:07:50 -0400 Subject: [PATCH 05/39] scripts/ansible: "pip3 install ansible-core" interim/alternative --- scripts/ansible | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 9e407cee9..f405769fa 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -128,7 +128,10 @@ grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | gre echo -e "\napt update; apt install ansible-core and python3 dependencies explained at:" echo -e "https://github.com/iiab/iiab/tree/master/scripts/ansible.md\n" $APT_PATH/apt update -$APT_PATH/apt -y --allow-downgrades install ansible-core \ +apt install python3-pip +pip3 install ansible-core +#$APT_PATH/apt -y --allow-downgrades install ansible-core \ +$APT_PATH/apt -y --allow-downgrades install \ python3-pymysql python3-psycopg2 python3-passlib python3-pip \ python3-setuptools python3-packaging python3-venv virtualenv From 436e30726a447332a8ba3b3591d6d998b751ef4c Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 19 Apr 2021 11:29:42 -0400 Subject: [PATCH 06/39] Experiment: do not create directory /etc/ansible & /etc/ansible/hosts --- scripts/ansible | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index f405769fa..55102f0e7 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -149,8 +149,8 @@ ansible-galaxy collection install --force-with-deps \ # But going forward they'll be stored herein: # /usr/share/ansible/collections/ansible_collections -echo -e "\n\nCreating/verifying directory /etc/ansible & installing /etc/ansible/hosts\n" -mkdir -p /etc/ansible # LIKELY REDUNDANT, due to above installation of Ansible -echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts # LIKELY REDUNDANT, due to https://github.com/iiab/iiab/blob/master/ansible_hosts +#echo -e "\n\nCreating/verifying directory /etc/ansible & installing /etc/ansible/hosts\n" +#mkdir -p /etc/ansible # LIKELY REDUNDANT, due to above installation of Ansible +#echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts # LIKELY REDUNDANT, due to https://github.com/iiab/iiab/blob/master/ansible_hosts echo -e "SUCCESS: VERIFY ANSIBLE WITH 'ansible --version' & 'apt -a list ansible-core'\n\n" From 4d25baa6c07fd2ec343a7cb8b9821ff26436b563 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 19 Apr 2021 11:41:11 -0400 Subject: [PATCH 07/39] scripts/ansible: "$APT_PATH/apt -y install python3-pip" --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 55102f0e7..e2c427f1d 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -128,7 +128,7 @@ grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | gre echo -e "\napt update; apt install ansible-core and python3 dependencies explained at:" echo -e "https://github.com/iiab/iiab/tree/master/scripts/ansible.md\n" $APT_PATH/apt update -apt install python3-pip +$APT_PATH/apt -y install python3-pip pip3 install ansible-core #$APT_PATH/apt -y --allow-downgrades install ansible-core \ $APT_PATH/apt -y --allow-downgrades install \ From 34bca59a8c693198a55dd9325ff8725884ab96f3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 28 Apr 2021 10:08:16 -0400 Subject: [PATCH 08/39] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b1ebff06a..2f8cf2a68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ addons: # - sourceline: ppa:ansible/ansible packages: # - python-pip # @arky had used this starting in 2018 -# - ansible-core # MUCH FASTER pip3 OPTION IS BELOW. Conversely: apt (SLOW WAY) may be desired in future to mimic https://github.com/iiab/iiab/blob/master/scripts/ansible for linting etc? +# - ansible-core # FASTER pip3 OPTION IS BELOW. Conversely: apt (SLOW WAY) may be desired in future to mimic https://github.com/iiab/iiab/blob/master/scripts/ansible for linting etc? # - python3-pymysql # These 7-or-8 packages (below) are not needed during the very rapid --syntax-check (bottom) # - python3-psycopg2 # - python3-passlib From 3422ec1369b599d31f0157a7a90ef7e3d3c5bcbd Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 3 May 2021 20:56:44 -0400 Subject: [PATCH 09/39] scripts/ansible: further clarify ansible-base 2.10.9 --- scripts/ansible | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 5e08e3125..2b36eba36 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -48,8 +48,9 @@ fi #apt install python3-pymysql python3-psycopg2 python3-passlib python3-pip python3-setuptools python3-packaging python3-venv virtualenv #ansible-galaxy collection install -r collections.yml -# TEMPORARILY USE ansible-base 2.10.8 (REMOVE W/ "pip3 uninstall ansible-base") -#pip3 install ansible-base==2.10.8 # Start new shell, so /usr/local/bin works +# TEMPORARILY USE ansible-base 2.10.9 (REMOVE W/ "pip3 uninstall ansible-base") +#apt install python3-pip +#pip3 install ansible-base==2.10.9 # Start new shell, so /usr/local/bin works # TEMPORARILY USE ANSIBLE 2.9.20 (REMOVE IT WITH "pip uninstall ansible") #apt install python-pip From 87c9fe1c534c9aeddff7767390a80759f0b522e4 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 3 May 2021 21:00:08 -0400 Subject: [PATCH 10/39] scripts/ansible: clarify python3-pip & pip3 --- scripts/ansible | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 2b36eba36..3e8fb68cf 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -44,6 +44,7 @@ fi # TEMPORARILY USE pip3 to install the latest ansible-core as listed at # https://pypi.org/project/ansible-core/ (REMOVE W/ "pip3 uninstall ansible-core") +#apt install python3-pip #pip3 install ansible-core # Then start a new shell, so /usr/local/bin works #apt install python3-pymysql python3-psycopg2 python3-passlib python3-pip python3-setuptools python3-packaging python3-venv virtualenv #ansible-galaxy collection install -r collections.yml @@ -53,8 +54,8 @@ fi #pip3 install ansible-base==2.10.9 # Start new shell, so /usr/local/bin works # TEMPORARILY USE ANSIBLE 2.9.20 (REMOVE IT WITH "pip uninstall ansible") -#apt install python-pip -#pip install ansible==2.9.20 +#apt install python3-pip +#pip3 install ansible==2.9.20 # 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" From 647efb42e938e1cb2189c09dda42b8bebdb1f909 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 3 May 2021 21:03:49 -0400 Subject: [PATCH 11/39] scripts/ansible: further clarify pip -> pip3 --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 3e8fb68cf..4ccb132f4 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -75,7 +75,7 @@ echo -e "(1) Verify you're online" echo -e "(2) Remove all prior versions of Ansible using..." echo -e " 'apt purge ansible-core' and/or 'pip3 uninstall ansible-core' and/or" echo -e " 'apt purge ansible-base' and/or 'pip3 uninstall ansible-base' and/or" -echo -e " 'apt purge ansible' and/or 'pip uninstall ansible'" +echo -e " 'apt purge ansible' and/or 'pip3 uninstall ansible'" echo -e "(3) Remove all lines containing 'ansible' from..." echo -e " /etc/apt/sources.list and /etc/apt/sources.list.d/*\n" From f967a9ad2474f1df963ba2dcf4a03f02fec3a1a0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 3 May 2021 21:07:14 -0400 Subject: [PATCH 12/39] scripts/ansible clarifs: /etc/ansible/hosts not needed, etc --- scripts/ansible | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ansible b/scripts/ansible index 4ccb132f4..545a14d59 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -163,6 +163,7 @@ ansible-galaxy collection install --force-with-deps \ # But going forward they'll be stored herein: # /usr/share/ansible/collections/ansible_collections +# 2021-04-19: No longer needed, per PR #2743 testing #echo -e "\n\nCreating/verifying directory /etc/ansible & installing /etc/ansible/hosts\n" #mkdir -p /etc/ansible # LIKELY REDUNDANT, due to above installation of Ansible #echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts # LIKELY REDUNDANT, due to https://github.com/iiab/iiab/blob/master/ansible_hosts From e7d5e2c4e68e544c6679413706165eaeb52db4fd Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 18 May 2021 21:09:36 -0400 Subject: [PATCH 13/39] default_vars.yml: Clarify lokole_sim_type options --- vars/default_vars.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index b5ccbc3ab..6baeccf47 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -389,7 +389,9 @@ jupyterhub_port: 8000 # Lokole (email for rural communities) from https://ascoderu.ca lokole_install: False lokole_enabled: False -lokole_sim_type: LocalOnly # lokole_sim_type: Ethernet +# lokole_sim_type can be: 'hologram', 'Ethernet', 'LocalOnly', or 'mkwvconf' +# Details: https://github.com/ascoderu/lokole/blob/master/install.py#L35 +lokole_sim_type: LocalOnly mediawiki_install: False mediawiki_enabled: False From db40519311ccabe77c97ef149786b1f083ce599c Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 18 May 2021 21:09:47 -0400 Subject: [PATCH 14/39] local_vars_min.yml: Clarify lokole_sim_type options --- vars/local_vars_min.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index ab690b1dd..14fe8dc66 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -260,7 +260,9 @@ jupyterhub_enabled: False # Lokole (email for rural communities) from https://ascoderu.ca lokole_install: False lokole_enabled: False -lokole_sim_type: LocalOnly # lokole_sim_type: Ethernet +# lokole_sim_type can be: 'hologram', 'Ethernet', 'LocalOnly', or 'mkwvconf' +# Details: https://github.com/ascoderu/lokole/blob/master/install.py#L35 +lokole_sim_type: LocalOnly mediawiki_install: False mediawiki_enabled: False From 04c892432947a679d9872405ecef554757c09e9d Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 18 May 2021 21:10:04 -0400 Subject: [PATCH 15/39] local_vars_medium.yml: Clarify lokole_sim_type options --- vars/local_vars_medium.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index ca60dca19..4fb27d50a 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -260,7 +260,9 @@ jupyterhub_enabled: False # Lokole (email for rural communities) from https://ascoderu.ca lokole_install: False lokole_enabled: False -lokole_sim_type: LocalOnly # lokole_sim_type: Ethernet +# lokole_sim_type can be: 'hologram', 'Ethernet', 'LocalOnly', or 'mkwvconf' +# Details: https://github.com/ascoderu/lokole/blob/master/install.py#L35 +lokole_sim_type: LocalOnly mediawiki_install: False mediawiki_enabled: False From 2f9f58ddf72933eb1517a03102a252390a90964c Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 18 May 2021 21:10:19 -0400 Subject: [PATCH 16/39] local_vars_big.yml: Clarify lokole_sim_type options --- vars/local_vars_big.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index 3bf5a6805..2b6cafa0b 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -260,7 +260,9 @@ jupyterhub_enabled: True # Lokole (email for rural communities) from https://ascoderu.ca lokole_install: True lokole_enabled: True -lokole_sim_type: LocalOnly # lokole_sim_type: Ethernet +# lokole_sim_type can be: 'hologram', 'Ethernet', 'LocalOnly', or 'mkwvconf' +# Details: https://github.com/ascoderu/lokole/blob/master/install.py#L35 +lokole_sim_type: LocalOnly mediawiki_install: True mediawiki_enabled: True From e21403d7579d0ae8a0840933894d6d2a50aa4b0b Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 18 May 2021 21:10:49 -0400 Subject: [PATCH 17/39] lokole/defaults/main.yml: Clarify lokole_sim_type options --- roles/lokole/defaults/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/lokole/defaults/main.yml b/roles/lokole/defaults/main.yml index 57ebf510e..4ca021152 100644 --- a/roles/lokole/defaults/main.yml +++ b/roles/lokole/defaults/main.yml @@ -1,7 +1,9 @@ # lokole_install: False # lokole_enabled: False -# lokole_sim_type: LocalOnly # lokole_sim_type: Ethernet +# lokole_sim_type can be: 'hologram', 'Ethernet', 'LocalOnly', or 'mkwvconf' +# Details: https://github.com/ascoderu/lokole/blob/master/install.py#L35 +# lokole_sim_type: LocalOnly # All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml # If nec, change them by editing /etc/iiab/local_vars.yml prior to installing! From 5a2156e3b14385eb136b02390e98f76b09efa96d Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 18 May 2021 22:16:20 -0400 Subject: [PATCH 18/39] Clean up comments in vars/ubuntu-21.yml --- vars/ubuntu-21.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vars/ubuntu-21.yml b/vars/ubuntu-21.yml index 4977f268f..0f29d4a5f 100644 --- a/vars/ubuntu-21.yml +++ b/vars/ubuntu-21.yml @@ -17,13 +17,11 @@ apache_log_dir: /var/log/apache2 smb_service: smbd nmb_service: nmbd systemctl_program: /bin/systemctl -# issue raised mysql_service: mariadb apache_log: /var/log/apache2/access.log sshd_package: openssh-server sshd_service: ssh -php_version: 7.4 # 2020-04-22: Will Ubuntu 21.10 require 8.0? -# "postgresql_version: 11.2" failed (too detailed for /etc/systemd/system/postgresql-iiab.service on Ubuntu 19.04) -postgresql_version: 13 # 2020-04-22: Will Ubuntu 21.10 require 14? +php_version: 7.4 # 2021-04-22: Will Ubuntu 21.10 require 8.0? +postgresql_version: 13 # 2021-04-22: Will Ubuntu 21.10 require 14? systemd_location: /lib/systemd/system python_ver: 3.9 From 7e92b3f0a983c71b0a746df4b6ec1c98135175e0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 18 May 2021 22:19:35 -0400 Subject: [PATCH 19/39] Clean up comments in vars/linuxmint-20.yml --- vars/linuxmint-20.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/vars/linuxmint-20.yml b/vars/linuxmint-20.yml index d3f963442..93df64985 100644 --- a/vars/linuxmint-20.yml +++ b/vars/linuxmint-20.yml @@ -19,13 +19,11 @@ apache_log_dir: /var/log/apache2 smb_service: smbd nmb_service: nmbd systemctl_program: /bin/systemctl -# issue raised mysql_service: mariadb apache_log: /var/log/apache2/access.log sshd_package: openssh-server sshd_service: ssh php_version: 7.4 -# "postgresql_version: 11.2" failed (too detailed for /etc/systemd/system/postgresql-iiab.service on Ubuntu 19.04) postgresql_version: 12 systemd_location: /lib/systemd/system python_ver: 3.8 From 582b82302f78f87679d6b8caca829aa9946f4379 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 18 May 2021 22:22:35 -0400 Subject: [PATCH 20/39] Clean up comments in vars/ubuntu-20.yml --- vars/ubuntu-20.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/vars/ubuntu-20.yml b/vars/ubuntu-20.yml index 30b0d505d..ca994c7d8 100644 --- a/vars/ubuntu-20.yml +++ b/vars/ubuntu-20.yml @@ -17,13 +17,11 @@ apache_log_dir: /var/log/apache2 smb_service: smbd nmb_service: nmbd systemctl_program: /bin/systemctl -# issue raised mysql_service: mariadb apache_log: /var/log/apache2/access.log sshd_package: openssh-server sshd_service: ssh php_version: 7.4 -# "postgresql_version: 11.2" failed (too detailed for /etc/systemd/system/postgresql-iiab.service on Ubuntu 19.04) postgresql_version: 12 systemd_location: /lib/systemd/system python_ver: 3.8 From 45dcf7214e4e0ce7d6a9605e0a574fee2dbdc891 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 19 May 2021 06:42:25 -0500 Subject: [PATCH 21/39] OPWEN_SETTINGS From an install.py machine where supervisord is used this value is passed pi@jv-rpi-stock:~ $ cat /etc/supervisor/conf.d/lokole_gunicorn.conf [program:lokole_gunicorn] command="/lokole/venv/bin/gunicorn" --bind="unix:/lokole/state/lokole_gunicorn.sock" --timeout=300 --workers=3 --log-level=error opwen_email_client.webapp:app autostart=true autorestart=true startretries=3 stopasgroup=true stderr_logfile=/lokole/logs/lokole_gunicorn.stderr.log stdout_logfile=/lokole/logs/lokole_gunicorn.stdout.log user=root environment=OPWEN_SETTINGS=/lokole/state/settings.env --- roles/lokole/templates/webapp_secrets.sh.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/lokole/templates/webapp_secrets.sh.j2 b/roles/lokole/templates/webapp_secrets.sh.j2 index fc8a51b7e..d2d6e6040 100644 --- a/roles/lokole/templates/webapp_secrets.sh.j2 +++ b/roles/lokole/templates/webapp_secrets.sh.j2 @@ -1,3 +1,4 @@ +export OPWEN_SETTINGS='{{ lokole_run_directory }}/settings.env' export OPWEN_SIM_TYPE='{{ lokole_sim_type }}' export OPWEN_STATE_DIRECTORY='{{ lokole_run_directory }}' export OPWEN_APP_ROOT='{{ lokole_url }}/' From 9e5582baec89670b2fee3452c2571bc830e522a1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 10:09:07 -0400 Subject: [PATCH 22/39] Update .travis.yml --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2f8cf2a68..4535fb222 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,9 @@ addons: # - sourceline: ppa:ansible/ansible packages: # - python-pip # @arky had used this starting in 2018 -# - ansible-core # FASTER pip3 OPTION IS BELOW. Conversely: apt (SLOW WAY) may be desired in future to mimic https://github.com/iiab/iiab/blob/master/scripts/ansible for linting etc? -# - python3-pymysql # These 7-or-8 packages (below) are not needed during the very rapid --syntax-check (bottom) +# - python3-pip # Modern equivalent (not nec here on Travis?) +# - ansible-core # SLOW. WHEN IT WORKS AT ALL. Using 'pip3 install ansible-core' instead (below) is faster and greatly simplifies. Certainly let's try to mimic https://github.com/iiab/iiab/blob/master/scripts/ansible (as it evolves) for linting etc? +# - python3-pymysql # These 7-or-8 packages (below) are not needed during the very rapid --syntax-check (core script, at bottom) # - python3-psycopg2 # - python3-passlib # - python3-pip @@ -20,13 +21,13 @@ addons: install: # - scripts/ansible # See #2105: fails to install latest Ansible (& ~4 Ansible Collections from collections.yml) due to Travis VM's disk layout/perms being different -# - pip3 install ansible # SLOW / OVERWEIGHT: installs Ansible 3.1.0+ superset, with more than 80 (far more than we need) Ansible Collections - - pip3 install ansible-core # MUCH FASTER / MAY BE CONSIDERED IN FUTURE e.g. if above apt install of ansible-core is commented out. APRIL 2021: ansible-base (2.10) was renamed to ansible-core (2.11+) with the latest version number shown at https://pypi.org/project/ansible-core/ +# - pip3 install ansible # SLOW / OVERWEIGHT: installs Ansible 4.0.0+ superset, with more than 80 (far more than we need) Ansible Collections + - pip3 install ansible-core # SIGNIFICANTLY FASTER than above apt install of ansible-core (in 'packages:' section above). APRIL 2021: ansible-base (2.10) was renamed to ansible-core (2.11+) with the latest version number shown at https://pypi.org/project/ansible-core/ - ansible-galaxy collection install -r collections.yml # Install ~4 Ansible Collections - echo 'roles_path = ./roles/' >> ansible.cfg # Add correct roles_path to ansible.cfg, appending to https://github.com/iiab/iiab/blob/master/ansible.cfg # - "{ echo '[defaults]'; echo 'roles_path = ./roles/'; } >> ansible.cfg" # 2021-02-24: suddenly no longer works, with the newer ansible-base -> ansible-core install methods above (error arises due to '[defaults]' appearing twice) - cat ansible.cfg # VISUAL VERIFICATION OF ABOVE! - - apt -a list ansible-core # VERIFY ansible-core VERSIONS OFFERED BY apt, from https://launchpad.net/~ansible/+archive/ubuntu/ansible +# - apt -a list ansible-core # VERIFY ansible-core VERSIONS OFFERED BY apt, from https://launchpad.net/~ansible/+archive/ubuntu/ansible script: - ansible-playbook tests/test.yml -i tests/inventory --syntax-check From 3771b910daecda76777b0f9e66943da14edc944e Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 10:14:26 -0400 Subject: [PATCH 23/39] scripts/ansible: Touch up comment --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 9e05ed8c5..9de026042 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -21,7 +21,7 @@ else CODENAME=focal # Debian 11+, RaspiOS 11+, Ubuntu 20.04+, Mint 20+ (ETC) fi -# APRIL 2021 - ansible-base (2.10) is being renamed to ansible-core (2.11+): +# APRIL 2021 - ansible-base (2.10) was renamed to ansible-core (2.11+): # https://www.ansible.com/blog/ansible-3.0.0-qa # https://github.com/ansible/ansible/releases # https://pypi.org/project/ansible-base/ From 56f08958fe82fa7980f53fb75876b4dca93bb80f Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 10:17:37 -0400 Subject: [PATCH 24/39] scripts/ansible: Touch up comment --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 9de026042..5a025070a 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -37,7 +37,7 @@ fi # https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_10.rst # https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_11.rst -# FYI .travis.yml installs ansible-core in a slightly different way (PRs #2689, #2742). +# FYI .travis.yml installs ansible-core in a slightly different way (PRs #2689, #2742 or #2743 ?) # IIAB implementers might instead consider these 4 GENERAL TECHNIQUES below # ("in an emergency!") e.g. if apt fails & you need a newer/older Ansible: From 5b2994ef3357c92e19c02f9e886d843a3dbb7690 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 10:58:01 -0400 Subject: [PATCH 25/39] scripts/ansible: Touch up operator explanation --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 5a025070a..7ea757cbd 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -168,4 +168,4 @@ ansible-galaxy collection install --force-with-deps \ #mkdir -p /etc/ansible # LIKELY REDUNDANT, due to above installation of Ansible #echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts # LIKELY REDUNDANT, due to https://github.com/iiab/iiab/blob/master/ansible_hosts -echo -e "SUCCESS: VERIFY ANSIBLE WITH 'ansible --version' & 'apt -a list ansible-core'\n\n" +echo -e "SUCCESS: VERIFY WITH 'ansible --version' (and 'apt -a list ansible-core' ?)\n\n" From 9b4b31b3697f60e856b351fe4498e0849443e08f Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 11:02:38 -0400 Subject: [PATCH 26/39] scripts/ansible: Fix explanatory URL to scripts/ansible.md --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 7ea757cbd..d1f0068c6 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -140,7 +140,7 @@ 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) echo -e "\napt update; apt install ansible-core and python3 dependencies explained at:" -echo -e "https://github.com/iiab/iiab/tree/master/scripts/ansible.md\n" +echo -e "https://github.com/iiab/iiab/blob/master/scripts/ansible.md\n" $APT_PATH/apt update $APT_PATH/apt -y install python3-pip pip3 install ansible-core From 58ee527fa5b02a7a4471443c6b6a602460744ca7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 11:38:58 -0400 Subject: [PATCH 27/39] Crystal Ball: Explain interim 'pip3 install ansible-core' at top of scripts/ansible --- scripts/ansible | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/ansible b/scripts/ansible index d1f0068c6..eacd3e156 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -11,6 +11,16 @@ 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.11.0 # Orig for 'yum install [rpm]' & XO laptops (pip install) +# 2021-05-19 PR #2743: As a result of Ansible / Red Hat / IBM's extensive +# delays in publishing the PPA (.deb installer files) for ansible-core, this +# file bypasses the apt approach (and associated PPA source) in favor of: +# +# pip3 install ansible-core +# +# What the future holds for 2022+ is not yet clear. So the apt approach (with +# PPA source in /etc/apt/sources.list.d and .gpg key etc) and much associated +# guidance/comments below are NOT being commented out or deleted at this time. + # We install the latest 'ansible-core' from PPA, using an OS 'CODENAME' below: # https://launchpad.net/~ansible/+archive/ubuntu/ansible From 4ac845ca0d976367f72eabe17fb0c49fa2b9edb5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 11:46:29 -0400 Subject: [PATCH 28/39] gitea/tasks/install.yml: Clarify painfully slow download e.g. https://dl.gitea.io/gitea/1.14/gitea-1.14-linux-amd64 --- roles/gitea/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/gitea/tasks/install.yml b/roles/gitea/tasks/install.yml index bc2e447bd..82fe9df0a 100644 --- a/roles/gitea/tasks/install.yml +++ b/roles/gitea/tasks/install.yml @@ -43,7 +43,7 @@ msg: "Could not find a binary for the CPU architecture \"{{ ansible_architecture }}\"" when: gitea_iset_suffix == "unknown" -- name: Download Gitea binary {{ gitea_download_url }} to {{ gitea_install_path }} +- name: Download Gitea binary {{ gitea_download_url }} to {{ gitea_install_path }} (~103 MB, CAN TAKE 20 MIN) get_url: url: "{{ gitea_download_url }}" dest: "{{ gitea_install_path }}" From 750f0492522a6db5e6ebd72d59b95a088dfa2de6 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 11:52:40 -0400 Subject: [PATCH 29/39] nextcloud/tasks/install.yml: Clarify /library/www/nextcloud is ~449 MB (for Nextcloud 21.0.1) --- roles/nextcloud/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/nextcloud/tasks/install.yml b/roles/nextcloud/tasks/install.yml index 1305a86a6..af304bde5 100644 --- a/roles/nextcloud/tasks/install.yml +++ b/roles/nextcloud/tasks/install.yml @@ -94,7 +94,7 @@ state: directory path: "{{ nextcloud_root_dir }}" # /library/www/nextcloud -- name: Unarchive {{ nextcloud_dl_url }} (100+ MB) to {{ nextcloud_root_dir }} (400+ MB, {{ apache_user }}:{{ apache_user }}) +- name: Unarchive {{ nextcloud_dl_url }} (100+ MB) to {{ nextcloud_root_dir }} (~449 MB, {{ apache_user }}:{{ apache_user }}) unarchive: remote_src: yes # Overwrite even if "already exists on the target" src: "{{ nextcloud_dl_url }}" From c26261752f2ff91b923e536b57f8bd629aaddd23 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 12:28:14 -0400 Subject: [PATCH 30/39] Better explain how to verify your Ansible version/installation --- scripts/ansible | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index eacd3e156..3bdf09f8c 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -178,4 +178,7 @@ ansible-galaxy collection install --force-with-deps \ #mkdir -p /etc/ansible # LIKELY REDUNDANT, due to above installation of Ansible #echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts # LIKELY REDUNDANT, due to https://github.com/iiab/iiab/blob/master/ansible_hosts -echo -e "SUCCESS: VERIFY WITH 'ansible --version' (and 'apt -a list ansible-core' ?)\n\n" +echo -e "SUCCESS INSTALLING ANSIBLE! PLEASE VERIFY WITH COMMANDS LIKE:" +echo -e " ansible --version" +echo -e " pip show ansible-core" +echo -e " apt -a list ansible-core\n\n" From cb894b1a6ce27cb15944e05efbe416e508874b02 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 12:53:43 -0400 Subject: [PATCH 31/39] .travis.yml: Refine explanations --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4535fb222..83c8131d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,8 @@ addons: install: # - scripts/ansible # See #2105: fails to install latest Ansible (& ~4 Ansible Collections from collections.yml) due to Travis VM's disk layout/perms being different # - pip3 install ansible # SLOW / OVERWEIGHT: installs Ansible 4.0.0+ superset, with more than 80 (far more than we need) Ansible Collections - - pip3 install ansible-core # SIGNIFICANTLY FASTER than above apt install of ansible-core (in 'packages:' section above). APRIL 2021: ansible-base (2.10) was renamed to ansible-core (2.11+) with the latest version number shown at https://pypi.org/project/ansible-core/ - - ansible-galaxy collection install -r collections.yml # Install ~4 Ansible Collections + - pip3 install ansible-core # SIGNIFICANTLY FASTER than apt install of ansible-core (in 'packages:' section above). APRIL 2021: ansible-base (2.10) was renamed to ansible-core (2.11+) with the latest version number shown at https://pypi.org/project/ansible-core/ + - ansible-galaxy collection install -r collections.yml # Install ~4 Ansible Collections. Slow but nec, as per https://github.com/iiab/iiab/blob/master/scripts/ansible - echo 'roles_path = ./roles/' >> ansible.cfg # Add correct roles_path to ansible.cfg, appending to https://github.com/iiab/iiab/blob/master/ansible.cfg # - "{ echo '[defaults]'; echo 'roles_path = ./roles/'; } >> ansible.cfg" # 2021-02-24: suddenly no longer works, with the newer ansible-base -> ansible-core install methods above (error arises due to '[defaults]' appearing twice) - cat ansible.cfg # VISUAL VERIFICATION OF ABOVE! From 49875747e3a9c752daa20217a96b9bd5412c4c5e Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 13:08:23 -0400 Subject: [PATCH 32/39] IIAB's 4 Ansible Collections shrank from ~37MB to ~24MB --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 3bdf09f8c..b8e64e571 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -170,7 +170,7 @@ ansible-galaxy collection install --force-with-deps \ # 2021-02-24: 'ansible-galaxy collection list' lists those installed. (#2659) # 2020-11-28: The ~3 Ansible Collections used by IIAB (~37MB) once lived here: # /root/.ansible/collections/ansible_collections -# But going forward they'll be stored herein: +# But going forward they'll be stored herein: (~24MB) # /usr/share/ansible/collections/ansible_collections # 2021-04-19: No longer needed, per PR #2743 testing From 1687c41f130d890a92e1e5798b7849ffffaf7ea2 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 13:12:08 -0400 Subject: [PATCH 33/39] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 83c8131d5..437473442 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ addons: # - sourceline: ppa:ansible/ansible packages: # - python-pip # @arky had used this starting in 2018 -# - python3-pip # Modern equivalent (not nec here on Travis?) +# - python3-pip # Modern equivalent (but no need, as pip3 is pre-installed here on Travis) # - ansible-core # SLOW. WHEN IT WORKS AT ALL. Using 'pip3 install ansible-core' instead (below) is faster and greatly simplifies. Certainly let's try to mimic https://github.com/iiab/iiab/blob/master/scripts/ansible (as it evolves) for linting etc? # - python3-pymysql # These 7-or-8 packages (below) are not needed during the very rapid --syntax-check (core script, at bottom) # - python3-psycopg2 From dc48fa0c6b2df6e44486de5523eec267e763be67 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 19 May 2021 15:24:45 -0400 Subject: [PATCH 34/39] scripts/ansible: Clarity ~24MB Collections --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index b8e64e571..98b882729 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -170,7 +170,7 @@ ansible-galaxy collection install --force-with-deps \ # 2021-02-24: 'ansible-galaxy collection list' lists those installed. (#2659) # 2020-11-28: The ~3 Ansible Collections used by IIAB (~37MB) once lived here: # /root/.ansible/collections/ansible_collections -# But going forward they'll be stored herein: (~24MB) +# But going forward they'll be stored herein: [~24MB for 4 Collections as of 2021-05-19] # /usr/share/ansible/collections/ansible_collections # 2021-04-19: No longer needed, per PR #2743 testing From 43b794d9345f85e9f739c82535ccc7aa2ffbc1a0 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 19 May 2021 16:04:54 -0500 Subject: [PATCH 35/39] sock --- roles/lokole/defaults/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/lokole/defaults/main.yml b/roles/lokole/defaults/main.yml index 57ebf510e..4c5965654 100644 --- a/roles/lokole/defaults/main.yml +++ b/roles/lokole/defaults/main.yml @@ -24,7 +24,8 @@ lokole_user: lokole lokole_url: /lokole lokole_uid: "2000" lokole_run_directory: /home/{{ lokole_user }}/state -lokole_domain_socket: "/run/lokole_gunicorn.sock" +lokole_log_directory: /home/{{ lokole_user }}/log +lokole_domain_socket: "{{ lokole_run_directory }}/lokole_gunicorn.sock" lokole_sim_type: LocalOnly lokole_full_url: "http://{{ iiab_hostname }}.{{ iiab_domain }}{{ lokole_url }}" # http://box.lan/lokole From 56a4596cca7624730a86901840b102d913bada8b Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 19 May 2021 13:02:47 -0500 Subject: [PATCH 36/39] need log target --- roles/lokole/tasks/install.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/roles/lokole/tasks/install.yml b/roles/lokole/tasks/install.yml index 638be3181..475105f0d 100644 --- a/roles/lokole/tasks/install.yml +++ b/roles/lokole/tasks/install.yml @@ -83,21 +83,19 @@ file: state: directory path: "{{ lokole_run_directory }}" - #mode: a+x # Not nec, given above 'state: directory' + group: "{{ lokole_user }}" + owner: "{{ lokole_user }}" + mode: u+rw -# lets try to catch settings.env creation at registration time -# can't tell if the routine doesn't like settings.env being missing -- name: mkdir /{{ lokole_user }}/state for registration testing +- name: mkdir /{{ lokole_user }}/log file: state: directory - path: /{{ lokole_user }}/state + path: "{{ lokole_log_directory }}" + group: "{{ lokole_user }}" + owner: "{{ lokole_user }}" + mode: u+rw -- name: Install dummy target for registration testing fake - template: - src: settings.env.j2 - dest: "/{{ lokole_user }}/state/settings.env" - -- name: Install dummy target for registration testing run +- name: Install {{ lokole_run_directory }}/settings.env template: src: settings.env.j2 dest: "{{ lokole_run_directory }}/settings.env" @@ -113,6 +111,9 @@ src: webapp.sh.j2 dest: "{{ lokole_run_directory }}/webapp.sh" mode: a+x + group: "{{ lokole_user }}" + owner: "{{ lokole_user }}" + mode: u+rw - name: Create Lokole admin user with password, for http://box{{ lokole_url }} # http://box/lokole shell: | From be0c12c42b5e6249577248f531b6a6f917cd761f Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 19 May 2021 10:54:03 -0500 Subject: [PATCH 37/39] OPWEN_SETTINGS for settings.env --- roles/lokole/templates/settings.env.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/lokole/templates/settings.env.j2 b/roles/lokole/templates/settings.env.j2 index 81ab2f417..e1d15bdfc 100644 --- a/roles/lokole/templates/settings.env.j2 +++ b/roles/lokole/templates/settings.env.j2 @@ -1,7 +1,8 @@ -OPWEN_SIM_TYPE='{{ lokole_sim_type }}' +OPWEN_SETTINGS='{{ lokole_run_directory }}/settings.env' OPWEN_STATE_DIRECTORY='{{ lokole_run_directory }}' OPWEN_APP_ROOT='{{ lokole_url }}/' OPWEN_MAX_UPLOAD_SIZE_MB=10 OPWEN_SYNC_SCHEDULE='1,16,31,46 * * * *' OPWEN_SESSION_KEY='{{ lookup('password', '/dev/null chars=ascii_letters,digits,_ length=32') }}' OPWEN_PASSWORD_SALT='{{ lookup('password', '/dev/null chars=ascii_letters,digits,_ length=16') }}' +OPWEN_SIM_TYPE='{{ lokole_sim_type }}' From 8aab507a13603e033c5b6fe58acc9cb4f84826a4 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 19 May 2021 10:32:14 -0500 Subject: [PATCH 38/39] EnvironmentFile --- roles/lokole/templates/celery.service.j2 | 1 + roles/lokole/templates/celerybeat.service.j2 | 1 + roles/lokole/templates/lokole.service.j2 | 1 + roles/lokole/templates/lokole_restarter.service.j2 | 1 + 4 files changed, 4 insertions(+) diff --git a/roles/lokole/templates/celery.service.j2 b/roles/lokole/templates/celery.service.j2 index 49a2dd64b..7a9ff74c9 100644 --- a/roles/lokole/templates/celery.service.j2 +++ b/roles/lokole/templates/celery.service.j2 @@ -6,6 +6,7 @@ Before=celerybeat.service [Service] Type=simple +EnvironmentFile={{ lokole_run_directory }}/settings.env ExecStart={{ lokole_venv }}/bin/celery --uid={{ lokole_uid }} --gid={{ lokole_uid }} --app=opwen_email_client.webapp.tasks worker --loglevel=info --concurrency=2 ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill TERM $MAINPID diff --git a/roles/lokole/templates/celerybeat.service.j2 b/roles/lokole/templates/celerybeat.service.j2 index 07d570590..a5164d09a 100644 --- a/roles/lokole/templates/celerybeat.service.j2 +++ b/roles/lokole/templates/celerybeat.service.j2 @@ -6,6 +6,7 @@ Before=lokole_restarter.service [Service] Type=simple +EnvironmentFile={{ lokole_run_directory }}/settings.env ExecStart={{ lokole_venv }}/bin/celery --app=opwen_email_client.webapp.tasks beat --loglevel=info [Install] diff --git a/roles/lokole/templates/lokole.service.j2 b/roles/lokole/templates/lokole.service.j2 index 29643cabd..7ab4c935e 100644 --- a/roles/lokole/templates/lokole.service.j2 +++ b/roles/lokole/templates/lokole.service.j2 @@ -5,6 +5,7 @@ After=network.target [Service] Type=simple +EnvironmentFile={{ lokole_run_directory }}/settings.env ExecStart=/bin/bash {{ lokole_run_directory }}/webapp.sh ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID diff --git a/roles/lokole/templates/lokole_restarter.service.j2 b/roles/lokole/templates/lokole_restarter.service.j2 index 12aa52471..a9c2ed875 100644 --- a/roles/lokole/templates/lokole_restarter.service.j2 +++ b/roles/lokole/templates/lokole_restarter.service.j2 @@ -5,6 +5,7 @@ After=celerybeat.service [Service] Type=simple +EnvironmentFile={{ lokole_run_directory }}/settings.env WorkingDirectory={{ lokole_run_directory }} ExecStart={{ lokole_venv }}/bin/manage.py restarter --directory={{ lokole_run_directory }} From 20cdf44981a2fa22e5a00d91917fa14797ca9334 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 19 May 2021 18:50:53 -0500 Subject: [PATCH 39/39] parms --- roles/lokole/tasks/install.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/lokole/tasks/install.yml b/roles/lokole/tasks/install.yml index 475105f0d..5742486c1 100644 --- a/roles/lokole/tasks/install.yml +++ b/roles/lokole/tasks/install.yml @@ -85,7 +85,7 @@ path: "{{ lokole_run_directory }}" group: "{{ lokole_user }}" owner: "{{ lokole_user }}" - mode: u+rw + mode: g+rw - name: mkdir /{{ lokole_user }}/log file: @@ -93,12 +93,15 @@ path: "{{ lokole_log_directory }}" group: "{{ lokole_user }}" owner: "{{ lokole_user }}" - mode: u+rw + mode: g+rw - name: Install {{ lokole_run_directory }}/settings.env template: src: settings.env.j2 dest: "{{ lokole_run_directory }}/settings.env" + group: "{{ lokole_user }}" + owner: "{{ lokole_user }}" + mode: a+rw - name: Install {{ lokole_run_directory }}/webapp_secrets.sh from template, to configure Lokole template: @@ -110,10 +113,9 @@ template: src: webapp.sh.j2 dest: "{{ lokole_run_directory }}/webapp.sh" - mode: a+x group: "{{ lokole_user }}" owner: "{{ lokole_user }}" - mode: u+rw + mode: a+x - name: Create Lokole admin user with password, for http://box{{ lokole_url }} # http://box/lokole shell: |