From 098593524c63a192e1d65cce41f82150993e9a1c Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 21 Jun 2018 15:32:43 -0400 Subject: [PATCH 001/374] phpMyAdmin 4.8.1 -> 4.8.2 security fix --- roles/phpmyadmin/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/phpmyadmin/defaults/main.yml b/roles/phpmyadmin/defaults/main.yml index 2779db9eb..57f820564 100644 --- a/roles/phpmyadmin/defaults/main.yml +++ b/roles/phpmyadmin/defaults/main.yml @@ -1,4 +1,4 @@ phpmyadmin_install: False phpmyadmin_enabled: False -phpmyadmin_name: "phpMyAdmin-4.8.1-all-languages" +phpmyadmin_name: "phpMyAdmin-4.8.2-all-languages" phpmyadmin_name_zip: "{{ phpmyadmin_name }}.zip" From 3a56685f6c49332a76ccf624fa295faa79eef8bc Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 21 Jun 2018 15:59:46 -0400 Subject: [PATCH 002/374] recommend Ansible 2.5.5 --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 27a992211..d033c8f1d 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -5,7 +5,7 @@ echo -e 'Ensure you'"'"'re online before running this! (/opt/iiab/iiab/scripts/a echo -e 'INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch' echo -e 'ALTERNATIVES: Consider scripts/ansible-2.5.x "slow food" instead.\n' -GOOD_VER="2.5.4" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.5.5" # Ansible version for OLPC XO laptops (pip install). # On other OS's we install/upgrade to THE latest (released version of) Ansible. CURR_VER="undefined" # below are unused for future use From a35aed79df6ac5d45e8670e3ac70e263171b3d89 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 21 Jun 2018 16:00:03 -0400 Subject: [PATCH 003/374] recommend Ansible 2.5.5 --- scripts/ansible-2.5.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.5.x b/scripts/ansible-2.5.x index 7f5c2f429..3f4a3c3a4 100755 --- a/scripts/ansible-2.5.x +++ b/scripts/ansible-2.5.x @@ -5,7 +5,7 @@ echo -e 'Ensure you'"'"'re online before running this! (/opt/iiab/iiab/scripts/a echo -e 'INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch' echo -e 'ALTERNATIVE: Consider scripts/ansible to keep up-to-date as Ansible evolves.\n' -GOOD_VER="2.5.4" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.5.5" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade/pin to the latest Ansible 2.5.x CURR_VER="undefined" # below are unused for future use From 6dfeefeaed49dfaafcdb70638800ff0d5d478875 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 27 Jun 2018 13:21:00 -0400 Subject: [PATCH 004/374] Update ansible --- scripts/ansible | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index d033c8f1d..e3b4044ed 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -1,11 +1,16 @@ #!/bin/bash -e -echo -e '\nATTEMPTING TO INSTALL THE LATEST (RELEASED VERSION OF) ANSIBLE.' -echo -e 'Ensure you'"'"'re online before running this! (/opt/iiab/iiab/scripts/ansible)' -echo -e 'INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch' -echo -e 'ALTERNATIVES: Consider scripts/ansible-2.5.x "slow food" instead.\n' +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' -GOOD_VER="2.5.5" # Ansible version for OLPC XO laptops (pip install). +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 'ALTERNATIVES: Run scripts/ansible-2.5.x or scripts/ansible-2.6.x "sloww food".\n\n' + + +GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). # On other OS's we install/upgrade to THE latest (released version of) Ansible. CURR_VER="undefined" # below are unused for future use @@ -19,7 +24,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 http://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.5.0-1.el7.ans.noarch.rpm + yum -y install http://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.6.0-1.el7.ans.noarch.rpm # elif [ -f /etc/fedora-release ]; then # CURR_VER=`grep VERSION_ID /etc/*elease | cut -d= -f2` # URL=https://github.com/jvonau/iiab/blob/ansible/vars/fedora-$CURR_VER.yml From 232891f82693bf38cc572abfd05c9ed96f705371 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 27 Jun 2018 13:22:15 -0400 Subject: [PATCH 005/374] Update ansible-2.5.x --- scripts/ansible-2.5.x | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/ansible-2.5.x b/scripts/ansible-2.5.x index 3f4a3c3a4..d25923a7c 100755 --- a/scripts/ansible-2.5.x +++ b/scripts/ansible-2.5.x @@ -1,9 +1,14 @@ #!/bin/bash -e -echo -e '\nATTEMPTING TO INSTALL THE LATEST ANSIBLE 2.5.x' -echo -e 'Ensure you'"'"'re online before running this! (/opt/iiab/iiab/scripts/ansible-2.5.x)' -echo -e 'INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch' -echo -e 'ALTERNATIVE: Consider scripts/ansible to keep up-to-date as Ansible evolves.\n' +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 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n' + +echo -e 'NOW ATTEMPTING TO INSTALL THE LATEST ANSIBLE 2.5.x:' +echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/ansible-2.5.x)\n' + +echo -e 'ALTERNATIVES: Run scripts/ansible-2.6.x, or scripts/ansible for the latest.\n\n' + GOOD_VER="2.5.5" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade/pin to the latest Ansible 2.5.x From 58c40d9bb434cb4353aefec5bfc12548abdfabf2 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 27 Jun 2018 13:23:37 -0400 Subject: [PATCH 006/374] Create ansible-2.6.x --- scripts/ansible-2.6.x | 100 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 scripts/ansible-2.6.x diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x new file mode 100644 index 000000000..a7228ccb9 --- /dev/null +++ b/scripts/ansible-2.6.x @@ -0,0 +1,100 @@ +#!/bin/bash -e + +echo -e '\n\nSTRONGLY RECOMMENDED PREREQUISITE: (1) remove all prior versions of Ansible using "apt purge ansible" and/or "pip uninstall ansible" and (2) clear out all lines containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n' + +echo -e '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 'ALTERNATIVES: Run scripts/ansible-2.5.x, or scripts/ansible for the latest.\n\n' + + +GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). + # On other OS's we attempt to install/upgrade/pin to the latest Ansible 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 "Installing --- Please Wait" + if [ -f /etc/centos-release ]; then + yum -y install ca-certificates nss epel-release + yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python + yum -y install python-pip python-setuptools python-wheel patch + yum -y install http://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.6.0-1.el7.ans.noarch.rpm +# elif [ -f /etc/fedora-release ]; then +# CURR_VER=`grep VERSION_ID /etc/*elease | cut -d= -f2` +# URL=https://github.com/jvonau/iiab/blob/ansible/vars/fedora-$CURR_VER.yml +# dnf -y install ansible git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python +# dnf -y install python-pip python-setuptools python-wheel patch + elif [ -f /etc/olpc-release ]; then + yum -y install ca-certificates nss + yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python + yum -y install python-pip python-setuptools python-wheel patch + pip install --upgrade pip setuptools wheel #EOL just do it + pip install ansible==$GOOD_VER --disable-pip-version-check + # Parens are optional, but greatly clarify :) + elif (grep -qi ubuntu /etc/lsb-release 2> /dev/null) || (grep -qi ubuntu /etc/os-release); then + apt -y install python-pip python-setuptools python-wheel patch + #apt-add-repository -y ppa:ansible/ansible + apt-add-repository -y ppa:ansible/ansible-2.6 + # elif UBUNTU MUST REMAIN ABOVE (as Ubuntu ALSO contains /etc/debian_version, which would trigger the line just below) + elif [ -f /etc/debian_version ] || (grep -qi raspbian /etc/*elease) ; then + if ( ! grep -qi ansible /etc/apt/sources.list) && [ ! -f /etc/apt/sources.list.d/ansible ]; then + apt update + #apt -y install dirmngr python-pip python-setuptools python-wheel patch + apt -y install dirmngr + #echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \ + # >> /etc/apt/sources.list.d/iiab-ansible.list + echo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" \ + >> /etc/apt/sources.list.d/iiab-ansible.list + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 + fi + else + echo "WARN: Could not detect distro or distro unsupported" + exit 1 + fi +else + #CURR_VER=`ansible --version | head -n 1 | cut -f 2 -d " "` + CURR_VER=`ansible --version | head -1 | awk '{print $2}'` # to match iiab-install + echo "Currently installed Ansible version is: $CURR_VER" + echo -e "INTERNET-IN-A-BOX GENERALLY REQUIRES ANSIBLE VERSION: $GOOD_VER or higher\n" + if [ -f /etc/centos-release ] || [ -f /etc/fedora-release ]; then + echo "Please use your system's package manager (or pip if nec) to update Ansible." + exit 0 + elif [ -f /etc/olpc-release ]; then + echo "Please use pip package manager to update Ansible." + exit 0 + #fi + #if [[ `grep -qi ansible /etc/apt/sources.list` ]] || [ -f /etc/apt/sources.list.d/ansible*.list ]; then + elif (grep -qi ansible /etc/apt/sources.list) || (ls /etc/apt/sources.list.d/*ansible*.list >/dev/null 2>&1) ; then + #echo "Ansible repo(s) found within /etc/apt/sources.list*" + echo -e 'MANUAL INTERVENTION URGED:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- MUST CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible-2.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' + else + echo -e 'Upstream ansible source repo not found:\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.' + exit 1 + fi +fi + +if [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && [ ! -f /etc/olpc-release ]; then + # Align IIAB with Ansible community's latest official release + echo "Using apt to check for updates, then install/upgrade ansible" + apt update + apt -y --allow-downgrades install ansible=2.6* + + # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") + #pip install ansible==2.4.4 + + # TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. DETAILS @ https://github.com/iiab/iiab/issues/669 + #echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb" + #cd /tmp + #wget http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb + #apt -y --allow-downgrades install ./ansible_2.4.2.0-1ppa~xenial_all.deb +fi + +# needed? +mkdir -p /etc/ansible/ +echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts From 01fa258c47b205454e13eb18669ca1a98d7364c2 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 Jun 2018 14:37:06 -0400 Subject: [PATCH 007/374] scripts/ansible-2.6.x 644 -> 755 --- scripts/ansible-2.6.x | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/ansible-2.6.x diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x old mode 100644 new mode 100755 From 4a6d40408290f5dff1d26018dc5523d3d39e5e5e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 Jun 2018 14:55:19 -0400 Subject: [PATCH 008/374] WARN operator: re-run apt-key if keyserver.ubuntu.com network/mirror fails --- scripts/ansible | 2 ++ scripts/ansible-2.5.x | 2 ++ scripts/ansible-2.6.x | 2 ++ 3 files changed, 6 insertions(+) diff --git a/scripts/ansible b/scripts/ansible index e3b4044ed..0bae4bb13 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -2,6 +2,8 @@ echo -e '\n\nSTRONGLY RECOMMENDED PREREQUISITE: (1) remove all prior versions of Ansible using "apt purge ansible" and/or "pip uninstall ansible" and (2) clear out all lines containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n' +echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirror.\n' + echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n' echo -e 'NOW ATTEMPTING TO INSTALL THE LATEST ANSIBLE:' diff --git a/scripts/ansible-2.5.x b/scripts/ansible-2.5.x index d25923a7c..d982244f1 100755 --- a/scripts/ansible-2.5.x +++ b/scripts/ansible-2.5.x @@ -2,6 +2,8 @@ echo -e '\n\nSTRONGLY RECOMMENDED PREREQUISITE: (1) remove all prior versions of Ansible using "apt purge ansible" and/or "pip uninstall ansible" and (2) clear out all lines containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n' +echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirror.\n' + echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n' echo -e 'NOW ATTEMPTING TO INSTALL THE LATEST ANSIBLE 2.5.x:' diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x index a7228ccb9..1c2c7f05a 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -2,6 +2,8 @@ echo -e '\n\nSTRONGLY RECOMMENDED PREREQUISITE: (1) remove all prior versions of Ansible using "apt purge ansible" and/or "pip uninstall ansible" and (2) clear out all lines containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n' +echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirror.\n' + echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n' echo -e 'NOW ATTEMPTING TO INSTALL THE LATEST ANSIBLE 2.6.x:' From 92d2813de897e181448bb6cb0df22150f6f1b8e3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 27 Jun 2018 16:52:14 -0400 Subject: [PATCH 009/374] Update main.yml --- roles/calibre/tasks/main.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 74c10c428..722012e7c 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -5,14 +5,15 @@ path: "/usr/bin/calibre" register: calib_executable -- name: Install Calibre via OS's package installer (IF /usr/bin/calibre MISSING) - package: - name: "{{ item }}" - state: latest - with_items: - - calibre - - calibre-bin - when: internet_available and (not calib_executable.stat.exists) +# The 8 lines below appear unecessary as of 2018-06-26 -- as tested on RPi. +#- name: Install Calibre via OS's package installer (IF /usr/bin/calibre MISSING) +# package: +# name: "{{ item }}" +# state: latest +# with_items: +# - calibre +# - calibre-bin +# when: internet_available and (not calib_executable.stat.exists) - name: Install Calibre experimental .debs IF calibre_via_debs (AND /usr/bin/calibre WAS MISSING) include_tasks: debs.yml From d45560d28dd0146adb4fd149f83198ed15caf379 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Jun 2018 20:09:15 -0400 Subject: [PATCH 010/374] Update ansible --- scripts/ansible | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 0bae4bb13..c60d6306c 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.5.x or scripts/ansible-2.6.x "sloww food".\n\n' -GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.5.5" # Ansible version for OLPC XO laptops (pip install). # On other OS's we install/upgrade to THE latest (released 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 http://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.6.0-1.el7.ans.noarch.rpm + yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.5.5-1.el7.ans.noarch.rpm # elif [ -f /etc/fedora-release ]; then # CURR_VER=`grep VERSION_ID /etc/*elease | cut -d= -f2` # URL=https://github.com/jvonau/iiab/blob/ansible/vars/fedora-$CURR_VER.yml From c0dcb0a62cb9a5ce80fdd4f3c1a998e72af157b4 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Jun 2018 20:09:52 -0400 Subject: [PATCH 011/374] Update ansible-2.5.x --- scripts/ansible-2.5.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.5.x b/scripts/ansible-2.5.x index d982244f1..fbf613b36 100755 --- a/scripts/ansible-2.5.x +++ b/scripts/ansible-2.5.x @@ -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 http://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.5.0-1.el7.ans.noarch.rpm + yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.5.5-1.el7.ans.noarch.rpm # elif [ -f /etc/fedora-release ]; then # CURR_VER=`grep VERSION_ID /etc/*elease | cut -d= -f2` # URL=https://github.com/jvonau/iiab/blob/ansible/vars/fedora-$CURR_VER.yml From 336afea29d90cbb317aa748bdbc85106b0280f02 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Jun 2018 20:11:35 -0400 Subject: [PATCH 012/374] 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 1c2c7f05a..4e6b99638 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-2.5.x, or scripts/ansible for the latest.\n\n' -GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.5.5" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade/pin to the latest Ansible 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 http://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.6.0-1.el7.ans.noarch.rpm + yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.5.5-1.el7.ans.noarch.rpm # elif [ -f /etc/fedora-release ]; then # CURR_VER=`grep VERSION_ID /etc/*elease | cut -d= -f2` # URL=https://github.com/jvonau/iiab/blob/ansible/vars/fedora-$CURR_VER.yml From 448a90d0f5440ee74a2147f95dfb3b65f90d61cb Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Jun 2018 20:56:29 -0400 Subject: [PATCH 013/374] revise recommendation from 2.5.5 to 2.6.0 --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index c60d6306c..5b8e7e497 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.5.x or scripts/ansible-2.6.x "sloww food".\n\n' -GOOD_VER="2.5.5" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). # On other OS's we install/upgrade to THE latest (released version of) Ansible. CURR_VER="undefined" # below are unused for future use From 7a3e0b989fc2d6fff216e2dc9069dede0c843f74 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Jun 2018 20:56:57 -0400 Subject: [PATCH 014/374] revise recommendation from 2.5.5 to 2.6.0 --- scripts/ansible-2.5.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.5.x b/scripts/ansible-2.5.x index fbf613b36..7e3ea082f 100755 --- a/scripts/ansible-2.5.x +++ b/scripts/ansible-2.5.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-2.6.x, or scripts/ansible for the latest.\n\n' -GOOD_VER="2.5.5" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade/pin to the latest Ansible 2.5.x CURR_VER="undefined" # below are unused for future use From 1e9a063dec851cd5a34443685d7f56210fb016f5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Jun 2018 20:57:14 -0400 Subject: [PATCH 015/374] revise recommendation from 2.5.5 to 2.6.0 --- 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 4e6b99638..0143115f4 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-2.5.x, or scripts/ansible for the latest.\n\n' -GOOD_VER="2.5.5" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade/pin to the latest Ansible 2.6.x CURR_VER="undefined" # below are unused for future use From 2eb532a28d2c5fca6fa936ffc584be4c486e5bea Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Jun 2018 21:21:04 -0400 Subject: [PATCH 016/374] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 5b8e7e497..9db7818b0 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.5.x or scripts/ansible-2.6.x "sloww food".\n\n' +echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x or scripts/ansible-2.6.x "slow food".\n\n' GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). From ebef5779ff68c2e06f9dd83be0910b1c754f6fdb Mon Sep 17 00:00:00 2001 From: Anish Mangal Date: Fri, 29 Jun 2018 12:11:10 +0530 Subject: [PATCH 017/374] Remove Travis tag --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b8c20f5b..3de62a82f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Internet-in-a-Box (IIAB) [![Build Status](https://travis-ci.org/iiab/iiab.svg?branch=master)](https://travis-ci.org/iiab/iiab) +# Internet-in-a-Box (IIAB) Welcome to the Git repository of the Internet-in-a-Box (IIAB) project. This is a community-based project developed and supported by volunteers from around the world. The Internet-in-a-Box (IIAB) is small, inexpensive device which provides essential Internet resources (like Wikipedia, OpenStreetMap, Khan Academy and others) without any Internet connection. It provides a local content server of the world’s Free Knowledge. From b04a6147e960f7e4ec6e7e9454cd46389146ff87 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Jun 2018 17:40:50 -0400 Subject: [PATCH 018/374] typo in comment: counry -> country --- roles/network/tasks/rpi_debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/tasks/rpi_debian.yml b/roles/network/tasks/rpi_debian.yml index 406c70e07..e56f8806e 100644 --- a/roles/network/tasks/rpi_debian.yml +++ b/roles/network/tasks/rpi_debian.yml @@ -20,7 +20,7 @@ dest: /etc/dhcpcd.conf src: network/dhcpcd.conf.j2 -- name: New raspbian requires counry code -- check for it +- name: New raspbian requires country code -- check for it shell: grep country /etc/wpa_supplicant/wpa_supplicant.conf register: country_code ignore_errors: True From cd112cd8c32e635c543bc4b145b7e9884c92ae3e Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 2 Jul 2018 08:01:28 -0400 Subject: [PATCH 019/374] Update main.yml --- roles/kiwix/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index 4e3fe36ae..04a8c291b 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -12,7 +12,7 @@ kiwix_version_i686: "kiwix-tools_linux-x86_64-0.6.0" kiwix_src_file_armhf: "{{ kiwix_version_armhf }}.tar.gz" kiwix_src_file_linux64: "{{ kiwix_version_linux64 }}.tar.gz" -kiwix_src_file_i686: "{{ kiwix_version_i686 }}.tar.bz2" +kiwix_src_file_i686: "{{ kiwix_version_i686 }}.tar.gz" kiwix_port: 3000 # Expected to be used soon for Kiwix proxy: From 80c9d62e438413f8674086023405dd8cfd4d0b35 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 2 Jul 2018 08:24:27 -0400 Subject: [PATCH 020/374] Update main.yml --- roles/kiwix/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index 673ef7ef9..b80baa656 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -2,21 +2,21 @@ set_fact: kiwix_src_dir: "{{ kiwix_version_armhf }}" kiwix_src_file: "{{ kiwix_src_file_armhf }}" - kiwix_src_contains_bin: False +# kiwix_src_contains_bin: False when: ansible_machine == "armv7l" or ansible_machine == "armv6l" - name: "Set Kiwix filename to d/l: {{ kiwix_src_file_linux64 }} (x86_64)" set_fact: kiwix_src_dir: "{{ kiwix_version_linux64 }}" kiwix_src_file: "{{ kiwix_src_file_linux64 }}" - kiwix_src_contains_bin: False +# kiwix_src_contains_bin: False when: ansible_machine == "x86_64" - name: "Set Kiwix filename to d/l: {{ kiwix_src_file_i686 }} (i686)" set_fact: kiwix_src_dir: "{{ kiwix_version_i686 }}" kiwix_src_file: "{{ kiwix_src_file_i686 }}" - kiwix_src_contains_bin: True +# kiwix_src_contains_bin: True when: ansible_machine == "i686" # COMMENT OUT LINE ABOVE TO TEST i686 CODE PATH ON X86_64 (WORKS NOV 2017) From 1b612521f9a25da0428dfc7b8cf1931ce5971ad0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 2 Jul 2018 08:26:26 -0400 Subject: [PATCH 021/374] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index f08b9a7f2..956812ac7 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -60,7 +60,8 @@ # 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install # (We get a whole web server for i686 but only kiwix execs for linux64 & armhf) -- name: Unarchive kiwix-tools .tar.gz or .tar.bz2 to /tmp +#- name: Unarchive kiwix-tools .tar.gz or .tar.bz2 to /tmp +- name: Unarchive kiwix-tools .tar.gz to /tmp unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" dest: /tmp @@ -68,13 +69,13 @@ group: root when: kiwix_force_install -- name: Move /tmp/{{ kiwix_src_dir }}/* to permanent location /opt/iiab/kiwix/bin (armhf & linux64) +- name: Move /tmp/{{ kiwix_src_dir }}/* to permanent location /opt/iiab/kiwix/bin (armhf & linux64 & i686) shell: "mv /tmp/{{ kiwix_src_dir }}/* {{ kiwix_path }}/bin/" - when: kiwix_force_install and not kiwix_src_contains_bin +# when: kiwix_force_install and not kiwix_src_contains_bin -- name: Move /tmp/{{ kiwix_src_dir }}/bin/* to permanent location /opt/iiab/kiwix/bin (i686) - shell: "mv /tmp/{{ kiwix_src_dir }}/bin/* {{ kiwix_path }}/bin/" - when: kiwix_force_install and kiwix_src_contains_bin +#- name: Move /tmp/{{ kiwix_src_dir }}/bin/* to permanent location /opt/iiab/kiwix/bin (i686) +# shell: "mv /tmp/{{ kiwix_src_dir }}/bin/* {{ kiwix_path }}/bin/" +# when: kiwix_force_install and kiwix_src_contains_bin #- name: Unarchive Kiwix binaries to permanent location (NOT i686) # unarchive: From aeacbe60caae6e65bd64994a4ca2eb2668cade7f Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Tue, 3 Jul 2018 09:00:45 -0500 Subject: [PATCH 022/374] tweaking iptables for captive portal --- .../templates/gateway/iiab-gen-iptables | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/roles/network/templates/gateway/iiab-gen-iptables b/roles/network/templates/gateway/iiab-gen-iptables index 7ec8f3bf0..3b9e8959a 100755 --- a/roles/network/templates/gateway/iiab-gen-iptables +++ b/roles/network/templates/gateway/iiab-gen-iptables @@ -105,8 +105,9 @@ if [ "$gw_block_https" == "True" ]; then fi # Allow outgoing connections from the LAN side. -$IPTABLES -A FORWARD -i $lan -o $wan -j ACCEPT - +if ! [ "$captive_portal_enabled" == "True" ];then + $IPTABLES -A FORWARD -i $lan -o $wan -j ACCEPT +fi # Don't forward from the outside to the inside. $IPTABLES -A FORWARD -i $wan -o $lan -j DROP $IPTABLES -A INPUT -i $wan -j DROP @@ -116,14 +117,17 @@ if [ "$block_DNS" == "True" ];then $IPTABLES -t nat -A PREROUTING -i $lan -p udp --dport 53 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:53 fi +#if [ "$captive_portal_enabled" == "True" ];then +# $IPTABLES -t mangle -N internet +# $IPTABLES -t mangle -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m tcp --dport 80 -j internet +# $IPTABLES -t mangle -A internet -j MARK --set-mark 99 +# $IPTABLES -t nat -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m mark --mark 99 -m tcp --dport 80 -j DNAT --to-destination {{ lan_ip }}: + if [ "$captive_portal_enabled" == "True" ];then - $IPTABLES -t mangle -N internet - $IPTABLES -t mangle -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m tcp --dport 80 -j internet - $IPTABLES -t mangle -A internet -j MARK --set-mark 99 - $IPTABLES -t nat -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m mark --mark 99 -m tcp --dport 80 -j DNAT --to-destination {{ lan_ip }} + $IPTABLES -t nat -A PREROUTING -i $lan -p tcp --dport 80 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:9090 elif [ "$HTTPCACHE_ON" == "True" ]; then - $IPTABLES -t nat -A PREROUTING -i $lan -p tcp --dport 80 ! -d 172.18.96.1 -j DNAT --to 172.18.96.1:3128 + $IPTABLES -t nat -A PREROUTING -i $lan -p tcp --dport 80 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:3128 fi # Enable routing. From 74fb19864f001892f2378bd12090cc7274f6316b Mon Sep 17 00:00:00 2001 From: Anish Mangal Date: Wed, 4 Jul 2018 12:42:10 +0000 Subject: [PATCH 023/374] Initial working copy of the captive portal --- roles/network/defaults/main.yml | 7 ++ roles/network/tasks/captive_portal.yml | 37 +++++++ roles/network/tasks/main.yml | 8 ++ .../captive_portal/captive_portal.py.j2 | 97 +++++++++++++++++++ .../captive_portal/captive_portal.service.j2 | 15 +++ 5 files changed, 164 insertions(+) create mode 100644 roles/network/tasks/captive_portal.yml create mode 100755 roles/network/templates/captive_portal/captive_portal.py.j2 create mode 100644 roles/network/templates/captive_portal/captive_portal.service.j2 diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 4524918df..2fb7bc256 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -71,3 +71,10 @@ named_enabled: True dnsmasq_enabled: False dnsmasq_install: False captive_portal_enabled: False + +# for simple python captive portal +py_captive_portal_install: True +py_captive_portal_enabled: True +captive_portal_port: "9090" +captive_portal_username: "Admin" +captive_portal_password: "g0adm1n" diff --git a/roles/network/tasks/captive_portal.yml b/roles/network/tasks/captive_portal.yml new file mode 100644 index 000000000..73176709c --- /dev/null +++ b/roles/network/tasks/captive_portal.yml @@ -0,0 +1,37 @@ +- name: Create directory for captive portal script + file: path=/opt/iiab/captive-portal state=directory + when: py_captive_portal_install + +- name: Copy captive portal script + template: + src: roles/network/templates/captive_portal/captive_portal.py.j2 + dest: /opt/iiab/captive-portal/captive_portal.py + owner: iiab-admin + group: iiab-admin + mode: 0740 + when: py_captive_portal_install + +- name: Copy captive portal service file + template: + src: roles/network/templates/captive_portal/captive_portal.service.j2 + dest: /etc/systemd/system/captive_portal.service + owner: iiab-admin + group: iiab-admin + mode: 0644 + when: py_captive_portal_install + +- name: Enable captive_portal after copying files + service: name=captive_portal.service enabled=yes + when: py_captive_portal_install and py_captive_portal_enabled + +- name: Start captive_portal after copying files + service: name=captive_portal.service state=started + when: py_captive_portal_install and py_captive_portal_enabled + +- name: Disable captive_portal after copying files + service: name=captive_portal.service enabled=no + when: py_captive_portal_install and py_captive_portal_enabled + +- name: Stop captive_portal after copying files + service: name=captive_portal.service state=started + when: py_captive_portal_install and py_captive_portal_enabled diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 6e73f7d4c..959c0b368 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -74,6 +74,14 @@ include_tasks: squid.yml when: FQDN_changed and squid_install and iiab_stage|int == 9 +#- name: FOREFULLY ENABLE CAPTIVE PORTAL +# set_fact: +# py_captive_portal_install: True + +- name: (Re)Installing captive portal + include_tasks: captive_portal.yml + when: py_captive_portal_install + #### start services - include_tasks: avahi.yml tags: diff --git a/roles/network/templates/captive_portal/captive_portal.py.j2 b/roles/network/templates/captive_portal/captive_portal.py.j2 new file mode 100755 index 000000000..c6021d87c --- /dev/null +++ b/roles/network/templates/captive_portal/captive_portal.py.j2 @@ -0,0 +1,97 @@ +#!/usr/bin/python + +# Captive portal script adapted from https://github.com/nikosft/captive-portal + +import subprocess +import BaseHTTPServer +import cgi + +# These variables are used as settings +PORT = int("{{ captive_portal_port }}") # the port in which the captive portal web server listens +IFACE = "{{ iiab_lan_iface }}" # the interface that captive portal protects +IP_ADDRESS = "172.18.96.1" # the ip address of the captive portal (it can be the IP of IFACE) + +''' +This it the http server used by the the captive portal +''' +class CaptivePortal(BaseHTTPServer.BaseHTTPRequestHandler): + #this is the index of the captive portal + #it simply redirects the user to the to login page + html_redirect = """ + + + + + + Redirecting to login page + + + """%(IP_ADDRESS, PORT) + #the login page + html_login = """ + + + Login Form +
+ Username:
+ Password:
+ +
+ + + """ + + ''' + if the user requests the login page show it, else + use the redirect page + ''' + def do_GET(self): + path = self.path + self.send_response(200) + self.send_header("Content-type", "text/html") + self.end_headers() + if path == "/login": + self.wfile.write(self.html_login) + else: + self.wfile.write(self.html_redirect) + ''' + this is called when the user submits the login form + ''' + def do_POST(self): + self.send_response(200) + self.send_header("Content-type", "text/html") + self.end_headers() + form = cgi.FieldStorage( + fp=self.rfile, + headers=self.headers, + environ={'REQUEST_METHOD':'POST', + 'CONTENT_TYPE':self.headers['Content-Type'], + }) + username = form.getvalue("username") + password = form.getvalue("password") + #dummy security check + if username == '{{ captive_portal_username }}' and password == '{{ captive_portal_password }}': + #authorized user + remote_IP = self.client_address[0] + print 'New authorization from '+ remote_IP + print 'Updating IP tables' + subprocess.call(["iptables","-t", "nat", "-I", "PREROUTING","1", "-s", remote_IP, "-j" ,"ACCEPT"]) + subprocess.call(["iptables", "-I", "FORWARD", "-s", remote_IP, "-j" ,"ACCEPT"]) + self.wfile.write("You are now authorized. Navigate to any URL") + else: + #show the login form + self.wfile.write(self.html_login) + + #the following function makes server produce no output + #comment it out if you want to print diagnostic messages + #def log_message(self, format, *args): + # return + +print "Starting captive portal web server" +httpd = BaseHTTPServer.HTTPServer(('', PORT), CaptivePortal) + +try: + httpd.serve_forever() +except KeyboardInterrupt: + pass +httpd.server_close() diff --git a/roles/network/templates/captive_portal/captive_portal.service.j2 b/roles/network/templates/captive_portal/captive_portal.service.j2 new file mode 100644 index 000000000..77a055cb4 --- /dev/null +++ b/roles/network/templates/captive_portal/captive_portal.service.j2 @@ -0,0 +1,15 @@ +[Unit] +Description=Captive portal +After=syslog.target + +[Service] +Type=simple +User=iiab-admin +Group=iiab-admin +WorkingDirectory=/opt/iiab/captive-portal +ExecStart=/opt/iiab/captive-portal/captive_portal.py +StandardOutput=syslog +StandardError=syslog + +[Install] +WantedBy=multi-user.target From 5674675ef9fbc5dad99f7a4abc1354015203acf6 Mon Sep 17 00:00:00 2001 From: Anish Mangal Date: Wed, 4 Jul 2018 12:56:16 +0000 Subject: [PATCH 024/374] captive_portal service must run as root --- roles/network/tasks/captive_portal.yml | 8 ++++---- .../templates/captive_portal/captive_portal.service.j2 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/network/tasks/captive_portal.yml b/roles/network/tasks/captive_portal.yml index 73176709c..8dad37fa7 100644 --- a/roles/network/tasks/captive_portal.yml +++ b/roles/network/tasks/captive_portal.yml @@ -6,8 +6,8 @@ template: src: roles/network/templates/captive_portal/captive_portal.py.j2 dest: /opt/iiab/captive-portal/captive_portal.py - owner: iiab-admin - group: iiab-admin + owner: root + group: root mode: 0740 when: py_captive_portal_install @@ -15,8 +15,8 @@ template: src: roles/network/templates/captive_portal/captive_portal.service.j2 dest: /etc/systemd/system/captive_portal.service - owner: iiab-admin - group: iiab-admin + owner: root + group: root mode: 0644 when: py_captive_portal_install diff --git a/roles/network/templates/captive_portal/captive_portal.service.j2 b/roles/network/templates/captive_portal/captive_portal.service.j2 index 77a055cb4..03f3c33d5 100644 --- a/roles/network/templates/captive_portal/captive_portal.service.j2 +++ b/roles/network/templates/captive_portal/captive_portal.service.j2 @@ -4,8 +4,8 @@ After=syslog.target [Service] Type=simple -User=iiab-admin -Group=iiab-admin +User=root +Group=root WorkingDirectory=/opt/iiab/captive-portal ExecStart=/opt/iiab/captive-portal/captive_portal.py StandardOutput=syslog From 418d941833df8629335bbe79e6de1a985174f087 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 4 Jul 2018 08:30:53 -0500 Subject: [PATCH 025/374] whitespace --- roles/network/tasks/main.yml | 2 +- .../templates/captive_portal/captive_portal.py.j2 | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 959c0b368..3d2e7ec42 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -74,7 +74,7 @@ include_tasks: squid.yml when: FQDN_changed and squid_install and iiab_stage|int == 9 -#- name: FOREFULLY ENABLE CAPTIVE PORTAL +#- name: FOREFULLY ENABLE CAPTIVE PORTAL # set_fact: # py_captive_portal_install: True diff --git a/roles/network/templates/captive_portal/captive_portal.py.j2 b/roles/network/templates/captive_portal/captive_portal.py.j2 index c6021d87c..e873f28de 100755 --- a/roles/network/templates/captive_portal/captive_portal.py.j2 +++ b/roles/network/templates/captive_portal/captive_portal.py.j2 @@ -7,9 +7,9 @@ import BaseHTTPServer import cgi # These variables are used as settings -PORT = int("{{ captive_portal_port }}") # the port in which the captive portal web server listens +PORT = int("{{ captive_portal_port }}") # the port in which the captive portal web server listens IFACE = "{{ iiab_lan_iface }}" # the interface that captive portal protects -IP_ADDRESS = "172.18.96.1" # the ip address of the captive portal (it can be the IP of IFACE) +IP_ADDRESS = "172.18.96.1" # the ip address of the captive portal (it can be the IP of IFACE) ''' This it the http server used by the the captive portal @@ -40,7 +40,7 @@ class CaptivePortal(BaseHTTPServer.BaseHTTPRequestHandler): """ - + ''' if the user requests the login page show it, else use the redirect page @@ -62,7 +62,7 @@ class CaptivePortal(BaseHTTPServer.BaseHTTPRequestHandler): self.send_header("Content-type", "text/html") self.end_headers() form = cgi.FieldStorage( - fp=self.rfile, + fp=self.rfile, headers=self.headers, environ={'REQUEST_METHOD':'POST', 'CONTENT_TYPE':self.headers['Content-Type'], @@ -81,7 +81,7 @@ class CaptivePortal(BaseHTTPServer.BaseHTTPRequestHandler): else: #show the login form self.wfile.write(self.html_login) - + #the following function makes server produce no output #comment it out if you want to print diagnostic messages #def log_message(self, format, *args): From ef58b913aaf7be4bd17c51987294e80b14e92b94 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 4 Jul 2018 08:32:07 -0500 Subject: [PATCH 026/374] use lan_ip in place of hardcoding --- roles/network/templates/captive_portal/captive_portal.py.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/templates/captive_portal/captive_portal.py.j2 b/roles/network/templates/captive_portal/captive_portal.py.j2 index e873f28de..8e0736b07 100755 --- a/roles/network/templates/captive_portal/captive_portal.py.j2 +++ b/roles/network/templates/captive_portal/captive_portal.py.j2 @@ -9,7 +9,7 @@ import cgi # These variables are used as settings PORT = int("{{ captive_portal_port }}") # the port in which the captive portal web server listens IFACE = "{{ iiab_lan_iface }}" # the interface that captive portal protects -IP_ADDRESS = "172.18.96.1" # the ip address of the captive portal (it can be the IP of IFACE) +IP_ADDRESS = "{{ lan_ip }}" # the ip address of the captive portal (it can be the IP of IFACE) ''' This it the http server used by the the captive portal From cc09adb6778717f0409322f6c642c1ab159ed019 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 4 Jul 2018 09:29:05 -0500 Subject: [PATCH 027/374] replace named-iiab.conf to pickup changes in dns_jail_enabled --- roles/network/tasks/enable_services.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/network/tasks/enable_services.yml b/roles/network/tasks/enable_services.yml index 4628874af..5660691c7 100644 --- a/roles/network/tasks/enable_services.yml +++ b/roles/network/tasks/enable_services.yml @@ -27,6 +27,7 @@ group=root mode={{ item.mode }} with_items: + - { src: 'named/named-iiab.conf.j2' , dest: '/etc/named-iiab.conf' , mode: '0644' } - { src: 'named/school.local.zone.db' , dest: '/var/named-iiab/' , mode: '0644' } - { src: 'named/school.internal.zone.db' , dest: '/var/named-iiab/' , mode: '0644' } From 43b67fbc6087df405c17152e4825ba0b26eee465 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 4 Jul 2018 12:56:48 -0500 Subject: [PATCH 028/374] install dnsmasq by default --- vars/default_vars.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index ebe72e509..d9f4753d3 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -103,9 +103,12 @@ dhcpd_enabled: False named_install: True named_enabled: True block_DNS: False +# Captive Portal highly experimental as of July 2018: https://github.com/iiab/iiab/pull/870 +py_captive_portal_install: True +py_captive_portal_enabled: False # dnsmasq -dnsmasq_install: False +dnsmasq_install: True dnsmasq_enabled: False # Captive Portal highly experimental as of June 2018: https://github.com/iiab/iiab/issues/608 From 516daefb275e763160aac1a5d4091f1c03e830ba Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 4 Jul 2018 13:11:49 -0500 Subject: [PATCH 029/374] use dns_jail_enabled for dnsmasq blackhole --- roles/network/templates/network/dnsmasq.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/templates/network/dnsmasq.conf.j2 b/roles/network/templates/network/dnsmasq.conf.j2 index 282c0b222..afd148c89 100644 --- a/roles/network/templates/network/dnsmasq.conf.j2 +++ b/roles/network/templates/network/dnsmasq.conf.j2 @@ -4,7 +4,7 @@ bogus-priv #server=/{{ iiab_domain }}/{{ iiab_hostname }} # Add local-only domains here, queries in these domains are answered from /etc/hosts or DHCP only. local=/{{ iiab_domain }}/ -{% if captive_portal_enabled == "True" %} +{% if dns_jail_enabled %} # Make all host names resolve to the Raspberry Pi's IP address address=/#/{{ lan_ip }} {% endif %} From 2f47e84696a4a5de2fdcd18e18d5a90042e25f40 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 5 Jul 2018 10:14:47 -0500 Subject: [PATCH 030/374] use py_captive_portal_enabled and restore captive_portal_enabled --- roles/network/templates/gateway/iiab-gen-iptables | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/roles/network/templates/gateway/iiab-gen-iptables b/roles/network/templates/gateway/iiab-gen-iptables index 3b9e8959a..f88cdae1b 100755 --- a/roles/network/templates/gateway/iiab-gen-iptables +++ b/roles/network/templates/gateway/iiab-gen-iptables @@ -60,6 +60,7 @@ kalite_server_port={{ kalite_server_port }} sugarizer_port={{ sugarizer_port }} block_DNS={{ block_DNS }} captive_portal_enabled={{ captive_portal_enabled }} +py_captive_portal_enabled={{ py_captive_portal_enabled }} echo "Lan is $lan and WAN is $wan" # @@ -105,7 +106,7 @@ if [ "$gw_block_https" == "True" ]; then fi # Allow outgoing connections from the LAN side. -if ! [ "$captive_portal_enabled" == "True" ];then +if ! [ "$py_captive_portal_enabled" == "True" ];then $IPTABLES -A FORWARD -i $lan -o $wan -j ACCEPT fi # Don't forward from the outside to the inside. @@ -117,13 +118,13 @@ if [ "$block_DNS" == "True" ];then $IPTABLES -t nat -A PREROUTING -i $lan -p udp --dport 53 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:53 fi -#if [ "$captive_portal_enabled" == "True" ];then -# $IPTABLES -t mangle -N internet -# $IPTABLES -t mangle -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m tcp --dport 80 -j internet -# $IPTABLES -t mangle -A internet -j MARK --set-mark 99 -# $IPTABLES -t nat -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m mark --mark 99 -m tcp --dport 80 -j DNAT --to-destination {{ lan_ip }}: - if [ "$captive_portal_enabled" == "True" ];then + $IPTABLES -t mangle -N internet + $IPTABLES -t mangle -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m tcp --dport 80 -j internet + $IPTABLES -t mangle -A internet -j MARK --set-mark 99 + $IPTABLES -t nat -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m mark --mark 99 -m tcp --dport 80 -j DNAT --to-destination {{ lan_ip }} + +elif [ "py_$captive_portal_enabled" == "True" ];then $IPTABLES -t nat -A PREROUTING -i $lan -p tcp --dport 80 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:9090 elif [ "$HTTPCACHE_ON" == "True" ]; then From ca7c291ba5aef57dc4c1a996601147413d40612c Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 5 Jul 2018 12:24:20 -0500 Subject: [PATCH 031/374] use py_ for new captive_portal variables --- roles/network/defaults/main.yml | 6 +++--- roles/network/templates/captive_portal/captive_portal.py.j2 | 4 ++-- roles/network/templates/gateway/iiab-gen-iptables | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 2fb7bc256..55c2ffff1 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -75,6 +75,6 @@ captive_portal_enabled: False # for simple python captive portal py_captive_portal_install: True py_captive_portal_enabled: True -captive_portal_port: "9090" -captive_portal_username: "Admin" -captive_portal_password: "g0adm1n" +py_captive_portal_port: "9090" +py_captive_portal_username: "Admin" +py_captive_portal_password: "changeme" diff --git a/roles/network/templates/captive_portal/captive_portal.py.j2 b/roles/network/templates/captive_portal/captive_portal.py.j2 index 8e0736b07..22ad1f009 100755 --- a/roles/network/templates/captive_portal/captive_portal.py.j2 +++ b/roles/network/templates/captive_portal/captive_portal.py.j2 @@ -7,7 +7,7 @@ import BaseHTTPServer import cgi # These variables are used as settings -PORT = int("{{ captive_portal_port }}") # the port in which the captive portal web server listens +PORT = int("{{ py_captive_portal_port }}") # the port in which the captive portal web server listens IFACE = "{{ iiab_lan_iface }}" # the interface that captive portal protects IP_ADDRESS = "{{ lan_ip }}" # the ip address of the captive portal (it can be the IP of IFACE) @@ -70,7 +70,7 @@ class CaptivePortal(BaseHTTPServer.BaseHTTPRequestHandler): username = form.getvalue("username") password = form.getvalue("password") #dummy security check - if username == '{{ captive_portal_username }}' and password == '{{ captive_portal_password }}': + if username == '{{ py_captive_portal_username }}' and password == '{{ py_captive_portal_password }}': #authorized user remote_IP = self.client_address[0] print 'New authorization from '+ remote_IP diff --git a/roles/network/templates/gateway/iiab-gen-iptables b/roles/network/templates/gateway/iiab-gen-iptables index f88cdae1b..0e456dab1 100755 --- a/roles/network/templates/gateway/iiab-gen-iptables +++ b/roles/network/templates/gateway/iiab-gen-iptables @@ -102,7 +102,7 @@ $IPTABLES -A FORWARD -i $wan -o $lan -m state --state ESTABLISHED,RELATED -j ACC #Block https traffic except if directed at server if [ "$gw_block_https" == "True" ]; then - $IPTABLES -A FORWARD -p tcp ! -d 172.18.96.1 --dport 443 -j DROP + $IPTABLES -A FORWARD -p tcp ! -d {{ lan_ip }} --dport 443 -j DROP fi # Allow outgoing connections from the LAN side. @@ -125,7 +125,7 @@ if [ "$captive_portal_enabled" == "True" ];then $IPTABLES -t nat -A PREROUTING -i {{ iiab_lan_iface }} -p tcp -m mark --mark 99 -m tcp --dport 80 -j DNAT --to-destination {{ lan_ip }} elif [ "py_$captive_portal_enabled" == "True" ];then - $IPTABLES -t nat -A PREROUTING -i $lan -p tcp --dport 80 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:9090 + $IPTABLES -t nat -A PREROUTING -i $lan -p tcp --dport 80 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:{{ py_captive_portal_port }} elif [ "$HTTPCACHE_ON" == "True" ]; then $IPTABLES -t nat -A PREROUTING -i $lan -p tcp --dport 80 ! -d {{ lan_ip }} -j DNAT --to {{ lan_ip }}:3128 From bfdb5595cf8600710c20541b349903db68470d2d Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 5 Jul 2018 16:48:28 -0400 Subject: [PATCH 032/374] Update main.yml --- roles/kiwix/tasks/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index b80baa656..ce8b224cf 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -2,21 +2,18 @@ set_fact: kiwix_src_dir: "{{ kiwix_version_armhf }}" kiwix_src_file: "{{ kiwix_src_file_armhf }}" -# kiwix_src_contains_bin: False when: ansible_machine == "armv7l" or ansible_machine == "armv6l" - name: "Set Kiwix filename to d/l: {{ kiwix_src_file_linux64 }} (x86_64)" set_fact: kiwix_src_dir: "{{ kiwix_version_linux64 }}" kiwix_src_file: "{{ kiwix_src_file_linux64 }}" -# kiwix_src_contains_bin: False when: ansible_machine == "x86_64" - name: "Set Kiwix filename to d/l: {{ kiwix_src_file_i686 }} (i686)" set_fact: kiwix_src_dir: "{{ kiwix_version_i686 }}" kiwix_src_file: "{{ kiwix_src_file_i686 }}" -# kiwix_src_contains_bin: True when: ansible_machine == "i686" # COMMENT OUT LINE ABOVE TO TEST i686 CODE PATH ON X86_64 (WORKS NOV 2017) From 3a7b181e770555a85003a7a2d6c3ee4574300177 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 5 Jul 2018 16:56:19 -0400 Subject: [PATCH 033/374] Update main.yml --- roles/kiwix/defaults/main.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index 04a8c291b..575f35513 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -15,9 +15,8 @@ kiwix_src_file_linux64: "{{ kiwix_version_linux64 }}.tar.gz" kiwix_src_file_i686: "{{ kiwix_version_i686 }}.tar.gz" kiwix_port: 3000 -# Expected to be used soon for Kiwix proxy: +# Used for Kiwix proxy http://box/kiwix/ kiwix_url: /kiwix/ -# Unused in Nov 2017, but should be: kiwix_path: "{{ iiab_base }}/kiwix" # /library/zims contains 3 important things: @@ -26,13 +25,9 @@ kiwix_path: "{{ iiab_base }}/kiwix" # - index directory for legacy *.zim.idx's iiab_zim_path: "{{ content_base }}/zims" kiwix_library_xml: "{{ iiab_zim_path }}/library.xml" -# Unused: (Nov 2017) -# kiwix_content_path: "{{ iiab_zim_path }}/content" # Installation Variables kiwix_install: True kiwix_enabled: True # MOVE FILE /opt/iiab/kiwix/bin/kiwix-serve TO FORCE A REINSTALL OF kiwix-tools kiwix_force_install: False -# Unused: (Nov 2017) -# kiwix_content_found: False From a244cee293cf5e899a86e032f8dd9dcc28d258d3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 5 Jul 2018 16:57:28 -0400 Subject: [PATCH 034/374] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 32 +---------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 956812ac7..0cb5193b5 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -58,9 +58,7 @@ state: directory # 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install -# (We get a whole web server for i686 but only kiwix execs for linux64 & armhf) -#- name: Unarchive kiwix-tools .tar.gz or .tar.bz2 to /tmp - name: Unarchive kiwix-tools .tar.gz to /tmp unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" @@ -71,32 +69,7 @@ - name: Move /tmp/{{ kiwix_src_dir }}/* to permanent location /opt/iiab/kiwix/bin (armhf & linux64 & i686) shell: "mv /tmp/{{ kiwix_src_dir }}/* {{ kiwix_path }}/bin/" -# when: kiwix_force_install and not kiwix_src_contains_bin - -#- name: Move /tmp/{{ kiwix_src_dir }}/bin/* to permanent location /opt/iiab/kiwix/bin (i686) -# shell: "mv /tmp/{{ kiwix_src_dir }}/bin/* {{ kiwix_path }}/bin/" -# when: kiwix_force_install and kiwix_src_contains_bin - -#- name: Unarchive Kiwix binaries to permanent location (NOT i686) -# unarchive: -# src: "{{ downloads_dir }}/{{ kiwix_src_file }}" -# dest: "{{ kiwix_path }}/bin" -# owner: root -# group: root -# when: kiwix_src_bin_only and kiwix_force_install - -#- name: Unarchive kiwix*i686.tar.bz2 to /tmp (i686) -# unarchive: -# src: "{{ downloads_dir }}/{{ kiwix_src_file }}" -# dest: /tmp -# # dest: "{{ iiab_base }}" -# owner: root -# group: root -# when: not kiwix_src_bin_only and kiwix_force_install -# -#- name: Move /tmp/kiwix*i686/bin/* to permanent location /opt/iiab/kiwix/bin (i686) -# shell: "mv /tmp/kiwix*i686/bin/* {{ kiwix_path }}/bin/" -# when: not kiwix_src_bin_only and kiwix_force_install + when: kiwix_force_install # 3. ENABLE MODS FOR APACHE PROXY IF DEBUNTU @@ -194,8 +167,5 @@ value: "{{ iiab_zim_path }}" - option: kiwix_library_xml value: "{{ kiwix_library_xml }}" -# The following 2 lines are unused: (Nov 2017) -# - option: kiwix_content_path -# value: "{{ kiwix_content_path }}" - option: enabled value: "{{ kiwix_enabled }}" From df2da3264cab410a6cb7a9904878785cadfbbe82 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 5 Jul 2018 18:13:36 -0400 Subject: [PATCH 035/374] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 9db7818b0..467bff36d 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.5.x or scripts/ansible-2.6.x "slow food".\n\n' -GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.6.1" # Ansible version for OLPC XO laptops (pip install). # On other OS's we install/upgrade to THE latest (released version of) Ansible. CURR_VER="undefined" # below are unused for future use From c28201c0a612bc998977d78a341b060da82b7bdf Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 5 Jul 2018 18:14:03 -0400 Subject: [PATCH 036/374] Update ansible-2.5.x --- scripts/ansible-2.5.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible-2.5.x b/scripts/ansible-2.5.x index 7e3ea082f..62ce9ef4e 100755 --- a/scripts/ansible-2.5.x +++ b/scripts/ansible-2.5.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-2.6.x, or scripts/ansible for the latest.\n\n' -GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.5.6" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade/pin to the latest Ansible 2.5.x CURR_VER="undefined" # below are unused for future use From 426b4ba02d1cccc78b6bad53dcbb5b3c7ec86659 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 5 Jul 2018 18:14:22 -0400 Subject: [PATCH 037/374] 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 0143115f4..9ea07a808 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-2.5.x, or scripts/ansible for the latest.\n\n' -GOOD_VER="2.6.0" # Ansible version for OLPC XO laptops (pip install). +GOOD_VER="2.6.1" # Ansible version for OLPC XO laptops (pip install). # On other OS's we attempt to install/upgrade/pin to the latest Ansible 2.6.x CURR_VER="undefined" # below are unused for future use From e65e306939287dc7b70f41f87f51e9021a382621 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 7 Jul 2018 14:53:30 -0400 Subject: [PATCH 038/374] Update calibre-serve.service.j2 --- roles/calibre/templates/calibre-serve.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/calibre/templates/calibre-serve.service.j2 b/roles/calibre/templates/calibre-serve.service.j2 index 97e10d6d3..db62f5a31 100644 --- a/roles/calibre/templates/calibre-serve.service.j2 +++ b/roles/calibre/templates/calibre-serve.service.j2 @@ -6,7 +6,7 @@ After=syslog.target network.target local-fs.target Type=forking PIDFile=/var/run/calibre.pid TimeoutStartSec=400 -ExecStart=/usr/bin/calibre-server --daemonize --log=/var/log/calibre.log --pidfile=/var/run/calibre.pid --port={{ calibre_port }} {{ calibre_dbpath }} +ExecStart=/usr/bin/calibre-server --daemonize --log=/var/log/calibre.log --pidfile=/var/run/calibre.pid --port={{ calibre_port }} --enable-auth --userdb={{ calibre_userdb }} {{ calibre_dbpath }} [Install] TimeoutStartSec=900 From e5931eb8ef00ed201d8dcf6c4e3a7da761f0981c Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 7 Jul 2018 14:57:43 -0400 Subject: [PATCH 039/374] Update main.yml --- roles/calibre/defaults/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/calibre/defaults/main.yml b/roles/calibre/defaults/main.yml index f135ee6f2..73ed87fea 100644 --- a/roles/calibre/defaults/main.yml +++ b/roles/calibre/defaults/main.yml @@ -5,7 +5,10 @@ calibre_web_path: calibre # In addition to: http://box:8080 http://box/books box/libros box/livres box/livros box/liv calibre_dbpath: "{{ content_base }}/calibre" -# i.e. /library/calibre +# i.e. /library/calibre (holds metadata.db + book directories + our users.sqlite) + +calibre_userdb: "{{ calibre_dbpath }}/users.sqlite" +# i.e. /library/calibre/users.sqlite calibre_sample_book: "Metamorphosis-jackson.epub" # Must be downloadable from http://download.iiab.io/packages From 13762ec7b45fddea74be16a4fd70fa11d6d4e112 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 7 Jul 2018 15:01:15 -0400 Subject: [PATCH 040/374] Update main.yml --- roles/calibre/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 74c10c428..4698b6984 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -32,7 +32,7 @@ # - run testing branch for Ubuntu 16.04: scripts/calibre-install-latest.sh # - run unstable branch for Debian etc: scripts/calibre-install-unstable.sh -- name: Create calibre-serve.service and calibre.conf +- name: Create calibre-serve.service, calibre.conf, users.sqlite template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -44,6 +44,7 @@ with_items: - { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'} - { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'} + - { src: 'users.sqlite', dest: '{{ calibre_userdb }}', mode: '0644'} - name: Force systemd to reread configs systemd: From 612c5521680d487fd7be3d610f4d5813184a10d5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 7 Jul 2018 15:07:19 -0400 Subject: [PATCH 041/374] Add files via upload Contains 1 user with WRITE permissions: Admin/changeme Contains 5 users with READ-only permissions: box/box h/h ht/ht m/m mx/mx p/p pe/pe --- roles/calibre/templates/users.sqlite | Bin 0 -> 12288 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 roles/calibre/templates/users.sqlite diff --git a/roles/calibre/templates/users.sqlite b/roles/calibre/templates/users.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..5dc597dbe52ab6976a95faa81a8038cdaffd6959 GIT binary patch literal 12288 zcmeI0J#W)M7=X`lJ}V{HD1#@YQ^e3n1vPb2Dod!i!Jt4A8rPBN6gi2(mU51XU6IJj z#=;-rPw)r2z{JFcSYTp>jk8fANK{*>Q{g@NzU=ek_a2{z^J%wbc?NklnNr;&BHBhA zhwc%A5NjgDv%E|kYb2K)RtNncN2P6aJ9V7L-%%nzNBKE^7d05JfdMc82EYIq00UqE z41fVJ00#a^1FyPVMi2z}Zk~JdDj;1_R zRC1y=+p>B_9xG?Nk@wg-HHfA>)kx0BdUmRst07^FiH8CEL zUI9#V10Wv60_0Q<6^r2%OwaT-5Y_#7L~@02498eQ)TLT29>K2=bVg?z2r=HoqeKn~ zH^Pa?BWl@0Q@5WRbUmD!6gMN=Uo^NJDwRUkU@~LJT0o*yj}K^zt>!GgK=>Q}fj{7n z_&xrDFYu@9w#Xq~FaQR?02lxRU;qq&0WbgtzyKHk1OJ186puM48FXh-jgP)-xQ3e12 literal 0 HcmV?d00001 From 9de8f51f1900be306b333875ee86c92e667d6f1d Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 7 Jul 2018 15:49:46 -0400 Subject: [PATCH 042/374] Ansible's template module won't copy binary files --- roles/calibre/tasks/main.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 4698b6984..4fc1f2820 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -32,7 +32,7 @@ # - run testing branch for Ubuntu 16.04: scripts/calibre-install-latest.sh # - run unstable branch for Debian etc: scripts/calibre-install-unstable.sh -- name: Create calibre-serve.service, calibre.conf, users.sqlite +- name: Create calibre-serve.service and calibre.conf template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -44,7 +44,14 @@ with_items: - { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'} - { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'} - - { src: 'users.sqlite', dest: '{{ calibre_userdb }}', mode: '0644'} + +- name: Copy template userdb to /library/calibre/users.sqlite + copy: + src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite + dest: "{{ calibre_userdb }}" + owner: root + group: root + mode: 0644 - name: Force systemd to reread configs systemd: From 11757ddb86b2100ba6d02367a35434496c42e10e Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 7 Jul 2018 15:54:44 -0400 Subject: [PATCH 043/374] Update main.yml --- roles/calibre/tasks/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 4fc1f2820..9a7db6efa 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -40,10 +40,11 @@ group: root mode: "{{ item.mode }}" backup: no - register: calibre_config +# register: calibre_config with_items: - { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'} - { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'} + when: (not calib_executable.stat.exists) - name: Copy template userdb to /library/calibre/users.sqlite copy: @@ -52,11 +53,13 @@ owner: root group: root mode: 0644 + when: (not calib_executable.stat.exists) - name: Force systemd to reread configs systemd: daemon_reload: yes - when: calibre_config.changed + when: (not calib_executable.stat.exists) +# when: calibre_config.changed # 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled) From 9604076d6f9367fb6f31254e977b1f22117d2ca0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 7 Jul 2018 16:06:34 -0400 Subject: [PATCH 044/374] Update main.yml --- roles/calibre/defaults/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/calibre/defaults/main.yml b/roles/calibre/defaults/main.yml index 73ed87fea..b794b0f4b 100644 --- a/roles/calibre/defaults/main.yml +++ b/roles/calibre/defaults/main.yml @@ -9,6 +9,9 @@ calibre_dbpath: "{{ content_base }}/calibre" calibre_userdb: "{{ calibre_dbpath }}/users.sqlite" # i.e. /library/calibre/users.sqlite +# For teachers to add/remove/convert books & edit metadata: Admin/changeme +# Stub acnts to browse books: box/box, h/h, ht/ht, m/m, mx/mx, p/p, pe/pe +# Edit with: calibre-server --manage-users --userdb /library/calibre/users.sqlite calibre_sample_book: "Metamorphosis-jackson.epub" # Must be downloadable from http://download.iiab.io/packages From 43455772a0eb32605bd1cf913a529c70cd77cdfd Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 7 Jul 2018 16:17:53 -0400 Subject: [PATCH 045/374] Update main.yml --- roles/calibre/defaults/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/calibre/defaults/main.yml b/roles/calibre/defaults/main.yml index b794b0f4b..4cbfc1caa 100644 --- a/roles/calibre/defaults/main.yml +++ b/roles/calibre/defaults/main.yml @@ -8,10 +8,11 @@ calibre_dbpath: "{{ content_base }}/calibre" # i.e. /library/calibre (holds metadata.db + book directories + our users.sqlite) calibre_userdb: "{{ calibre_dbpath }}/users.sqlite" -# i.e. /library/calibre/users.sqlite -# For teachers to add/remove/convert books & edit metadata: Admin/changeme -# Stub acnts to browse books: box/box, h/h, ht/ht, m/m, mx/mx, p/p, pe/pe -# Edit with: calibre-server --manage-users --userdb /library/calibre/users.sqlite +# i.e. /library/calibre/users.sqlite since github.com/iiab/iiab/issues/830 +# Teachers add/remove/convert books & edit metadata using: Admin/changeme +# Stub/Student acnts to browse: box/box, h/h, ht/ht, m/m, mx/mx, p/p, pe/pe +# Edit accounts/permissions using: +# calibre-server --manage-users --userdb /library/calibre/users.sqlite calibre_sample_book: "Metamorphosis-jackson.epub" # Must be downloadable from http://download.iiab.io/packages From dec77aab2e5f73f26dc41c3098db106b681ef95e Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 7 Jul 2018 16:20:28 -0400 Subject: [PATCH 046/374] Update main.yml --- roles/calibre/tasks/main.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 9a7db6efa..7e1c20156 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -32,7 +32,16 @@ # - run testing branch for Ubuntu 16.04: scripts/calibre-install-latest.sh # - run unstable branch for Debian etc: scripts/calibre-install-unstable.sh -- name: Create calibre-serve.service and calibre.conf +- name: Copy template userdb to /library/calibre/users.sqlite (IF /usr/bin/calibre WAS MISSING) + copy: + src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite + dest: "{{ calibre_userdb }}" + owner: root + group: root + mode: 0644 + when: (not calib_executable.stat.exists) + +- name: Create calibre-serve.service and calibre.conf (IF /usr/bin/calibre WAS MISSING) template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -46,16 +55,7 @@ - { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'} when: (not calib_executable.stat.exists) -- name: Copy template userdb to /library/calibre/users.sqlite - copy: - src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite - dest: "{{ calibre_userdb }}" - owner: root - group: root - mode: 0644 - when: (not calib_executable.stat.exists) - -- name: Force systemd to reread configs +- name: Force systemd to reread configs (IF /usr/bin/calibre WAS MISSING) systemd: daemon_reload: yes when: (not calib_executable.stat.exists) From 4555226dda587930db8aebcd16e7a2d9a3ade09d Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 9 Jul 2018 02:12:49 -0400 Subject: [PATCH 047/374] Readability improvements --- roles/0-init/tasks/iiab_ini.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/0-init/tasks/iiab_ini.yml b/roles/0-init/tasks/iiab_ini.yml index 9b4a13c7c..3475ec764 100644 --- a/roles/0-init/tasks/iiab_ini.yml +++ b/roles/0-init/tasks/iiab_ini.yml @@ -1,5 +1,5 @@ # workaround for fact that auto create does not work on ini_file -- name: Create iiab config file +- name: Create /etc/iiab/iiab.ini (iiab_config_file) file: dest: "{{ iiab_config_file }}" state: touch @@ -16,12 +16,12 @@ - option: iiab_dir value: "{{ iiab_dir }}" -- name: add version section +- name: Add version section ini_file: - dest: "{{ iiab_config_file }}" - section: version - option: "{{ item.option }}" - value: "{{ item.value }}" + dest: "{{ iiab_config_file }}" + section: version + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - option: distribution value: "{{ ansible_distribution }}" From 9f302a64bd506a01475575f768fb92f9fd11b8b0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 9 Jul 2018 02:15:32 -0400 Subject: [PATCH 048/374] Update hostname.yml --- roles/0-init/tasks/hostname.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/0-init/tasks/hostname.yml b/roles/0-init/tasks/hostname.yml index a2f9ea1c3..56c8e8e9b 100644 --- a/roles/0-init/tasks/hostname.yml +++ b/roles/0-init/tasks/hostname.yml @@ -3,7 +3,7 @@ path: /etc/cloud/cloud.cfg register: U18_server -- name: edit cloud.cfg yaml +- name: Edit cloud.cfg yaml lineinfile: dest: /etc/cloud/cloud.cfg regexp: '^preserve_hostname*' From 59133f0f51a96aedd8a9ca7c07cce3e21377e655 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 9 Jul 2018 03:26:40 -0400 Subject: [PATCH 049/374] create /library/calibre earlier on, in main.yml --- roles/calibre/tasks/create-db.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/roles/calibre/tasks/create-db.yml b/roles/calibre/tasks/create-db.yml index f630f8b2e..c2723d1d8 100644 --- a/roles/calibre/tasks/create-db.yml +++ b/roles/calibre/tasks/create-db.yml @@ -1,9 +1,3 @@ -- name: Create /library/calibre (mandatory since Calibre 3.x) - file: - path: "{{ calibre_dbpath }}" - state: directory - #mode: 0755 - - name: Check if sample book exists in /opt/iiab/downloads stat: path: "{{ content_base }}/downloads/{{ calibre_sample_book }}" From defb747b6eb4cd8aaa3e6ae0e8bb2508323ad5d1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 9 Jul 2018 03:29:54 -0400 Subject: [PATCH 050/374] insert Section 3 to properly create user db --- roles/calibre/tasks/main.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 7e1c20156..5cfb310d0 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -32,15 +32,6 @@ # - run testing branch for Ubuntu 16.04: scripts/calibre-install-latest.sh # - run unstable branch for Debian etc: scripts/calibre-install-unstable.sh -- name: Copy template userdb to /library/calibre/users.sqlite (IF /usr/bin/calibre WAS MISSING) - copy: - src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite - dest: "{{ calibre_userdb }}" - owner: root - group: root - mode: 0644 - when: (not calib_executable.stat.exists) - - name: Create calibre-serve.service and calibre.conf (IF /usr/bin/calibre WAS MISSING) template: src: "{{ item.src }}" @@ -78,7 +69,24 @@ # failed_when: false # Never Fail during "systemctl stop calibre-serve" (even if service doesn't exist!) # when: calibre_svc.stat.exists -# 3. CREATE DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x) +# 3. CREATE USER DATABASE + +- name: Create /library/calibre (mandatory since Calibre 3.x) + file: + path: "{{ calibre_dbpath }}" + state: directory + #mode: 0755 + +- name: Copy template userdb to /library/calibre/users.sqlite (IF /usr/bin/calibre WAS MISSING) + copy: + src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite + dest: "{{ calibre_userdb }}" + owner: root + group: root + mode: 0644 + when: (not calib_executable.stat.exists) + +# 4. CREATE CONTENT DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x) - name: Check if /library/calibre/metadata.db exists stat: @@ -89,7 +97,7 @@ include_tasks: create-db.yml when: not calibre_db.stat.exists -# 4. WRAP UP: ENABLE CALIBRE SERVICE, http://box/books ETC +# 5. WRAP UP: ENABLE CALIBRE SERVICE, http://box/books ETC # http://box:8080 & http://box:8080/mobile WORK BUT OTHER URL'S LIKE http://box/books ARE A MESS (BOOKS RARELY DISPLAY) - name: Create calibre.conf link for UNTESTED http://box/books etc (debuntu) From 76dad988473b2e73db3fa3db8f58c375afcf40bf Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 9 Jul 2018 04:38:28 -0400 Subject: [PATCH 051/374] addresses part of #869 --- roles/sugarizer/templates/sugarizer.service.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/sugarizer/templates/sugarizer.service.j2 b/roles/sugarizer/templates/sugarizer.service.j2 index e21f3b6e0..3b1e75cfa 100644 --- a/roles/sugarizer/templates/sugarizer.service.j2 +++ b/roles/sugarizer/templates/sugarizer.service.j2 @@ -1,7 +1,8 @@ [Unit] Description=Node.js Sugarizer Server Requires=mongodb.service -After=mongodb.service # Requires the mongodb service to run first +After=mongodb.service +# Requires mongodb service to run first [Service] WorkingDirectory=/opt/iiab/sugarizer-server/ From 816a42aa2254f6c9729196078229edfa19e2485b Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 9 Jul 2018 14:35:17 -0400 Subject: [PATCH 052/374] comment cleanup --- roles/kalite/tasks/install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index 4be6dc4c7..331163dc8 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -32,7 +32,7 @@ # extra_args="--disable-pip-version-check" when: internet_available and is_debuntu -#- name: Install KA Lite non-static + reqs file with pip - (OS's other than debuntu) +#- name: Install KA Lite non-static + reqs file with pip (OS's other than debuntu) # pip: requirements={{ pip_packages_dir }}/kalite.txt # virtualenv={{ kalite_venv }} # virtualenv_site_packages=no @@ -40,7 +40,7 @@ # extra_args="--disable-pip-version-check" # when: internet_available and not is_debuntu -- name: Install KA Lite static with pip - (OS's other than debuntu) +- name: Install KA Lite static with pip (OS's other than debuntu) pip: name: ka-lite-static version: "{{ kalite_version }}" From 43929dc6ce799255061ce150384f714109681b4e Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 9 Jul 2018 14:48:15 -0400 Subject: [PATCH 053/374] Update main.yml --- roles/kalite/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index f68fd7d92..35f1932f7 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -4,12 +4,12 @@ - name: Calc KA Lite db file name (Fedora 18) set_fact: - kalite_db_name: "{{ kalite_root }}/kalite/database/data.sqlite" + kalite_db_name: "{{ kalite_root }}/kalite/database/data.sqlite" when: is_F18 - name: Calc KA Lite db file name (OS's other than Fedora 18) set_fact: - kalite_db_name: "{{ kalite_root }}/database/data.sqlite" + kalite_db_name: "{{ kalite_root }}/database/data.sqlite" when: not is_F18 - name: See if KA Lite is already configured From 4a93bdf5f7c25fb06f8a23a5184d1a06c1b61e67 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 10 Jul 2018 13:20:33 -0400 Subject: [PATCH 054/374] Comment's URL clarified --- scripts/calibre-install-packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/calibre-install-packages.sh b/scripts/calibre-install-packages.sh index 616a1a7f0..d32713714 100755 --- a/scripts/calibre-install-packages.sh +++ b/scripts/calibre-install-packages.sh @@ -37,7 +37,7 @@ # http://raspbian.raspberrypi.org/raspbian/pool/main/c/calibre/ # http://archive.raspbian.org/raspbian/pool/main/c/calibre/ # https://packages.debian.org/search?keywords=calibre -# http://deb.debian.org/debian/pool/main/c/calibre/ +# http://deb.debian.org/debian/pool/main/c/calibre/ ~= http://cdn-fastly.deb.debian.org/debian/pool/main/c/calibre/ # # Might break future updates; you have been warned. From 45d322a471083adf0ffd71fc6968bad91c77f646 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 10 Jul 2018 13:23:15 -0400 Subject: [PATCH 055/374] Comment updated with latest Calibre .deb releases --- scripts/calibre-install-packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/calibre-install-packages.sh b/scripts/calibre-install-packages.sh index d32713714..ba99b882a 100755 --- a/scripts/calibre-install-packages.sh +++ b/scripts/calibre-install-packages.sh @@ -32,7 +32,7 @@ # https://github.com/iiab/iiab/pull/833 # WORKED ON RPI 3 AND RPI 3 B+ BUT... # https://github.com/iiab/iiab/issues/835 # FAILED ON RPI ZERO W, possibly due to libc6 (IF ABOVE STEP 2 NOT RUN!) -# FYI Calibre 3.26.0 is the latest available from testing as of 2018-06-21: +# FYI Calibre 3.26.1 and 3.27.1 are the latest available from testing as of 2018-07-10: # # http://raspbian.raspberrypi.org/raspbian/pool/main/c/calibre/ # http://archive.raspbian.org/raspbian/pool/main/c/calibre/ From f9388187c4931364b6e4f3fa317761cec871354b Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 10 Jul 2018 23:24:50 -0400 Subject: [PATCH 056/374] Rename ansible-2.5.x to ansible-2.5.x-deprecated --- scripts/{ansible-2.5.x => ansible-2.5.x-deprecated} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{ansible-2.5.x => ansible-2.5.x-deprecated} (100%) diff --git a/scripts/ansible-2.5.x b/scripts/ansible-2.5.x-deprecated similarity index 100% rename from scripts/ansible-2.5.x rename to scripts/ansible-2.5.x-deprecated From 0267eb3d628d2d2bc32e9cfa4673b1e5f780a108 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 10 Jul 2018 23:27:10 -0400 Subject: [PATCH 057/374] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 467bff36d..331d64aee 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.5.x or scripts/ansible-2.6.x "slow food".\n\n' +echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated or scripts/ansible-2.6.x "slow food".\n\n' GOOD_VER="2.6.1" # Ansible version for OLPC XO laptops (pip install). From 61aafcf617bd1bd55217b56778a32e9dc6e89d5e Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 10 Jul 2018 23:30:20 -0400 Subject: [PATCH 058/374] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 331d64aee..8afc057de 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.5.x-deprecated or scripts/ansible-2.6.x "slow food".\n\n' +echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated or scripts/ansible-2.6.x\n\n' GOOD_VER="2.6.1" # Ansible version for OLPC XO laptops (pip install). From df436b94fb9187ea908493123258d9f8032e3e88 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 10 Jul 2018 23:30:30 -0400 Subject: [PATCH 059/374] 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 9ea07a808..6e9c76daf 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-2.5.x, or scripts/ansible for the latest.\n\n' +echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated "slow food", or scripts/ansible for the latest.\n\n' GOOD_VER="2.6.1" # Ansible version for OLPC XO laptops (pip install). From 66529815f9a804c12ae8c446974a8deeb6c6b7bf Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 00:20:07 -0400 Subject: [PATCH 060/374] Update main.yml --- roles/calibre/tasks/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 722012e7c..e84467bb6 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -5,7 +5,11 @@ path: "/usr/bin/calibre" register: calib_executable -# The 8 lines below appear unecessary as of 2018-06-26 -- as tested on RPi. +# The 8 lines below were breaking IIAB installs on Ubuntu 16.04 as of early +# July 2018 (https://github.com/iiab/iiab/issues/883) and were tested as +# unecessary on Raspbian Lite on RPi 3 B+ (calibre_via-debs: True) and +# Ubuntu 18.04 (calibre_via_python: True). PR #856 is the fix for now. + #- name: Install Calibre via OS's package installer (IF /usr/bin/calibre MISSING) # package: # name: "{{ item }}" From cdbe0ea4a758251a208d42bed07282dfe40ccca1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 03:40:50 -0400 Subject: [PATCH 061/374] Revert "Avoiding OS's ancient version(s) of Calibre (blocks install on Ubuntu 16.04, slows others)" --- roles/calibre/tasks/main.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 88b848bc4..5cfb310d0 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -5,19 +5,14 @@ path: "/usr/bin/calibre" register: calib_executable -# The 8 lines below were breaking IIAB installs on Ubuntu 16.04 as of early -# July 2018 (https://github.com/iiab/iiab/issues/883) and were tested as -# unecessary on Raspbian Lite on RPi 3 B+ (calibre_via-debs: True) and -# Ubuntu 18.04 (calibre_via_python: True). PR #856 is the fix for now. - -#- name: Install Calibre via OS's package installer (IF /usr/bin/calibre MISSING) -# package: -# name: "{{ item }}" -# state: latest -# with_items: -# - calibre -# - calibre-bin -# when: internet_available and (not calib_executable.stat.exists) +- name: Install Calibre via OS's package installer (IF /usr/bin/calibre MISSING) + package: + name: "{{ item }}" + state: latest + with_items: + - calibre + - calibre-bin + when: internet_available and (not calib_executable.stat.exists) - name: Install Calibre experimental .debs IF calibre_via_debs (AND /usr/bin/calibre WAS MISSING) include_tasks: debs.yml From 06cabee0f76f9c138256bb71f95c6b627399e98a Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 03:55:25 -0400 Subject: [PATCH 062/374] Mandate Ansible 2.5.6 as an absolute minimum --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 42eebef69..5179fdf42 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.4.1.0 +MIN_ANSIBLE_VER=2.5.6 export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" From 6cb996f10b25ba23b7d7057910ac3173b00ce433 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 04:08:34 -0400 Subject: [PATCH 063/374] Update iiab-install --- iiab-install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iiab-install b/iiab-install index 5179fdf42..7cae43b7b 100755 --- a/iiab-install +++ b/iiab-install @@ -68,9 +68,11 @@ if [[ `command -v ansible` ]]; then # "command -v" is POSIX compliant; it fi if version_gt $MIN_ANSIBLE_VER $CURR_ANSIBLE_VER ; then echo -e "\nEXITING: Ansible "$MIN_ANSIBLE_VER" or higher required." - echo "PLEASE RUN './scripts/ansible' to install the latest Ansible from PPA or RPM." - echo "'ansible --version' and 'apt -a list ansible' can also be useful here. Try" - echo "to remove prior versions with 'apt purge ansible' or 'pip uninstall ansible'." + echo + echo "REMOVE PRIOR VERSIONS using 'apt purge ansible' and/or 'pip uninstall ansible'." + echo "THEN RUN 'scripts/ansible' to install the latest Ansible from PPA or RPM." + echo "'ansible --version' and 'apt -a list ansible' can also be very useful." + echo echo "IIAB INSTALL INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation" exit 1 fi From fff8b20b5eeda3df6a89094b0be7c8762a36e077 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 13:06:37 -0400 Subject: [PATCH 064/374] new Ansible syntax/convention --- roles/sugarizer/tasks/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 0dbd4d965..9e7c6dde2 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -101,9 +101,10 @@ - { src: 'sugarizer.conf' , dest: '/etc/apache2/sites-available',mode: '0644' } - name: Create the symlink enabling the rewrite - file: src=/etc/apache2/sites-available/sugarizer.conf - dest=/etc/apache2/sites-enabled/sugarizer.conf - state=link + file: + src: /etc/apache2/sites-available/sugarizer.conf + dest: /etc/apache2/sites-enabled/sugarizer.conf + state: link - name: Create the express framework for Node.js (OS's other than Fedora 18) shell: npm install From fb2aeca64e9af7790d20dd9d602533d808c5cbc7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 13:10:09 -0400 Subject: [PATCH 065/374] "waitdb = 1" added by @llaske since Sugarizer 1.0 On 2018-05-29 Lionel added this: ("Add an option to wait DB connection") https://github.com/llaske/sugarizer-server/commit/0ec8bde6b08c9fd33639d98cdd06013ff6f97222 --- roles/sugarizer/templates/sugarizer.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sugarizer/templates/sugarizer.ini b/roles/sugarizer/templates/sugarizer.ini index afcd97d19..bbb48a914 100644 --- a/roles/sugarizer/templates/sugarizer.ini +++ b/roles/sugarizer/templates/sugarizer.ini @@ -20,6 +20,7 @@ path = ../sugarizer/ server = localhost port = 27018 name = sugarizer +waitdb = 1 [presence] port = 8039 From 6cf927bc959c0c3acc4f0bd760677d57793f0305 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 18:09:12 -0400 Subject: [PATCH 066/374] Update main.yml --- roles/sugarizer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index 7baf488d2..1a96775f7 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -1,6 +1,6 @@ sugarizer_install: True sugarizer_enabled: False -sugarizer_location: /opt/iiab +sugarizer_location: {{ iiab_base }} # /opt/iiab sugarizer_version: 'sugarizer-1.0' sugarizer_server_version: 'sugarizer-server-1.0' npm_exists: False From 48b905207582d60a4d45775122591d7f19c21c18 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 19:00:56 -0400 Subject: [PATCH 067/374] Incorporate changes learned from #798 & #814 --- roles/sugarizer/tasks/main.yml | 89 +++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 39 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 9e7c6dde2..ea7061fd5 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -1,15 +1,15 @@ -- name: Wipe any previous sugarizer installation +- name: Wipe /library/www/html/sugarizer* if sugarizer-1.0 shell: "rm -rf {{ doc_root }}/sugarizer*" when: sugarizer_version == "sugarizer-1.0" -- name: Download latest stable Sugarizer from location we control +- name: D/L latest stable Sugarizer from location we control to /opt/iiab/downloads/ get_url: url: "{{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz" dest: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz" timeout: "{{ download_timeout }}" when: internet_available -- name: Untar to {{ sugarizer_version }} +- name: Untar to /opt/iiab/{{ sugarizer_version }} unarchive: src: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz" dest: "{{ sugarizer_location }}" @@ -17,47 +17,66 @@ # command: tar xzf {{ downloads_dir }}/{{ sugarizer_version }}.tar.gz -C {{ sugarizer_location }} # creates="{{ sugarizer_location }}/{{ sugarizer_version }}/index.html" -- name: Download latest stable Server from location we control - get_url: - url: "{{ iiab_download_url }}/{{ sugarizer_server_version }}.tar.gz" - dest: "{{ downloads_dir }}/{{ sugarizer_server_version }}.tar.gz" - timeout: "{{ download_timeout }}" - when: internet_available - -- name: Untar to /{{ sugarizer_version }} - unarchive: - src: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz" - dest: "{{ sugarizer_location }}" - creates: "{{ sugarizer_location }}/{{ sugarizer_version }}/index.html" -- name: Create symbolic link /library/www/html/sugarizer +- name: Create symbolic link /opt/iiab/sugarizer -> /opt/iiab/{{ sugarizer_version }} file: src: "{{ sugarizer_location }}/{{ sugarizer_version }}" dest: "{{ sugarizer_location }}/sugarizer" state: link -- name: Untar to /library/www/html/{{ sugarizer_server_version }} - unarchive: - src: "{{ downloads_dir }}/{{ sugarizer_server_version }}.tar.gz" +# Not working in July 2018, so "git clone" instead (2 steps that follow) +#- name: Download latest stable Server from location we control +# get_url: +# url: "{{ iiab_download_url }}/{{ sugarizer_server_version }}.tar.gz" +# dest: "{{ downloads_dir }}/{{ sugarizer_server_version }}.tar.gz" +# timeout: "{{ download_timeout }}" +# when: internet_available +# +#- name: Untar to /opt/iiab/{{ sugarizer_server_version }} +# unarchive: +# src: "{{ downloads_dir }}/{{ sugarizer_server_version }}.tar.gz" +# dest: "{{ sugarizer_location }}" +# creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/index.html" + +# CLONING SUGARIZER'S MASTER IN NOT A LONG-TERM SOLUTION, BUT +# UNCOMMENTING "version:" LINE BELOW CAN BRING STABILITY IN FUTURE +- name: Clone llaske/sugarizer-server from GitHub to /opt/iiab + git: + repo: http://github.com/llaske/sugarizer-server dest: "{{ sugarizer_location }}" - creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/index.html" -- name: Create symbolic link /library/www/html/sugarizer +# version: "{{ sugarizer_server_version }}" + +- name: Move /opt/iiab/sugarizer-server to /opt/iiab/{{ sugarizer_server_version }} + move: + src: "{{ sugarizer_location }}/sugarizer-server" + dest: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" + +- name: Create symbolic link /opt/iiab/sugarizer-server -> /opt/iiab/{ sugarizer_server_version }} file: src: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" dest: "{{ sugarizer_location }}/sugarizer-server" state: link -- name: Set up Node.js 6.x apt sources (debuntu) - shell: curl -sL https://deb.nodesource.com/setup_6.x | bash - +- name: Set up Node.js 8.x apt sources (debuntu but avoid ubuntu-18) + shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - when: internet_available and is_debuntu and not is_ubuntu_18 - name: Install latest Node.js which includes /usr/bin/npm (debuntu) package: name: nodejs + # name: nodejs=8.x state: latest -# package: name=nodejs=6.* -# state=present + # state: present when: internet_available and is_debuntu and not is_ubuntu_18 +- name: Install Node.js and npm (ubuntu-18) + package: + name: "{{ item }}" + state: latest + when: internet_available and is_ubuntu_18 + with_items: + - nodejs + - npm + - name: Install npm (OS's other than debuntu) package: name: "{{ item }}" @@ -67,15 +86,6 @@ - nodejs - npm -- name: Install npm (ubuntu-18) - package: - name: "{{ item }}" - state: latest - when: internet_available and is_ubuntu_18 - with_items: - - npm - - nodejs - # attempting to reinstall npm is broken on Raspbian 9 - name: Check for Sugarizer already installed stat: @@ -96,11 +106,11 @@ owner: root group: root with_items: - - { src: 'sugarizer.service.j2' , dest: '/etc/systemd/system/sugarizer.service', mode: '0644' } - - { src: 'sugarizer.ini' , dest: '{{ sugarizer_location }}/{{ sugarizer_server_version }}/env/sugarizer.ini', mode: '0644' } - - { src: 'sugarizer.conf' , dest: '/etc/apache2/sites-available',mode: '0644' } + - { src: 'sugarizer.service.j2', dest: '/etc/systemd/system/sugarizer.service', mode: '0644' } + - { src: 'sugarizer.ini', dest: '{{ sugarizer_location }}/{{ sugarizer_server_version }}/env/sugarizer.ini', mode: '0644' } + - { src: 'sugarizer.conf', dest: '/etc/apache2/sites-available', mode: '0644' } -- name: Create the symlink enabling the rewrite +- name: Create symlink enabling short URL http://box/sugarizer file: src: /etc/apache2/sites-available/sugarizer.conf dest: /etc/apache2/sites-enabled/sugarizer.conf @@ -110,7 +120,8 @@ shell: npm install args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" - creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/server/node_modules" + creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node-modules" + #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/server/node_modules" when: not is_F18 and not npm_exists - name: Create the express framework for Node.js (Fedora 18) From 9c01c64d6b485d09279038a5988ab5ea86cb2974 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 19:11:29 -0400 Subject: [PATCH 068/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index ea7061fd5..c0ffa8572 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -41,7 +41,7 @@ # UNCOMMENTING "version:" LINE BELOW CAN BRING STABILITY IN FUTURE - name: Clone llaske/sugarizer-server from GitHub to /opt/iiab git: - repo: http://github.com/llaske/sugarizer-server + repo: https://github.com/llaske/sugarizer-server dest: "{{ sugarizer_location }}" # version: "{{ sugarizer_server_version }}" @@ -60,7 +60,7 @@ shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - when: internet_available and is_debuntu and not is_ubuntu_18 -- name: Install latest Node.js which includes /usr/bin/npm (debuntu) +- name: Install latest Node.js which includes /usr/bin/npm (debuntu but avoid ubuntu-18) package: name: nodejs # name: nodejs=8.x @@ -120,7 +120,7 @@ shell: npm install args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" - creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node-modules" + creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/server/node_modules" when: not is_F18 and not npm_exists From 2e651ac4735280d5235f4a657c67cf06b87c508b Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 19:25:56 -0400 Subject: [PATCH 069/374] Update main.yml --- roles/sugarizer/defaults/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index 1a96775f7..2a761971f 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -1,6 +1,8 @@ sugarizer_install: True sugarizer_enabled: False sugarizer_location: {{ iiab_base }} # /opt/iiab -sugarizer_version: 'sugarizer-1.0' -sugarizer_server_version: 'sugarizer-server-1.0' +sugarizer_version: sugarizer-1.0 +sugarizer_git_version: v1.0.1 +sugarizer_server_version: sugarizer-server-1.0 +sugarizer_server_git_version: v1.0 npm_exists: False From 65a0d4ced18299140152d4f2f6fff51a1e4e2db6 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 19:27:13 -0400 Subject: [PATCH 070/374] Update main.yml --- roles/sugarizer/defaults/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index 2a761971f..a7f88749c 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -1,8 +1,12 @@ sugarizer_install: True sugarizer_enabled: False + sugarizer_location: {{ iiab_base }} # /opt/iiab + sugarizer_version: sugarizer-1.0 sugarizer_git_version: v1.0.1 + sugarizer_server_version: sugarizer-server-1.0 sugarizer_server_git_version: v1.0 + npm_exists: False From 413424bb695976b2851a1f8460706e5792c022cd Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 19:30:04 -0400 Subject: [PATCH 071/374] Update main.yml --- roles/sugarizer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index a7f88749c..b8bbcc9fc 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -7,6 +7,6 @@ sugarizer_version: sugarizer-1.0 sugarizer_git_version: v1.0.1 sugarizer_server_version: sugarizer-server-1.0 -sugarizer_server_git_version: v1.0 +sugarizer_server_git_version: master npm_exists: False From d6ace108b647bf14f92aedb2b1e516f7fa112817 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 19:34:01 -0400 Subject: [PATCH 072/374] Update main.yml --- roles/sugarizer/defaults/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index b8bbcc9fc..36fd4f494 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -5,8 +5,13 @@ sugarizer_location: {{ iiab_base }} # /opt/iiab sugarizer_version: sugarizer-1.0 sugarizer_git_version: v1.0.1 +# PLEASE HELP MONITOR https://github.com/llaske/sugarizer/releases FOR +# STABLE/OFFICIAL RELEASES! sugarizer_server_version: sugarizer-server-1.0 sugarizer_server_git_version: master +# CLONING SUGARIZER-SERVER'S MASTER BRANCH IS NOT A LONG-TERM SOLUTION, +# SO LET'S MONITOR https://github.com/llaske/sugarizer-server/releases +# FOR A MORE STABLE/OFFICIAL RELEASE DURING MID-2018! npm_exists: False From 8c72fef24f77649fbd15503b626afb7c23aedaae Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 19:51:10 -0400 Subject: [PATCH 073/374] Overhauled for Readability --- roles/sugarizer/tasks/main.yml | 89 ++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 30 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index c0ffa8572..530842726 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -1,21 +1,37 @@ +# 0. CLEAN UP PRIOR VERSIONS OF SUGARIZER (NEEDS WORK!) + - name: Wipe /library/www/html/sugarizer* if sugarizer-1.0 shell: "rm -rf {{ doc_root }}/sugarizer*" when: sugarizer_version == "sugarizer-1.0" -- name: D/L latest stable Sugarizer from location we control to /opt/iiab/downloads/ - get_url: - url: "{{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz" - dest: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz" - timeout: "{{ download_timeout }}" - when: internet_available +# 1. DOWNLOAD /opt/iiab/sugarizer -- name: Untar to /opt/iiab/{{ sugarizer_version }} - unarchive: - src: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz" +# July 2018: instead let's "git clone" IIAB's specified/preferred version (2 steps below) +#- name: D/L latest stable Sugarizer from location we control to /opt/iiab/downloads/ +# get_url: +# url: "{{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz" +# dest: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz" +# timeout: "{{ download_timeout }}" +# when: internet_available +# +#- name: Untar to /opt/iiab/{{ sugarizer_version }} +# unarchive: +# src: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz" +# dest: "{{ sugarizer_location }}" +# creates: "{{ sugarizer_location }}/{{ sugarizer_version }}/index.html" +## command: tar xzf {{ downloads_dir }}/{{ sugarizer_version }}.tar.gz -C {{ sugarizer_location }} +## creates="{{ sugarizer_location }}/{{ sugarizer_version }}/index.html" + +- name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab + git: + repo: https://github.com/llaske/sugarizer dest: "{{ sugarizer_location }}" - creates: "{{ sugarizer_location }}/{{ sugarizer_version }}/index.html" -# command: tar xzf {{ downloads_dir }}/{{ sugarizer_version }}.tar.gz -C {{ sugarizer_location }} -# creates="{{ sugarizer_location }}/{{ sugarizer_version }}/index.html" + version: "{{ sugarizer_git_version }}" + +- name: Move /opt/iiab/sugarizer to /opt/iiab/{{ sugarizer_version }} + move: + src: "{{ sugarizer_location }}/sugarizer" + dest: "{{ sugarizer_location }}/{{ sugarizer_version }}" - name: Create symbolic link /opt/iiab/sugarizer -> /opt/iiab/{{ sugarizer_version }} file: @@ -23,7 +39,12 @@ dest: "{{ sugarizer_location }}/sugarizer" state: link -# Not working in July 2018, so "git clone" instead (2 steps that follow) +# 2. DOWNLOAD /opt/iiab/sugarizer-server + +# July 2018: instead let's "git clone" IIAB's specified/preferred version (2 steps below) +# Tarfile below was not working, as documented at: +# https://github.com/iiab/iiab/issues/798 +# https://github.com/iiab/iiab/issues/814 #- name: Download latest stable Server from location we control # get_url: # url: "{{ iiab_download_url }}/{{ sugarizer_server_version }}.tar.gz" @@ -37,13 +58,11 @@ # dest: "{{ sugarizer_location }}" # creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/index.html" -# CLONING SUGARIZER'S MASTER IN NOT A LONG-TERM SOLUTION, BUT -# UNCOMMENTING "version:" LINE BELOW CAN BRING STABILITY IN FUTURE -- name: Clone llaske/sugarizer-server from GitHub to /opt/iiab +- name: Clone llaske/sugarizer-server ({{ sugarizer_server_git_version }}) from GitHub to /opt/iiab git: repo: https://github.com/llaske/sugarizer-server dest: "{{ sugarizer_location }}" -# version: "{{ sugarizer_server_version }}" + version: "{{ sugarizer_server_git_version }}" - name: Move /opt/iiab/sugarizer-server to /opt/iiab/{{ sugarizer_server_version }} move: @@ -56,6 +75,10 @@ dest: "{{ sugarizer_location }}/sugarizer-server" state: link +# 3. INSTALL A GOOD VERSION OF Node.js AND npm + +# Both Raspbian and Debian 9 STILL need this approach as of 2018-07-11, +# as documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 - name: Set up Node.js 8.x apt sources (debuntu but avoid ubuntu-18) shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - when: internet_available and is_debuntu and not is_ubuntu_18 @@ -86,6 +109,8 @@ - nodejs - npm +# 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules + # attempting to reinstall npm is broken on Raspbian 9 - name: Check for Sugarizer already installed stat: @@ -98,6 +123,22 @@ npm_exists: True when: npm.stat is defined and npm.stat.exists +- name: Create the express framework for Node.js (OS's other than Fedora 18) + shell: npm install + args: + chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" + creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" + #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/server/node_modules" + when: not is_F18 and not npm_exists + +- name: Create the express framework for Node.js (Fedora 18) + shell: npm install + args: + chdir: "{{ sugarizer_location }}/sugarizer/server" + when: is_F18 and not npm_exists + +# 5. PLACE CONFIG FILES + - name: Create systemd files and copy our ini file template: src: "{{ item.src }}" @@ -116,19 +157,7 @@ dest: /etc/apache2/sites-enabled/sugarizer.conf state: link -- name: Create the express framework for Node.js (OS's other than Fedora 18) - shell: npm install - args: - chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" - creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" - #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/server/node_modules" - when: not is_F18 and not npm_exists - -- name: Create the express framework for Node.js (Fedora 18) - shell: npm install - args: - chdir: "{{ sugarizer_location }}/sugarizer/server" - when: is_F18 and not npm_exists +# 6. RESTART/STOP SYSTEMD SERVICE - name: Enable services (all OS's) service: From 1d0c57d6a888bf89b32139ec323cc152798b1b42 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 20:12:30 -0400 Subject: [PATCH 074/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 530842726..7e1c1c308 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -27,11 +27,12 @@ repo: https://github.com/llaske/sugarizer dest: "{{ sugarizer_location }}" version: "{{ sugarizer_git_version }}" + when: internet_available - name: Move /opt/iiab/sugarizer to /opt/iiab/{{ sugarizer_version }} - move: - src: "{{ sugarizer_location }}/sugarizer" - dest: "{{ sugarizer_location }}/{{ sugarizer_version }}" + command: mv "{{ sugarizer_location }}/sugarizer" "{{ sugarizer_location }}/{{ sugarizer_version }}" + args: + creates: "{{ sugarizer_location }}/{{ sugarizer_version }}" - name: Create symbolic link /opt/iiab/sugarizer -> /opt/iiab/{{ sugarizer_version }} file: @@ -63,11 +64,12 @@ repo: https://github.com/llaske/sugarizer-server dest: "{{ sugarizer_location }}" version: "{{ sugarizer_server_git_version }}" + when: internet_available - name: Move /opt/iiab/sugarizer-server to /opt/iiab/{{ sugarizer_server_version }} - move: - src: "{{ sugarizer_location }}/sugarizer-server" - dest: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" + command: mv "{{ sugarizer_location }}/sugarizer-server" "{{ sugarizer_location }}/{{ sugarizer_server_version }}" + args: + creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" - name: Create symbolic link /opt/iiab/sugarizer-server -> /opt/iiab/{ sugarizer_server_version }} file: From b9e8aee3a064e47f04c6d4ed3c2c45b68ead7fe7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 20:25:36 -0400 Subject: [PATCH 075/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 7e1c1c308..2c7dfe45c 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -113,17 +113,17 @@ # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules -# attempting to reinstall npm is broken on Raspbian 9 +# re-running "npm install" fails on Raspbian 9 - name: Check for Sugarizer already installed stat: path: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" - register: npm + register: nmtest ignore_errors: true - name: Set a flag to abort second attempt to install set_fact: - npm_exists: True - when: npm.stat is defined and npm.stat.exists + node_modules_exists: True + when: nmtest.stat is defined and nmtest.stat.exists - name: Create the express framework for Node.js (OS's other than Fedora 18) shell: npm install @@ -131,13 +131,13 @@ chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/server/node_modules" - when: not is_F18 and not npm_exists + when: not is_F18 and not node_modules_exists - name: Create the express framework for Node.js (Fedora 18) shell: npm install args: chdir: "{{ sugarizer_location }}/sugarizer/server" - when: is_F18 and not npm_exists + when: is_F18 and not node_modules_exists # 5. PLACE CONFIG FILES From d678a101d35affa74589f5c1a1c3d14c24d1ce79 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 20:26:00 -0400 Subject: [PATCH 076/374] Update main.yml --- roles/sugarizer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index 36fd4f494..dca42d9cd 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -14,4 +14,4 @@ sugarizer_server_git_version: master # SO LET'S MONITOR https://github.com/llaske/sugarizer-server/releases # FOR A MORE STABLE/OFFICIAL RELEASE DURING MID-2018! -npm_exists: False +node_modules_exists: False From 1150943619d084dd5480ac3b09a54e78e4905ea3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 20:27:55 -0400 Subject: [PATCH 077/374] Update main.yml --- roles/sugarizer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index dca42d9cd..8f5c40c57 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -1,7 +1,7 @@ sugarizer_install: True sugarizer_enabled: False -sugarizer_location: {{ iiab_base }} # /opt/iiab +sugarizer_location: "{{ iiab_base }}" # /opt/iiab sugarizer_version: sugarizer-1.0 sugarizer_git_version: v1.0.1 From 28b7816fdfbda709af7ef549d811a8f6d04ecf62 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 20:38:19 -0400 Subject: [PATCH 078/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 2c7dfe45c..13937dfa1 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -6,7 +6,7 @@ # 1. DOWNLOAD /opt/iiab/sugarizer -# July 2018: instead let's "git clone" IIAB's specified/preferred version (2 steps below) +# July 2018: instead let's "git clone" IIAB's specified/preferred version #- name: D/L latest stable Sugarizer from location we control to /opt/iiab/downloads/ # get_url: # url: "{{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz" @@ -25,14 +25,14 @@ - name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab git: repo: https://github.com/llaske/sugarizer - dest: "{{ sugarizer_location }}" + dest: "{{ sugarizer_location }}/{{ sugarizer_version }}" version: "{{ sugarizer_git_version }}" when: internet_available -- name: Move /opt/iiab/sugarizer to /opt/iiab/{{ sugarizer_version }} - command: mv "{{ sugarizer_location }}/sugarizer" "{{ sugarizer_location }}/{{ sugarizer_version }}" - args: - creates: "{{ sugarizer_location }}/{{ sugarizer_version }}" +#- name: Move /opt/iiab/sugarizer to /opt/iiab/{{ sugarizer_version }} +# command: mv "{{ sugarizer_location }}/sugarizer" "{{ sugarizer_location }}/{{ sugarizer_version }}" +# args: +# creates: "{{ sugarizer_location }}/{{ sugarizer_version }}" - name: Create symbolic link /opt/iiab/sugarizer -> /opt/iiab/{{ sugarizer_version }} file: @@ -42,7 +42,7 @@ # 2. DOWNLOAD /opt/iiab/sugarizer-server -# July 2018: instead let's "git clone" IIAB's specified/preferred version (2 steps below) +# July 2018: instead let's "git clone" IIAB's specified/preferred version # Tarfile below was not working, as documented at: # https://github.com/iiab/iiab/issues/798 # https://github.com/iiab/iiab/issues/814 @@ -62,14 +62,14 @@ - name: Clone llaske/sugarizer-server ({{ sugarizer_server_git_version }}) from GitHub to /opt/iiab git: repo: https://github.com/llaske/sugarizer-server - dest: "{{ sugarizer_location }}" + dest: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" version: "{{ sugarizer_server_git_version }}" when: internet_available -- name: Move /opt/iiab/sugarizer-server to /opt/iiab/{{ sugarizer_server_version }} - command: mv "{{ sugarizer_location }}/sugarizer-server" "{{ sugarizer_location }}/{{ sugarizer_server_version }}" - args: - creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" +#- name: Move /opt/iiab/sugarizer-server to /opt/iiab/{{ sugarizer_server_version }} +# command: mv "{{ sugarizer_location }}/sugarizer-server" "{{ sugarizer_location }}/{{ sugarizer_server_version }}" +# args: +# creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" - name: Create symbolic link /opt/iiab/sugarizer-server -> /opt/iiab/{ sugarizer_server_version }} file: From 609d600386fa457d274c6c33be8f68d884176013 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 20:49:03 -0400 Subject: [PATCH 079/374] Update main.yml --- roles/mongodb/tasks/main.yml | 84 +++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 81a4864c9..5ba9a9d83 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -1,6 +1,7 @@ -- name: Install mongodb required packages - package: name={{ item }} - state=present +- name: Install MongoDB required packages + package: + name: "{{ item }}" + state: present with_items: - mongodb-server - mongodb @@ -8,50 +9,55 @@ tags: - download -- name: create the data directory for mongodb - file: state=directory - path={{ item.path }} - owner=mongodb +- name: Create the data directory for MongoDB + file: + state: directory + path: "{{ item.path }}" + owner: mongodb with_items: - - { path: '/var/run/mongodb' } - - { path: '/library/dbdata/mongodb' } - - { path: '/var/log/mongodb' } + - { path: '/var/run/mongodb' } + - { path: '/library/dbdata/mongodb' } + - { path: '/var/log/mongodb' } -- name: Move required files - template: src={{ item.src }} - dest={{ item.dest }} - owner=root - group=root - mode=0644 +- name: Position /etc/mongod.conf and mongodb.service + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: root + group: root + mode: 0644 with_items: - - { src: 'mongodb.service' , dest: '/etc/systemd/system/' } - - { src: 'mongod.conf' , dest: '/etc/mongod.conf'} + - { src: 'mongodb.service' , dest: '/etc/systemd/system/' } + - { src: 'mongod.conf' , dest: '/etc/mongod.conf'} -- name: enable services - service: name={{ item.name }} - enabled=yes - state=restarted +- name: Restart service if enabled + service: + name: "{{ item.name }}" + enabled: yes + state: restarted with_items: - - { name: mongodb } + - { name: mongodb } when: mongodb_enabled -- name: disable services - service: name={{ item.name }} - enabled=no - state=stopped +- name: Stop service if not enabled + service: + name: "{{ item.name }}" + enabled: no + state: stopped with_items: - - { name: mongodb } + - { name: mongodb } when: not mongodb_enabled -- name: add mongodb to service list - ini_file: dest="{{ service_filelist }}" - section=mongodb - option="{{ item.option }}" - value="{{ item.value }}" +- name: Add 'mongodb' to list of services at /etc/iiab/iiab.ini + ini_file: + dest: "{{ service_filelist }}" + section: mongodb + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - - option: name - value: MongoDB - - option: description - value: '"MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling."' - - option: enabled - value: "{{ mongodb_enabled }}" + - option: name + value: MongoDB + - option: description + value: '"MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling."' + - option: enabled + value: "{{ mongodb_enabled }}" From 0626961cf2ff52cae3b55b12d4313f511a560857 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 21:03:06 -0400 Subject: [PATCH 080/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 13937dfa1..6fdc38b99 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -167,6 +167,7 @@ enabled: yes state: restarted with_items: + - { name: mongodb } - { name: sugarizer } when: sugarizer_enabled From c5cd1e273615d13e3b14a22acbf5a7638daa626f Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 21:27:40 -0400 Subject: [PATCH 081/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 44 +++++++--------------------------- 1 file changed, 8 insertions(+), 36 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 6fdc38b99..272f10097 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -6,34 +6,14 @@ # 1. DOWNLOAD /opt/iiab/sugarizer -# July 2018: instead let's "git clone" IIAB's specified/preferred version -#- name: D/L latest stable Sugarizer from location we control to /opt/iiab/downloads/ -# get_url: -# url: "{{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz" -# dest: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz" -# timeout: "{{ download_timeout }}" -# when: internet_available -# -#- name: Untar to /opt/iiab/{{ sugarizer_version }} -# unarchive: -# src: "{{ downloads_dir }}/{{ sugarizer_version }}.tar.gz" -# dest: "{{ sugarizer_location }}" -# creates: "{{ sugarizer_location }}/{{ sugarizer_version }}/index.html" -## command: tar xzf {{ downloads_dir }}/{{ sugarizer_version }}.tar.gz -C {{ sugarizer_location }} -## creates="{{ sugarizer_location }}/{{ sugarizer_version }}/index.html" - - name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab git: repo: https://github.com/llaske/sugarizer dest: "{{ sugarizer_location }}/{{ sugarizer_version }}" version: "{{ sugarizer_git_version }}" + force: yes when: internet_available -#- name: Move /opt/iiab/sugarizer to /opt/iiab/{{ sugarizer_version }} -# command: mv "{{ sugarizer_location }}/sugarizer" "{{ sugarizer_location }}/{{ sugarizer_version }}" -# args: -# creates: "{{ sugarizer_location }}/{{ sugarizer_version }}" - - name: Create symbolic link /opt/iiab/sugarizer -> /opt/iiab/{{ sugarizer_version }} file: src: "{{ sugarizer_location }}/{{ sugarizer_version }}" @@ -42,28 +22,20 @@ # 2. DOWNLOAD /opt/iiab/sugarizer-server -# July 2018: instead let's "git clone" IIAB's specified/preferred version -# Tarfile below was not working, as documented at: +# July 2018: http://download.iiab.io/packages/sugarizer-server-1.0.tar.gz +# was flawed, as documented at: +# https://github.com/iiab/iiab/pull/814#issuecomment-404211098 +# Versions of MongoDB, npm (& Node.js ?) matter! Sugarizer 1.0 Context: # https://github.com/iiab/iiab/issues/798 -# https://github.com/iiab/iiab/issues/814 -#- name: Download latest stable Server from location we control -# get_url: -# url: "{{ iiab_download_url }}/{{ sugarizer_server_version }}.tar.gz" -# dest: "{{ downloads_dir }}/{{ sugarizer_server_version }}.tar.gz" -# timeout: "{{ download_timeout }}" -# when: internet_available -# -#- name: Untar to /opt/iiab/{{ sugarizer_server_version }} -# unarchive: -# src: "{{ downloads_dir }}/{{ sugarizer_server_version }}.tar.gz" -# dest: "{{ sugarizer_location }}" -# creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/index.html" +# Going forward let's "git clone" IIAB's preferred version, of sugarizer +# and sugarizer-server, as specified in roles/sugarizer/defaults/main.yml - name: Clone llaske/sugarizer-server ({{ sugarizer_server_git_version }}) from GitHub to /opt/iiab git: repo: https://github.com/llaske/sugarizer-server dest: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" version: "{{ sugarizer_server_git_version }}" + force: yes when: internet_available #- name: Move /opt/iiab/sugarizer-server to /opt/iiab/{{ sugarizer_server_version }} From 995f7e7630a01eb63d98052002e7194e4fd7ad31 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 21:29:49 -0400 Subject: [PATCH 082/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 272f10097..b20fe8b28 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -28,7 +28,7 @@ # Versions of MongoDB, npm (& Node.js ?) matter! Sugarizer 1.0 Context: # https://github.com/iiab/iiab/issues/798 # Going forward let's "git clone" IIAB's preferred version, of sugarizer -# and sugarizer-server, as specified in roles/sugarizer/defaults/main.yml +# AND sugarizer-server, as specified in roles/sugarizer/defaults/main.yml - name: Clone llaske/sugarizer-server ({{ sugarizer_server_git_version }}) from GitHub to /opt/iiab git: From 0ca4f33525ba81d48de8e147cc0b0279e605fd30 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 21:40:04 -0400 Subject: [PATCH 083/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index b20fe8b28..29990f2ad 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -38,11 +38,6 @@ force: yes when: internet_available -#- name: Move /opt/iiab/sugarizer-server to /opt/iiab/{{ sugarizer_server_version }} -# command: mv "{{ sugarizer_location }}/sugarizer-server" "{{ sugarizer_location }}/{{ sugarizer_server_version }}" -# args: -# creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" - - name: Create symbolic link /opt/iiab/sugarizer-server -> /opt/iiab/{ sugarizer_server_version }} file: src: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" @@ -51,7 +46,7 @@ # 3. INSTALL A GOOD VERSION OF Node.js AND npm -# Both Raspbian and Debian 9 STILL need this approach as of 2018-07-11, +# Both Raspbian and Debian 9 STILL need this approach as of July 2018, # as documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 - name: Set up Node.js 8.x apt sources (debuntu but avoid ubuntu-18) shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - @@ -85,7 +80,7 @@ # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules -# re-running "npm install" fails on Raspbian 9 +# Re-running "npm install" fails on Raspbian 9 if not other OS's - name: Check for Sugarizer already installed stat: path: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" @@ -125,7 +120,7 @@ - { src: 'sugarizer.ini', dest: '{{ sugarizer_location }}/{{ sugarizer_server_version }}/env/sugarizer.ini', mode: '0644' } - { src: 'sugarizer.conf', dest: '/etc/apache2/sites-available', mode: '0644' } -- name: Create symlink enabling short URL http://box/sugarizer +- name: Create symlink for short URL http://box/sugarizer file: src: /etc/apache2/sites-available/sugarizer.conf dest: /etc/apache2/sites-enabled/sugarizer.conf From fbf55019e79204dfda0c20cf3ad6f61a85daa45a Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 21:49:03 -0400 Subject: [PATCH 084/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 29990f2ad..ef507903a 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -81,13 +81,13 @@ # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules # Re-running "npm install" fails on Raspbian 9 if not other OS's -- name: Check for Sugarizer already installed +- name: Check for /opt/iiab/{{ sugarizer_server_version }}/node_modules stat: path: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" register: nmtest ignore_errors: true -- name: Set a flag to abort second attempt to install +- name: Set a flag to prevent re-running of "npm install" set_fact: node_modules_exists: True when: nmtest.stat is defined and nmtest.stat.exists From 9103063af8e95ccc438e1e60e3214004d1d2f059 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 21:54:21 -0400 Subject: [PATCH 085/374] Update mongodb.service --- roles/mongodb/templates/mongodb.service | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/roles/mongodb/templates/mongodb.service b/roles/mongodb/templates/mongodb.service index 328682a10..40f4f573f 100644 --- a/roles/mongodb/templates/mongodb.service +++ b/roles/mongodb/templates/mongodb.service @@ -6,8 +6,7 @@ After=syslog.target network.target Type=simple User=mongodb Group=mongodb -ExecStart=/usr/bin/mongod -f /etc/mongod.conf +ExecStart=/usr/bin/mongod -f /etc/mongod.conf [Install] WantedBy=multi-user.target - From 3461c779e5f1ef554759f6f1152134f4ffb945a1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 11 Jul 2018 23:25:27 -0400 Subject: [PATCH 086/374] Comments cleaned up (just-merged PR #888) --- roles/sugarizer/tasks/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index ef507903a..7eecf12cf 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -1,6 +1,6 @@ # 0. CLEAN UP PRIOR VERSIONS OF SUGARIZER (NEEDS WORK!) -- name: Wipe /library/www/html/sugarizer* if sugarizer-1.0 +- name: Wipe /library/www/html/sugarizer* if installing sugarizer-1.0 shell: "rm -rf {{ doc_root }}/sugarizer*" when: sugarizer_version == "sugarizer-1.0" @@ -27,7 +27,7 @@ # https://github.com/iiab/iiab/pull/814#issuecomment-404211098 # Versions of MongoDB, npm (& Node.js ?) matter! Sugarizer 1.0 Context: # https://github.com/iiab/iiab/issues/798 -# Going forward let's "git clone" IIAB's preferred version, of sugarizer +# Going forward let's "git clone" IIAB's preferred versions, of sugarizer # AND sugarizer-server, as specified in roles/sugarizer/defaults/main.yml - name: Clone llaske/sugarizer-server ({{ sugarizer_server_git_version }}) from GitHub to /opt/iiab @@ -108,7 +108,7 @@ # 5. PLACE CONFIG FILES -- name: Create systemd files and copy our ini file +- name: Configure sugarizer.service (systemd), sugarizer.conf (Apache) and sugarizer.ini template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -138,7 +138,7 @@ - { name: sugarizer } when: sugarizer_enabled -- name: Disable services (all OS's) +- name: Disable service (all OS's) service: name: "{{ item.name }}" enabled: no From 5b5a57613c1af48a17454a799ef8de09961b6cdd Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 12 Jul 2018 01:36:24 -0400 Subject: [PATCH 087/374] Update main.yml --- roles/kalite/defaults/main.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/roles/kalite/defaults/main.yml b/roles/kalite/defaults/main.yml index 086f6839e..234ecd25f 100644 --- a/roles/kalite/defaults/main.yml +++ b/roles/kalite/defaults/main.yml @@ -1,21 +1,28 @@ ---- # The values here are defaults. -# To override them edit the main var definitions in iiab/vars -kalite_version: "0.17.4" +# To override them edit the main var definitions in /opt/iiab/iiab/vars/local_vars.yml +kalite_install: True +kalite_enabled: False + +kalite_server_port: 8008 +kalite_admin_user: Admin +kalite_admin_password: changeme + +kalite_version: "0.17.5" kalite_repo_url: "https://github.com/learningequality/ka-lite.git" +kalite_requirements: "https://raw.githubusercontent.com/learningequality/ka-lite/master/requirements.txt" + kalite_venv: "/usr/local/kalite/venv" kalite_program: "{{ kalite_venv }}/bin/kalite" -kalite_requirements: "https://raw.githubusercontent.com/learningequality/ka-lite/master/requirements.txt" kalite_root: "/library/ka-lite" + +# Unused in 2018; but remain as placeholder for Fedora 18 legacy (XO laptops) +kalite_cron_enabled: False kalite_user: kalite # obtain a password hash with - python -c 'import crypt; print crypt.crypt("", "$6$<salt>")' kalite_password_hash: $6$<salt>$KHET0XRRsgAY.wOWyTOI3W7dyDh0ESOr48uI5vtk2xdzsU7aw0TF4ZkNuM34RmHBGMJ1fTCmOyVobo0LOhBlJ/ kalite_password: kalite -kalite_admin_user: Admin -kalite_admin_password: changeme -kalite_server_name: kalite -kalite_server_port: 8008 -kalite_enabled: False -kalite_cron_enabled: False -khan_assessment_install: True -khan_assessment_url: "http://pantry.learningequality.org/downloads/ka-lite/0.16/content/khan_assessment.zip" + +# Unused in 2018 +# kalite_server_name: kalite +# khan_assessment_install: True +# khan_assessment_url: "http://pantry.learningequality.org/downloads/ka-lite/0.16/content/khan_assessment.zip" From ee985be92919a346b4fd70699cd11eb7ca34560d Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:36:38 -0400 Subject: [PATCH 088/374] Update default_vars.yml --- vars/default_vars.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index ebe72e509..d372948aa 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -295,14 +295,16 @@ wordpress_enabled: False # KA Lite kalite_install: True +kalite_enabled: False +kalite_server_port: 8008 kalite_root: "/library/ka-lite" +# Unused in 2018; but remain as placeholder for Fedora 18 legacy (XO laptops) +kalite_cron_enabled: False kalite_user: kalite kalite_password_hash: $6$<salt>$KHET0XRRsgAY.wOWyTOI3W7dyDh0ESOr48uI5vtk2xdzsU7aw0TF4ZkNuM34RmHBGMJ1fTCmOyVobo0LOhBlJ/ kalite_password: kalite -kalite_server_name: kalite -kalite_server_port: 8008 -kalite_enabled: False -kalite_cron_enabled: False +# Unused in 2018 +# kalite_server_name: kalite # Kiwix kiwix_install: True From 4c8e7e3f3707c549de5444a419c2ccfaed989b8d Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:37:26 -0400 Subject: [PATCH 089/374] Update main.yml --- roles/kalite/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kalite/defaults/main.yml b/roles/kalite/defaults/main.yml index 234ecd25f..287f35f0d 100644 --- a/roles/kalite/defaults/main.yml +++ b/roles/kalite/defaults/main.yml @@ -15,7 +15,7 @@ kalite_venv: "/usr/local/kalite/venv" kalite_program: "{{ kalite_venv }}/bin/kalite" kalite_root: "/library/ka-lite" -# Unused in 2018; but remain as placeholder for Fedora 18 legacy (XO laptops) +# Unused in 2018; but remain as placeholders for Fedora 18 legacy (XO laptops) kalite_cron_enabled: False kalite_user: kalite # obtain a password hash with - python -c 'import crypt; print crypt.crypt("<plaintext>", "$6$<salt>")' From 0a704f9e1444af762f373158e22a6ed5cd1210f6 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:37:55 -0400 Subject: [PATCH 090/374] Update default_vars.yml --- vars/default_vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index d372948aa..b2b5452a5 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -298,7 +298,7 @@ kalite_install: True kalite_enabled: False kalite_server_port: 8008 kalite_root: "/library/ka-lite" -# Unused in 2018; but remain as placeholder for Fedora 18 legacy (XO laptops) +# Unused in 2018; but remain as placeholders for Fedora 18 legacy (XO laptops) kalite_cron_enabled: False kalite_user: kalite kalite_password_hash: $6$<salt>$KHET0XRRsgAY.wOWyTOI3W7dyDh0ESOr48uI5vtk2xdzsU7aw0TF4ZkNuM34RmHBGMJ1fTCmOyVobo0LOhBlJ/ From 78fae2d16650ba2cebdd163bcae987ca29735c46 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:38:23 -0400 Subject: [PATCH 091/374] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index 8e3b2cb0f..21f7556f5 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -159,6 +159,7 @@ wordpress_enabled: True kalite_install: True kalite_enabled: True +# Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True kiwix_install: True From a502c67d2c3d8ce0322219c2273c5a27cdba48b4 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:39:04 -0400 Subject: [PATCH 092/374] Update local_vars_medium_vpn.yml --- vars/local_vars_medium_vpn.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_medium_vpn.yml b/vars/local_vars_medium_vpn.yml index bb5cfed17..70ec6105e 100644 --- a/vars/local_vars_medium_vpn.yml +++ b/vars/local_vars_medium_vpn.yml @@ -159,6 +159,7 @@ wordpress_enabled: True kalite_install: True kalite_enabled: True +# Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True kiwix_install: True From 02c21cbf9d990453136c1a4368656a08382b41c6 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:39:35 -0400 Subject: [PATCH 093/374] Update local_vars_min.yml --- vars/local_vars_min.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index a29a150db..f41915947 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -159,6 +159,7 @@ wordpress_enabled: False kalite_install: True kalite_enabled: True +# Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True kiwix_install: True From 9a6c4c08144a231261e8b65cb7746f4386606bc5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:39:55 -0400 Subject: [PATCH 094/374] Update local_vars_min_vpn.yml --- vars/local_vars_min_vpn.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_min_vpn.yml b/vars/local_vars_min_vpn.yml index 351e01b4a..f427a1888 100644 --- a/vars/local_vars_min_vpn.yml +++ b/vars/local_vars_min_vpn.yml @@ -159,6 +159,7 @@ wordpress_enabled: False kalite_install: True kalite_enabled: True +# Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True kiwix_install: True From bc83745b98635216a4d6514df5b16929768596d3 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:40:15 -0400 Subject: [PATCH 095/374] Update local_vars_big.yml --- vars/local_vars_big.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index d89b264d5..db86484b7 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -159,6 +159,7 @@ wordpress_enabled: True kalite_install: True kalite_enabled: True +# Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True kiwix_install: True From 9cc202587b8d0abc461a18cb407934e456d91aee Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:40:35 -0400 Subject: [PATCH 096/374] Update local_vars_big_vpn.yml --- vars/local_vars_big_vpn.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_big_vpn.yml b/vars/local_vars_big_vpn.yml index 699ebc145..78399b980 100644 --- a/vars/local_vars_big_vpn.yml +++ b/vars/local_vars_big_vpn.yml @@ -159,6 +159,7 @@ wordpress_enabled: True kalite_install: True kalite_enabled: True +# Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True kiwix_install: True From 34ce168ab08fc4b22da978d3c8b39ba01e03794e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 01:45:46 -0400 Subject: [PATCH 097/374] Update main.yml --- roles/kalite/defaults/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/kalite/defaults/main.yml b/roles/kalite/defaults/main.yml index 287f35f0d..e2c992e1e 100644 --- a/roles/kalite/defaults/main.yml +++ b/roles/kalite/defaults/main.yml @@ -1,12 +1,9 @@ # The values here are defaults. # To override them edit the main var definitions in /opt/iiab/iiab/vars/local_vars.yml + kalite_install: True kalite_enabled: False -kalite_server_port: 8008 -kalite_admin_user: Admin -kalite_admin_password: changeme - kalite_version: "0.17.5" kalite_repo_url: "https://github.com/learningequality/ka-lite.git" kalite_requirements: "https://raw.githubusercontent.com/learningequality/ka-lite/master/requirements.txt" @@ -15,6 +12,10 @@ kalite_venv: "/usr/local/kalite/venv" kalite_program: "{{ kalite_venv }}/bin/kalite" kalite_root: "/library/ka-lite" +kalite_server_port: 8008 +kalite_admin_user: Admin +kalite_admin_password: changeme + # Unused in 2018; but remain as placeholders for Fedora 18 legacy (XO laptops) kalite_cron_enabled: False kalite_user: kalite From 564c2164450620c5c414b39e6078db13dffd16b9 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 02:39:20 -0400 Subject: [PATCH 098/374] Update main.yml --- roles/kalite/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index 35f1932f7..b69de706b 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -47,8 +47,6 @@ value: '"KA Lite is a server to present Khan Academy videos offline and to download them."' - option: path value: "{{ kalite_root }}" - - option: server_name - value: "{{ kalite_server_name }}" - option: port value: "{{ kalite_server_port }}" - option: enabled From 3a42e7e2db2030ddb9ff6cc2bed7e694e33ff09a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 02:42:56 -0400 Subject: [PATCH 099/374] Update main.yml --- roles/kalite/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index b69de706b..84c508fe1 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -53,5 +53,3 @@ value: "{{ kalite_enabled }}" - option: cron_enabled value: "{{ kalite_cron_enabled }}" - - option: khan_assessment_install - value: "{{ khan_assessment_install }}" From 01197db87c1e5c94498e236e3482685269fb5328 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 13:36:09 -0400 Subject: [PATCH 100/374] Understandability/Context for outsiders --- roles/network/defaults/main.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 55c2ffff1..a6a7cc8b4 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -1,4 +1,3 @@ ---- # Defaults for network detection wireless_lan_present: False strict_networking: False @@ -19,14 +18,14 @@ discovered_lan_iface: "none" discovered_wired_iface: "none" discovered_wireless_iface: "none" -#Redhat +# Red Hat #iiab_wired_lan_iface: "none" #iiab_wireless_lan_iface: "none" has_WAN: False has_ifcfg_gw: "none" has_wifi_gw: "none" -#Debian +# Debian dhcpcd_result: "" wan_in_interfaces: False network_manager_active: False @@ -39,7 +38,7 @@ gui_desired_network_role: Gateway wondershaper_dspeed: "4096" wondershaper_upspeed: "1024" -# WiFi +# Wi-Fi host_ssid: IIAB hostapd_wait: 1 host_wifi_mode: g @@ -63,16 +62,18 @@ network_config_dir: /etc/network/interfaces.d dns_jail_enabled: False services_externally_visible: False -# following variables set for old apache,dhcpd,named usage +# Following variables set for old apache, dhcpd, named usage dhcpd_install: True dhcpd_enabled: True named_install: True named_enabled: True dnsmasq_enabled: False dnsmasq_install: False + +# Possibly useful Tim's earlier Nodogsplash (github.com/iiab/iiab/issues/826) captive_portal_enabled: False -# for simple python captive portal +# For simple python Captive Portal (for Anish & Jerry's github.com/iiab/iiab/pull/870) py_captive_portal_install: True py_captive_portal_enabled: True py_captive_portal_port: "9090" From d9398e39a7b9cd7d710ed4ed2b5192bd425aef75 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 13:36:44 -0400 Subject: [PATCH 101/374] modern Ansible syntax/style for readability --- roles/network/tasks/captive_portal.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/roles/network/tasks/captive_portal.yml b/roles/network/tasks/captive_portal.yml index 8dad37fa7..033314121 100644 --- a/roles/network/tasks/captive_portal.yml +++ b/roles/network/tasks/captive_portal.yml @@ -1,8 +1,10 @@ -- name: Create directory for captive portal script - file: path=/opt/iiab/captive-portal state=directory +- name: Create directory for Captive Portal script + file: + path: /opt/iiab/captive-portal + state: directory when: py_captive_portal_install -- name: Copy captive portal script +- name: Copy Captive Portal script template: src: roles/network/templates/captive_portal/captive_portal.py.j2 dest: /opt/iiab/captive-portal/captive_portal.py @@ -11,7 +13,7 @@ mode: 0740 when: py_captive_portal_install -- name: Copy captive portal service file +- name: Copy Captive Portal service file template: src: roles/network/templates/captive_portal/captive_portal.service.j2 dest: /etc/systemd/system/captive_portal.service @@ -21,17 +23,25 @@ when: py_captive_portal_install - name: Enable captive_portal after copying files - service: name=captive_portal.service enabled=yes + service: + name: captive_portal.service + enabled: yes when: py_captive_portal_install and py_captive_portal_enabled - name: Start captive_portal after copying files - service: name=captive_portal.service state=started + service: + name: captive_portal.service + state: started when: py_captive_portal_install and py_captive_portal_enabled - name: Disable captive_portal after copying files - service: name=captive_portal.service enabled=no + service: + name: captive_portal.service + enabled: no when: py_captive_portal_install and py_captive_portal_enabled - name: Stop captive_portal after copying files - service: name=captive_portal.service state=started + service: + name: captive_portal.service + state: started when: py_captive_portal_install and py_captive_portal_enabled From 1337b651acdab67458ca0045dbf97db8589a6469 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 13:50:32 -0400 Subject: [PATCH 102/374] modern Ansible syntax/style for readability --- roles/network/tasks/enable_services.yml | 174 ++++++++++++++---------- 1 file changed, 99 insertions(+), 75 deletions(-) diff --git a/roles/network/tasks/enable_services.yml b/roles/network/tasks/enable_services.yml index 5660691c7..e7d0e403b 100644 --- a/roles/network/tasks/enable_services.yml +++ b/roles/network/tasks/enable_services.yml @@ -1,157 +1,181 @@ - name: Disable dhcpd service - service: name=dhcpd - enabled=no + service: + name: dhcpd + enabled: no when: not dhcpd_enabled and dhcpd_install # service is restarted with NM dispatcher.d script - name: Enable dhcpd service - service: name=dhcpd - enabled=yes + service: + name: dhcpd + enabled: yes when: dhcpd_enabled and dhcpd_install - name: Copy /etc/sysconfig/dhcpd file - template: src={{ item.src }} - dest={{ item.dest }} - owner=root - group=root - mode={{ item.mode }} + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: root + group: root + mode: "{{ item.mode }}" with_items: - - { src: 'dhcp/dhcpd-env.j2' , dest: '/etc/sysconfig/dhcpd' , mode: '0644' } + - { src: 'dhcp/dhcpd-env.j2', dest: '/etc/sysconfig/dhcpd', mode: '0644' } - { src: 'dhcp/dhcpd-iiab.conf.j2', dest: '/etc/dhcpd-iiab.conf', mode: '0644' } when: dhcpd_enabled and dhcpd_install - name: Copy named file - template: src={{ item.src }} - dest={{ item.dest }} - owner=root - group=root - mode={{ item.mode }} + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: root + group: root + mode: "{{ item.mode }}" with_items: - { src: 'named/named-iiab.conf.j2' , dest: '/etc/named-iiab.conf' , mode: '0644' } - { src: 'named/school.local.zone.db' , dest: '/var/named-iiab/' , mode: '0644' } - { src: 'named/school.internal.zone.db' , dest: '/var/named-iiab/' , mode: '0644' } - name: Enable named service - service: name={{ dns_service }} - enabled=yes + service: + name: "{{ dns_service }}" + enabled: yes when: named_enabled and named_install - name: Disable named service - service: name={{ dns_service }} - enabled=no + service: + name: "{{ dns_service }}" + enabled: no when: not named_enabled and named_install - name: Disable dnsmasq - service: name=dnsmasq - enabled=no + service: + name: dnsmasq + enabled: no when: not dnsmasq_enabled and dnsmasq_install -- name: dnsmasq copy config file to /etc - template: src=network/dnsmasq.conf.j2 dest=/etc/dnsmasq.conf +- name: Copy dnsmasq.conf to /etc + template: + src: network/dnsmasq.conf.j2 + dest: /etc/dnsmasq.conf when: dnsmasq_enabled and dnsmasq_install - name: Enable dnsmasq - service: name=dnsmasq - enabled=yes + service: + name: dnsmasq + enabled: yes when: dnsmasq_enabled and dnsmasq_install - name: Enable DansGuardian - service: name=dansguardian - enabled=yes + service: + name: dansguardian + enabled: yes when: dansguardian_enabled and dansguardian_install - name: Disable DansGuardian - service: name=dansguardian - enabled=no + service: + name: dansguardian + enabled: no when: not dansguardian_enabled and dansguardian_install - name: Create xs_httpcache flag - lineinfile: dest=/etc/iiab/iiab.env - regexp='^HTTPCACHE_ON=*' - line='HTTPCACHE_ON=True' - state=present + lineinfile: + dest: /etc/iiab/iiab.env + regexp: '^HTTPCACHE_ON=*' + line: 'HTTPCACHE_ON=True' + state: present when: squid_enabled and squid_install - name: Enable Squid service - service: name={{ proxy }} - enabled=yes + service: + name: "{{ proxy }}" + enabled: yes when: squid_enabled and squid_install - name: Copy init script and config file - template: src={{ item.src }} - dest={{ item.dest }} - owner={{ item.owner }} - group={{ item.group }} - mode={{ item.mode }} + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: "{{ item.owner }}" + group: "{{ item.group }}" + mode: "{{ item.mode }}" with_items: - - src: 'squid/squid-iiab.conf.j2' + - src: squid/squid-iiab.conf.j2 dest: '/etc/{{ proxy }}/squid-iiab.conf' owner: '{{ proxy_user }}' group: '{{ proxy_user }}' - mode: '0644' + mode: 0644 when: squid_enabled and squid_install - name: Point to Squid config file from startup file - lineinfile: regexp='^CONFIG' - line='CONFIG=/etc/{{ proxy }}/squid-iiab.conf' - dest=/etc/init.d/{{ proxy }} + lineinfile: + regexp: '^CONFIG' + line: 'CONFIG=/etc/{{ proxy }}/squid-iiab.conf' + dest: "/etc/init.d/{{ proxy }}" when: squid_enabled and squid_install and is_debuntu - name: Disable Squid service - service: name={{ proxy }} - enabled=no + service: + name: "{{ proxy }}" + enabled: no when: not squid_enabled and squid_install - name: Remove xs_httpcache flag - lineinfile: dest=/etc/iiab/iiab.env - regexp='^HTTPCACHE_ON=*' - line='HTTPCACHE_ON=False' - state=present + lineinfile: + dest: /etc/iiab/iiab.env + regexp: '^HTTPCACHE_ON=*' + line: 'HTTPCACHE_ON=False' + state: present when: not squid_enabled - name: Enable Wondershaper service - service: name=wondershaper - enabled=yes + service: + name: wondershaper + enabled: yes when: wondershaper_enabled and wondershaper_install - name: Disable Wondershaper service - service: name=wondershaper - enabled=no + service: + name: wondershaper + enabled: no when: not wondershaper_enabled and wondershaper_install # check-LAN should be iptables.yml remove later - name: Grab clean copy of iiab-gen-iptables - template: src={{ item.0 }} - dest={{ item.1 }} - owner='root' - group='root' - mode='0755' + template: + src: "{{ item.0 }}" + dest: "{{ item.1 }}" + owner: root + group: root + mode: 0755 with_items: - { 0: 'gateway/iiab-gen-iptables', 1: '/usr/bin/iiab-gen-iptables' } -- name: Add 'squid' to service list - ini_file: dest='{{ service_filelist }}' - section=squid - option='{{ item.option }}' - value='{{ item.value }}' +- name: Add 'squid' to list of services at /etc/iiab/iiab.ini + ini_file: + dest: "{{ service_filelist }}" + section: squid + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - option: enabled value: "{{ squid_enabled }}" -- name: Add 'dansguardian' to service list - ini_file: dest='{{ service_filelist }}' - section=dansguardian - option='{{ item.option }}' - value='{{ item.value }}' +- name: Add 'dansguardian' to list of services at /etc/iiab/iiab.ini + ini_file: + dest: "{{ service_filelist }}" + section: dansguardian + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - option: enabled value: "{{ dansguardian_enabled }}" -- name: Add 'wondershaper' to service list - ini_file: dest='{{ service_filelist }}' - section=wondershaper - option='{{ item.option }}' - value='{{ item.value }}' +- name: Add 'wondershaper' to list of services at /etc/iiab/iiab.ini + ini_file: + dest: "{{ service_filelist }}" + section: wondershaper + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - option: enabled value: "{{ wondershaper_enabled }}" From 281e0de7917076005da5c6348e3be99935dd4e3c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 13:51:59 -0400 Subject: [PATCH 103/374] Update enable_services.yml --- roles/network/tasks/enable_services.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/network/tasks/enable_services.yml b/roles/network/tasks/enable_services.yml index e7d0e403b..ba232df08 100644 --- a/roles/network/tasks/enable_services.yml +++ b/roles/network/tasks/enable_services.yml @@ -31,9 +31,9 @@ group: root mode: "{{ item.mode }}" with_items: - - { src: 'named/named-iiab.conf.j2' , dest: '/etc/named-iiab.conf' , mode: '0644' } - - { src: 'named/school.local.zone.db' , dest: '/var/named-iiab/' , mode: '0644' } - - { src: 'named/school.internal.zone.db' , dest: '/var/named-iiab/' , mode: '0644' } + - { src: 'named/named-iiab.conf.j2', dest: '/etc/named-iiab.conf', mode: '0644' } + - { src: 'named/school.local.zone.db', dest: '/var/named-iiab/', mode: '0644' } + - { src: 'named/school.internal.zone.db', dest: '/var/named-iiab/', mode: '0644' } - name: Enable named service service: From 14678e812186a1f9c120d12e2373386ebf20482f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 13:57:47 -0400 Subject: [PATCH 104/374] Update default_vars.yml --- vars/default_vars.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 1734e1228..1623e4a7b 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -103,9 +103,6 @@ dhcpd_enabled: False named_install: True named_enabled: True block_DNS: False -# Captive Portal highly experimental as of July 2018: https://github.com/iiab/iiab/pull/870 -py_captive_portal_install: True -py_captive_portal_enabled: False # dnsmasq dnsmasq_install: True @@ -115,6 +112,10 @@ dnsmasq_enabled: False captive_portal_install: False captive_portal_enabled: False +# Captive Portal highly experimental as of July 2018: https://github.com/iiab/iiab/pull/870 +py_captive_portal_install: True +py_captive_portal_enabled: False + # Squid squid_install: False squid_enabled: False From eb1f6a5dcca1670bd9534ceb2f755223229bbd51 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 14:04:52 -0400 Subject: [PATCH 105/374] Update enable_services.yml --- roles/network/tasks/enable_services.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/network/tasks/enable_services.yml b/roles/network/tasks/enable_services.yml index ba232df08..c4b2fac76 100644 --- a/roles/network/tasks/enable_services.yml +++ b/roles/network/tasks/enable_services.yml @@ -100,16 +100,16 @@ mode: "{{ item.mode }}" with_items: - src: squid/squid-iiab.conf.j2 - dest: '/etc/{{ proxy }}/squid-iiab.conf' - owner: '{{ proxy_user }}' - group: '{{ proxy_user }}' + dest: "/etc/{{ proxy }}/squid-iiab.conf" + owner: "{{ proxy_user }}" + group: "{{ proxy_user }}" mode: 0644 when: squid_enabled and squid_install - name: Point to Squid config file from startup file lineinfile: regexp: '^CONFIG' - line: 'CONFIG=/etc/{{ proxy }}/squid-iiab.conf' + line: "CONFIG=/etc/{{ proxy }}/squid-iiab.conf" dest: "/etc/init.d/{{ proxy }}" when: squid_enabled and squid_install and is_debuntu @@ -170,7 +170,7 @@ - option: enabled value: "{{ dansguardian_enabled }}" -- name: Add 'wondershaper' to list of services at /etc/iiab/iiab.ini +- name: Add 'wondershaper' to list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ service_filelist }}" section: wondershaper From b0aea6e1369a2878d13a7702dbd8d73d1a38a797 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 14:10:34 -0400 Subject: [PATCH 106/374] Update main.yml --- roles/network/defaults/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index a6a7cc8b4..61f622f03 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -62,7 +62,7 @@ network_config_dir: /etc/network/interfaces.d dns_jail_enabled: False services_externally_visible: False -# Following variables set for old apache, dhcpd, named usage +# Following variables set for old Apache, dhcpd, named usage dhcpd_install: True dhcpd_enabled: True named_install: True @@ -70,10 +70,10 @@ named_enabled: True dnsmasq_enabled: False dnsmasq_install: False -# Possibly useful Tim's earlier Nodogsplash (github.com/iiab/iiab/issues/826) +# For @tim-moody's Nodogsplash approach to Captive Portal? High experimental as of June 2018: github.com/iiab/iiab/issues/608 captive_portal_enabled: False -# For simple python Captive Portal (for Anish & Jerry's github.com/iiab/iiab/pull/870) +# Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 py_captive_portal_install: True py_captive_portal_enabled: True py_captive_portal_port: "9090" From a4a882c5d079091e1fb83a2ae2636ab7a283773b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 14:19:43 -0400 Subject: [PATCH 107/374] Update default_vars.yml --- vars/default_vars.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 1623e4a7b..3e08a701b 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -52,8 +52,9 @@ local_tz: "{{ ansible_date_time.tz }}" # Read https://github.com/iiab/iiab/wiki/IIAB-Networking # Also readable offline @ http://box/info/IIAB-Networking.html -# NETWORK PARAMETERS FOLLOW ACROSS THE NEXT 60 LINES, as enabled by Ansible's -# NETWORK role (/opt/iiab/iiab/roles/network/*) in 4-SERVER-OPTIONS. +# NETWORK PARAMETERS FOLLOW ACROSS THE NEXT 65 LINES, as enabled by Ansible's +# NETWORK role (/opt/iiab/iiab/roles/network/*) in 4-SERVER-OPTIONS below. +# SEE ALSO: /opt/iiab/iiab/roles/network/defaults/main.yml iiab_hostname: box iiab_domain: lan @@ -108,11 +109,11 @@ block_DNS: False dnsmasq_install: True dnsmasq_enabled: False -# Captive Portal highly experimental as of June 2018: https://github.com/iiab/iiab/issues/608 +# For @tim-moody's Nodogsplash approach to Captive Portal? High experimental as of June 2018: github.com/iiab/iiab/issues/608 captive_portal_install: False captive_portal_enabled: False -# Captive Portal highly experimental as of July 2018: https://github.com/iiab/iiab/pull/870 +# Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 py_captive_portal_install: True py_captive_portal_enabled: False From db360cd759a761806d6f864dc87ff9a74c4170bd Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 18:13:58 -0400 Subject: [PATCH 108/374] comment fixed: ./runtags -> ./runrole --- roles/wordpress/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index 2fcdf7868..fa794dd3c 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -2,7 +2,7 @@ # to /library/wordpress) should also work offline... # # ONLINE OR OFFLINE, IF YOU NEED A CLEAN REINSTALL OF WORDPRESS DURING YOUR -# NEXT RUN OF "./runtags wordpress" OR "./iiab-install" PLEASE FIRST DO: +# NEXT RUN OF "./runrole wordpress" OR "./iiab-install" PLEASE FIRST DO: # # - "mv /library/wordpress /library/wordpress.old" # - back up WordPress's database then drop it From 52c612bf94ca2534b030d416ccadf814641dcd1e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 21:04:04 -0400 Subject: [PATCH 109/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 7eecf12cf..b5914dae5 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -12,6 +12,7 @@ dest: "{{ sugarizer_location }}/{{ sugarizer_version }}" version: "{{ sugarizer_git_version }}" force: yes + depth: 1 when: internet_available - name: Create symbolic link /opt/iiab/sugarizer -> /opt/iiab/{{ sugarizer_version }} @@ -36,6 +37,7 @@ dest: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" version: "{{ sugarizer_server_git_version }}" force: yes + depth: 1 when: internet_available - name: Create symbolic link /opt/iiab/sugarizer-server -> /opt/iiab/{ sugarizer_server_version }} From f405ceb8c858cd58b8c3ec6823853b0f9e9641d9 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 12 Jul 2018 21:33:25 -0400 Subject: [PATCH 110/374] delete link properly --- roles/httpd/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index de04af0f0..848a42fa2 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -53,7 +53,6 @@ - name: Remove the default apache2 config file (debuntu) file: path: /etc/apache2/sites-enabled/000-default.conf - src: /etc/apache2/sites-available/000-default.conf state: absent when: is_debuntu From b6c97719fd9e039e1c6b5280c10d4deddc710728 Mon Sep 17 00:00:00 2001 From: Arky <hitmanarky@gmail.com> Date: Fri, 13 Jul 2018 00:02:05 +0700 Subject: [PATCH 111/374] Kiwix-tools code for i586 Correct handling of i586/i686 kiwix-tools binaries. --- roles/kiwix/defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index 575f35513..53ae419d4 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -2,8 +2,8 @@ # As obtained from http://download.kiwix.org/release/kiwix-tools/ or http://download.kiwix.org/nightly/ kiwix_version_armhf: "kiwix-tools_linux-armhf-0.6.0" -kiwix_version_linux64: "kiwix-tools_linux-i586-0.6.0" -kiwix_version_i686: "kiwix-tools_linux-x86_64-0.6.0" +kiwix_version_i686: "kiwix-tools_linux-i586-0.6.0" +kiwix_version_linux64: "kiwix-tools_linux-x86_64-0.6.0" # kiwix_src_file_i686: "kiwix-linux-i686.tar.bz2" # v0.9 for i686 published May 2014 ("use it to test legacy ZIM content") # v0.10 for i686 published Oct 2016 ("experimental") REPLACED IN EARLY 2018, thx to Matthieu Gautier: From 56a17bfcf2f7d47aafa4b5baaccafb1d270ec560 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 09:12:09 -0400 Subject: [PATCH 112/374] Update main.yml --- roles/kiwix/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index 53ae419d4..a1425982b 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -2,8 +2,8 @@ # As obtained from http://download.kiwix.org/release/kiwix-tools/ or http://download.kiwix.org/nightly/ kiwix_version_armhf: "kiwix-tools_linux-armhf-0.6.0" -kiwix_version_i686: "kiwix-tools_linux-i586-0.6.0" kiwix_version_linux64: "kiwix-tools_linux-x86_64-0.6.0" +kiwix_version_i686: "kiwix-tools_linux-i586-0.6.0" # kiwix_src_file_i686: "kiwix-linux-i686.tar.bz2" # v0.9 for i686 published May 2014 ("use it to test legacy ZIM content") # v0.10 for i686 published Oct 2016 ("experimental") REPLACED IN EARLY 2018, thx to Matthieu Gautier: From 6265dd337e3203faf3f015e589bf0352ed5fb9b0 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 13:33:02 -0400 Subject: [PATCH 113/374] Update default_vars.yml --- vars/default_vars.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 3e08a701b..18beac3d4 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -109,6 +109,8 @@ block_DNS: False dnsmasq_install: True dnsmasq_enabled: False +dns_jail_enabled: False + # For @tim-moody's Nodogsplash approach to Captive Portal? High experimental as of June 2018: github.com/iiab/iiab/issues/608 captive_portal_install: False captive_portal_enabled: False @@ -163,8 +165,8 @@ schooltool_enabled: False # 3-BASE-SERVER -# Needed if you want http://box/common/services/power_off.php to work -allow_apache_sudo: False +# Make this False to disable http://box/common/services/power_off.php button: +allow_apache_sudo: True # roles/httpd runs here From 36c809aa470db63f42f6e39f1a31116419e8f3d1 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 13:33:42 -0400 Subject: [PATCH 114/374] Update local_vars_min.yml --- vars/local_vars_min.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index f41915947..2029a64e5 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -31,7 +31,7 @@ iiab_domain: lan # Set to /home or /wordpress or /mediawiki or /wiki (for DokuWiki) iiab_home_url: /home -# Raspbian requires WiFi country since March 2018. Please set it here: +# Raspbian requires Wi-Fi country since March 2018. Please set it here: host_country_code: US host_ssid: "Internet in a Box" host_wifi_mode: g @@ -39,8 +39,6 @@ host_channel: 6 hostapd_secure: False hostapd_password: changeme -dns_jail_enabled: False - # Enables "campus access" to kiwix (3000), kalite (8008) & calibre (8010 or # 8080) on WAN side of server. See network/templates/gateway/iiab-gen-iptables # within github.com/iiab/iiab/blob/master/roles/ @@ -49,8 +47,15 @@ services_externally_visible: True # Make this True if client machines should have access to WAN/Internet: iiab_gateway_enabled: False -# Make this False to disable http://box/common/services/power_off.php button: -allow_apache_sudo: True +# dnsmasq +dnsmasq_install: True +dnsmasq_enabled: False + +dns_jail_enabled: False + +# Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 +py_captive_portal_install: True +py_captive_portal_enabled: False # Stages 3 & 4 must be run (using iiab-install or runrole) if changing these: squid_install: False @@ -69,6 +74,9 @@ dansguardian_enabled: False # 3-BASE-SERVER +# Make this False to disable http://box/common/services/power_off.php button: +allow_apache_sudo: True + # roles/mysql runs here (mandatory) # 4-SERVER-OPTIONS From 403acbf51e353ed38a11356e5bbb3f814390a10b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 13:37:24 -0400 Subject: [PATCH 115/374] Update local_vars_min_vpn.yml --- vars/local_vars_min_vpn.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/vars/local_vars_min_vpn.yml b/vars/local_vars_min_vpn.yml index f427a1888..55f57fefb 100644 --- a/vars/local_vars_min_vpn.yml +++ b/vars/local_vars_min_vpn.yml @@ -39,8 +39,6 @@ host_channel: 6 hostapd_secure: False hostapd_password: changeme -dns_jail_enabled: False - # Enables "campus access" to kiwix (3000), kalite (8008) & calibre (8010 or # 8080) on WAN side of server. See network/templates/gateway/iiab-gen-iptables # within github.com/iiab/iiab/blob/master/roles/ @@ -49,8 +47,15 @@ services_externally_visible: True # Make this True if client machines should have access to WAN/Internet: iiab_gateway_enabled: False -# Make this False to disable http://box/common/services/power_off.php button: -allow_apache_sudo: True +# dnsmasq +dnsmasq_install: True +dnsmasq_enabled: False + +dns_jail_enabled: False + +# Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 +py_captive_portal_install: True +py_captive_portal_enabled: False # Stages 3 & 4 must be run (using iiab-install or runrole) if changing these: squid_install: False @@ -69,6 +74,9 @@ dansguardian_enabled: False # 3-BASE-SERVER +# Make this False to disable http://box/common/services/power_off.php button: +allow_apache_sudo: True + # roles/mysql runs here (mandatory) # 4-SERVER-OPTIONS From 67bbd31671926a156c7fc1395bb61722c73ac854 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 13:38:29 -0400 Subject: [PATCH 116/374] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index 21f7556f5..be4c943cc 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -39,8 +39,6 @@ host_channel: 6 hostapd_secure: False hostapd_password: changeme -dns_jail_enabled: False - # Enables "campus access" to kiwix (3000), kalite (8008) & calibre (8010 or # 8080) on WAN side of server. See network/templates/gateway/iiab-gen-iptables # within github.com/iiab/iiab/blob/master/roles/ @@ -49,8 +47,15 @@ services_externally_visible: True # Make this True if client machines should have access to WAN/Internet: iiab_gateway_enabled: False -# Make this False to disable http://box/common/services/power_off.php button: -allow_apache_sudo: True +# dnsmasq +dnsmasq_install: True +dnsmasq_enabled: False + +dns_jail_enabled: False + +# Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 +py_captive_portal_install: True +py_captive_portal_enabled: False # Stages 3 & 4 must be run (using iiab-install or runrole) if changing these: squid_install: False @@ -69,6 +74,9 @@ dansguardian_enabled: False # 3-BASE-SERVER +# Make this False to disable http://box/common/services/power_off.php button: +allow_apache_sudo: True + # roles/mysql runs here (mandatory) # 4-SERVER-OPTIONS From 466000d1a8d674388c1fe38a9397c7a5eebdb9bb Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 13:39:34 -0400 Subject: [PATCH 117/374] Update local_vars_medium_vpn.yml --- vars/local_vars_medium_vpn.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/vars/local_vars_medium_vpn.yml b/vars/local_vars_medium_vpn.yml index 70ec6105e..6718b6ac4 100644 --- a/vars/local_vars_medium_vpn.yml +++ b/vars/local_vars_medium_vpn.yml @@ -39,8 +39,6 @@ host_channel: 6 hostapd_secure: False hostapd_password: changeme -dns_jail_enabled: False - # Enables "campus access" to kiwix (3000), kalite (8008) & calibre (8010 or # 8080) on WAN side of server. See network/templates/gateway/iiab-gen-iptables # within github.com/iiab/iiab/blob/master/roles/ @@ -49,8 +47,15 @@ services_externally_visible: True # Make this True if client machines should have access to WAN/Internet: iiab_gateway_enabled: False -# Make this False to disable http://box/common/services/power_off.php button: -allow_apache_sudo: True +# dnsmasq +dnsmasq_install: True +dnsmasq_enabled: False + +dns_jail_enabled: False + +# Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 +py_captive_portal_install: True +py_captive_portal_enabled: False # Stages 3 & 4 must be run (using iiab-install or runrole) if changing these: squid_install: False @@ -69,6 +74,9 @@ dansguardian_enabled: False # 3-BASE-SERVER +# Make this False to disable http://box/common/services/power_off.php button: +allow_apache_sudo: True + # roles/mysql runs here (mandatory) # 4-SERVER-OPTIONS From b473873b5ec7a4c4dc6278c2e681c5306d2fef6f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 13:40:53 -0400 Subject: [PATCH 118/374] Update local_vars_big.yml --- vars/local_vars_big.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index db86484b7..50103c6fc 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -39,8 +39,6 @@ host_channel: 6 hostapd_secure: False hostapd_password: changeme -dns_jail_enabled: False - # Enables "campus access" to kiwix (3000), kalite (8008) & calibre (8010 or # 8080) on WAN side of server. See network/templates/gateway/iiab-gen-iptables # within github.com/iiab/iiab/blob/master/roles/ @@ -49,8 +47,15 @@ services_externally_visible: True # Make this True if client machines should have access to WAN/Internet: iiab_gateway_enabled: False -# Make this False to disable http://box/common/services/power_off.php button: -allow_apache_sudo: True +# dnsmasq +dnsmasq_install: True +dnsmasq_enabled: False + +dns_jail_enabled: False + +# Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 +py_captive_portal_install: True +py_captive_portal_enabled: False # Stages 3 & 4 must be run (using iiab-install or runrole) if changing these: squid_install: True @@ -69,6 +74,9 @@ dansguardian_enabled: True # 3-BASE-SERVER +# Make this False to disable http://box/common/services/power_off.php button: +allow_apache_sudo: True + # roles/mysql runs here (mandatory) # 4-SERVER-OPTIONS From 729b089479d4c17b339ccaa42afc041efb2ee9ee Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 13:49:31 -0400 Subject: [PATCH 119/374] Update local_vars_big_vpn.yml --- vars/local_vars_big_vpn.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/vars/local_vars_big_vpn.yml b/vars/local_vars_big_vpn.yml index 78399b980..7664b19f3 100644 --- a/vars/local_vars_big_vpn.yml +++ b/vars/local_vars_big_vpn.yml @@ -39,8 +39,6 @@ host_channel: 6 hostapd_secure: False hostapd_password: changeme -dns_jail_enabled: False - # Enables "campus access" to kiwix (3000), kalite (8008) & calibre (8010 or # 8080) on WAN side of server. See network/templates/gateway/iiab-gen-iptables # within github.com/iiab/iiab/blob/master/roles/ @@ -49,8 +47,15 @@ services_externally_visible: True # Make this True if client machines should have access to WAN/Internet: iiab_gateway_enabled: False -# Make this False to disable http://box/common/services/power_off.php button: -allow_apache_sudo: True +# dnsmasq +dnsmasq_install: True +dnsmasq_enabled: False + +dns_jail_enabled: False + +# Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 +py_captive_portal_install: True +py_captive_portal_enabled: False # Stages 3 & 4 must be run (using iiab-install or runrole) if changing these: squid_install: True @@ -69,6 +74,9 @@ dansguardian_enabled: True # 3-BASE-SERVER +# Make this False to disable http://box/common/services/power_off.php button: +allow_apache_sudo: True + # roles/mysql runs here (mandatory) # 4-SERVER-OPTIONS From 941d3d6e73ba4158c72ca0d3900e0eb761e12f5e Mon Sep 17 00:00:00 2001 From: Arky <hitmanarky@gmail.com> Date: Sat, 14 Jul 2018 01:39:42 +0700 Subject: [PATCH 120/374] Correct URI for IIAB license file Correct the URI http://github.com/XSCE/iiab/blob/master/LICENSE to http://github.com/XSCE/iiab/blob/master/LICENSE.md --- roles/httpd/files/html/credits.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/files/html/credits.html b/roles/httpd/files/html/credits.html index 4a6d8ae60..e88fcaf77 100755 --- a/roles/httpd/files/html/credits.html +++ b/roles/httpd/files/html/credits.html @@ -38,7 +38,7 @@ It is licensed under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<br><br> - Licensing information may be found at <a href="http://github.com/XSCE/iiab/blob/master/LICENSE">github.com/XSCE/iiab/blob/master/LICENSE</a>.<br> + Licensing information may be found at <a href="http://github.com/XSCE/iiab/blob/master/LICENSE.md">github.com/XSCE/iiab/blob/master/LICENSE.md</a>.<br> </BODY> <script type="text/javascript" src="incl/xs-portal.js"></script> From c205452c267f160d9d854fd2c10a5318af74f89e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 16:32:00 -0400 Subject: [PATCH 121/374] Update credits.html --- roles/httpd/files/html/credits.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/httpd/files/html/credits.html b/roles/httpd/files/html/credits.html index e88fcaf77..71c9cbd8c 100755 --- a/roles/httpd/files/html/credits.html +++ b/roles/httpd/files/html/credits.html @@ -10,7 +10,7 @@ <BODY> <h1>Internet-in-a-Box Credits</h1> - The XSCE School Server known as Internet-in-a-Box includes a variety of educational and other content and applications which are attributed as follows:<br><br> + Internet-in-a-Box includes a variety of educational and other content and applications which are attributed as follows:<br><br> All Wikipedia content is available for free at <a href="http://www.wikipedia.org/">www.wikipedia.org</a>.<br> All other Wikimedia content is available for free via links at <a href="http://www.wikimedia.org/">www.wikimedia.org</a>.<br> @@ -34,11 +34,11 @@ Internet-in-a-Box also contains a number of applications each of which has its own attribution information which is included.<br><br> - This Internet-in-a-Box distribution resides at <a href="http://github.com/XSCE/iiab">github.com/XSCE/iiab</a>.<br><br> + This Internet-in-a-Box distribution resides at <a href="http://github.com/iiab/iiab">github.com/iiab/iiab</a>.<br><br> It is licensed under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<br><br> - Licensing information may be found at <a href="http://github.com/XSCE/iiab/blob/master/LICENSE.md">github.com/XSCE/iiab/blob/master/LICENSE.md</a>.<br> + Licensing information may be found at <a href="http://github.com/iiab/iiab/blob/master/LICENSE.md">github.com/iiab/iiab/blob/master/LICENSE.md</a>.<br> </BODY> <script type="text/javascript" src="incl/xs-portal.js"></script> From 0556d865c6343edf698372a9e466e69dacf0f435 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 16:44:36 -0400 Subject: [PATCH 122/374] Update credits.html --- roles/httpd/files/html/credits.html | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/roles/httpd/files/html/credits.html b/roles/httpd/files/html/credits.html index 71c9cbd8c..515185cec 100755 --- a/roles/httpd/files/html/credits.html +++ b/roles/httpd/files/html/credits.html @@ -10,35 +10,35 @@ <BODY> <h1>Internet-in-a-Box Credits</h1> - Internet-in-a-Box includes a variety of educational and other content and applications which are attributed as follows:<br><br> + Internet-in-a-Box includes a variety of educational content and applications which are attributed as follows:<br><br> - All Wikipedia content is available for free at <a href="http://www.wikipedia.org/">www.wikipedia.org</a>.<br> - All other Wikimedia content is available for free via links at <a href="http://www.wikimedia.org/">www.wikimedia.org</a>.<br> - All Khan Academy content is available for free at <a href="http://www.khanacademy.org/">www.khanacademy.org</a>.<br> - All CK-12 content is available for free at <a href="http://www.ck-12.org/">www.ck-12.org</a>.<br> - All PhET Interactive Simulations content is available for free at <a href="http://phet.colorado.edu">phet.colorado.edu</a>.<br> - All MedLine content is available for free at <a href="http://www.nlm.nih.gov/medlineplus/">www.nlm.nih.gov/medlineplus</a>.<br> - All Hesperian content is available for free at <a href="http://www.hesperian.org/">www.hesperian.org</a>.<br> - All Gutenberg content is available for free at <a href="http://www.gutenberg.org/">www.gutenberg.org</a>.<br> - All OLPC content is available for free at <a href="http://wiki.laptop.org/go/Library_grid">www.laptop.org</a>.<br> - All MIT Scratch content is available for free at <a href="http://scratch.mit.edu">scratch.mit.edu</a>.<br> - All UNESCO's IICBA content is available for free at <a href="http://www.eng.unesco-iicba.org/elibrary">www.eng.unesco-iicba.org</a>.<br> - All Math Expression content is available for free at <a href="http://www.mathexpression.com">www.mathexpression.com</a>.<br> - All Music Theory content is available for free at <a href="http://www.musictheory.net">www.musictheory.net</a>.<br><br> + All Wikipedia content is available for free at <a href="https://www.wikipedia.org/">www.wikipedia.org</a>.<br> + All other Wikimedia content is available for free via links at <a href="https://www.wikimedia.org/">www.wikimedia.org</a>.<br> + All Khan Academy content is available for free at <a href="https://www.khanacademy.org/">www.khanacademy.org</a>.<br> + All CK-12 content is available for free at <a href="https://www.ck-12.org/">www.ck-12.org</a>.<br> + All PhET Interactive Simulations content is available for free at <a href="https://phet.colorado.edu">phet.colorado.edu</a>.<br> + All MedLine content is available for free at <a href="https://medlineplus.gov/">medlineplus.gov</a>.<br> + All Hesperian content is available for free at <a href="https://hesperian.org/">hesperian.org</a>.<br> + All Gutenberg content is available for free at <a href="https://www.gutenberg.org/">www.gutenberg.org</a>.<br> + All OLPC content is available for free at <a href="http://wiki.laptop.org/go/Collections">wiki.laptop.org</a>.<br> + All MIT Scratch content is available for free at <a href="https://scratch.mit.edu">scratch.mit.edu</a>.<br> + All UNESCO's IICBA content is available for free at <a href="http://www.iicba.unesco.org/">www.iicba.unesco.org/</a>.<br> + All Math Expression content is available for free at <a href="https://www.mathexpression.com/">www.mathexpression.com</a>.<br> + All Music Theory content is available for free at <a href="https://www.musictheory.net/">www.musictheory.net</a>.<br><br> Internet-in-a-Box also includes the work of content aggregators which we gratefully acknowledge:<br><br> - RACHEL is a curation of selected offline content at <a href="http://www.rachel.worldpossible.org/">www.rachel.worldpossible.org</a>.<br> - Kiwix is a Zim server and repository of Wikimedia and other content in a compressed Zim file format at <a href="http://www.kiwix.org/">www.kiwix.org</a>.<br> - KA Lite is a server and repository of Khan Academy content in various languages at <a href="http://learningequality.org/ka-lite/">learningequality.org/ka-lite</a>.<br><br> + RACHEL is a curation of selected offline content at <a href="http://oer2go.org/">oer2go.org</a>.<br> + Kiwix is a ZIM server and repository of Wikimedia and other content in a compressed ZIM file format at <a href="http://www.kiwix.org/">www.kiwix.org</a>.<br> + KA Lite is a server and repository of Khan Academy content in various languages at <a href="https://learningequality.org/ka-lite/">learningequality.org/ka-lite</a>.<br><br> - Internet-in-a-Box also contains a number of applications each of which has its own attribution information which is included.<br><br> + Internet-in-a-Box also contains a number of applications each of which has its own attribution information, which is included.<br><br> - This Internet-in-a-Box distribution resides at <a href="http://github.com/iiab/iiab">github.com/iiab/iiab</a>.<br><br> + This Internet-in-a-Box distribution resides at <a href="https://github.com/iiab/iiab">github.com/iiab/iiab</a>.<br><br> It is licensed under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<br><br> - Licensing information may be found at <a href="http://github.com/iiab/iiab/blob/master/LICENSE.md">github.com/iiab/iiab/blob/master/LICENSE.md</a>.<br> + Licensing information may be found at <a href="https://github.com/iiab/iiab/blob/master/LICENSE.md">github.com/iiab/iiab/blob/master/LICENSE.md</a>.<br> </BODY> <script type="text/javascript" src="incl/xs-portal.js"></script> From 34e94d302d4f799e91b5f1cbcb559e20fe856908 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 16:49:06 -0400 Subject: [PATCH 123/374] Update credits.html --- roles/httpd/files/html/credits.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/httpd/files/html/credits.html b/roles/httpd/files/html/credits.html index 515185cec..af0f62fcb 100755 --- a/roles/httpd/files/html/credits.html +++ b/roles/httpd/files/html/credits.html @@ -24,8 +24,11 @@ All MIT Scratch content is available for free at <a href="https://scratch.mit.edu">scratch.mit.edu</a>.<br> All UNESCO's IICBA content is available for free at <a href="http://www.iicba.unesco.org/">www.iicba.unesco.org/</a>.<br> All Math Expression content is available for free at <a href="https://www.mathexpression.com/">www.mathexpression.com</a>.<br> - All Music Theory content is available for free at <a href="https://www.musictheory.net/">www.musictheory.net</a>.<br><br> - + All Music Theory content is available for free at <a href="https://www.musictheory.net/">www.musictheory.net</a>.<br> + All HealthPhone content is available for free at <a href="http://www.healthphone.org/">www.healthphone.org</a>.<br> + All Centers for Disease Control content is available for free at <a href="https://www.cdc.gov/">www.cdc.gov</a>.<br> + All Global Emergency Medicine Wiki content is available for free at <a href="https://wikem.org/wiki/Main_Page">wikem.org/wiki/Main_Page</a>.<br><br> + Internet-in-a-Box also includes the work of content aggregators which we gratefully acknowledge:<br><br> RACHEL is a curation of selected offline content at <a href="http://oer2go.org/">oer2go.org</a>.<br> From 40b7e65db490e50d3b4913ab25b6a1eba33eba76 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 17:02:15 -0400 Subject: [PATCH 124/374] Update credits.html --- roles/httpd/files/html/credits.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/files/html/credits.html b/roles/httpd/files/html/credits.html index af0f62fcb..592a20011 100755 --- a/roles/httpd/files/html/credits.html +++ b/roles/httpd/files/html/credits.html @@ -10,7 +10,7 @@ <BODY> <h1>Internet-in-a-Box Credits</h1> - Internet-in-a-Box includes a variety of educational content and applications which are attributed as follows:<br><br> + Internet-in-a-Box (formerly known as XSCE School Server) includes a variety of educational content and applications which are attributed as follows:<br><br> All Wikipedia content is available for free at <a href="https://www.wikipedia.org/">www.wikipedia.org</a>.<br> All other Wikimedia content is available for free via links at <a href="https://www.wikimedia.org/">www.wikimedia.org</a>.<br> From 0a43b68fac213c0ec539defd0d7e09587f7c106e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 17:04:58 -0400 Subject: [PATCH 125/374] Update credits.html --- roles/httpd/files/html/credits.html | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/httpd/files/html/credits.html b/roles/httpd/files/html/credits.html index 592a20011..417be2b51 100755 --- a/roles/httpd/files/html/credits.html +++ b/roles/httpd/files/html/credits.html @@ -19,6 +19,7 @@ All PhET Interactive Simulations content is available for free at <a href="https://phet.colorado.edu">phet.colorado.edu</a>.<br> All MedLine content is available for free at <a href="https://medlineplus.gov/">medlineplus.gov</a>.<br> All Hesperian content is available for free at <a href="https://hesperian.org/">hesperian.org</a>.<br> + Arabic translations of Hesperian content were done by Arab Resource Collective and are available for free at <a href="http://www.mawared.org">mawared.org</a>.<br> All Gutenberg content is available for free at <a href="https://www.gutenberg.org/">www.gutenberg.org</a>.<br> All OLPC content is available for free at <a href="http://wiki.laptop.org/go/Collections">wiki.laptop.org</a>.<br> All MIT Scratch content is available for free at <a href="https://scratch.mit.edu">scratch.mit.edu</a>.<br> From 52bbc775e88a73f5ee5fdffb1a805996f50de782 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 13 Jul 2018 17:09:57 -0400 Subject: [PATCH 126/374] Update credits.html --- roles/httpd/files/html/credits.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/httpd/files/html/credits.html b/roles/httpd/files/html/credits.html index 417be2b51..822738a87 100755 --- a/roles/httpd/files/html/credits.html +++ b/roles/httpd/files/html/credits.html @@ -15,7 +15,7 @@ All Wikipedia content is available for free at <a href="https://www.wikipedia.org/">www.wikipedia.org</a>.<br> All other Wikimedia content is available for free via links at <a href="https://www.wikimedia.org/">www.wikimedia.org</a>.<br> All Khan Academy content is available for free at <a href="https://www.khanacademy.org/">www.khanacademy.org</a>.<br> - All CK-12 content is available for free at <a href="https://www.ck-12.org/">www.ck-12.org</a>.<br> + All CK-12 content is available for free at <a href="https://www.ck12.org/">www.ck12.org</a>.<br> All PhET Interactive Simulations content is available for free at <a href="https://phet.colorado.edu">phet.colorado.edu</a>.<br> All MedLine content is available for free at <a href="https://medlineplus.gov/">medlineplus.gov</a>.<br> All Hesperian content is available for free at <a href="https://hesperian.org/">hesperian.org</a>.<br> @@ -38,7 +38,7 @@ Internet-in-a-Box also contains a number of applications each of which has its own attribution information, which is included.<br><br> - This Internet-in-a-Box distribution resides at <a href="https://github.com/iiab/iiab">github.com/iiab/iiab</a>.<br><br> + This Internet-in-a-Box distribution resides at <a href="https://github.com/iiab">github.com/iiab</a>.<br><br> It is licensed under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<br><br> From 2783f2c157d5d5297cada9d5eff98a0f8aa2365c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 08:52:50 -0400 Subject: [PATCH 127/374] Update credits.html --- roles/httpd/files/html/credits.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/files/html/credits.html b/roles/httpd/files/html/credits.html index 822738a87..c1cef0e8b 100755 --- a/roles/httpd/files/html/credits.html +++ b/roles/httpd/files/html/credits.html @@ -23,7 +23,7 @@ All Gutenberg content is available for free at <a href="https://www.gutenberg.org/">www.gutenberg.org</a>.<br> All OLPC content is available for free at <a href="http://wiki.laptop.org/go/Collections">wiki.laptop.org</a>.<br> All MIT Scratch content is available for free at <a href="https://scratch.mit.edu">scratch.mit.edu</a>.<br> - All UNESCO's IICBA content is available for free at <a href="http://www.iicba.unesco.org/">www.iicba.unesco.org/</a>.<br> + All UNESCO's IICBA content is available for free at <a href="http://www.iicba.unesco.org/?q=elibrary">www.iicba.unesco.org/</a>.<br> All Math Expression content is available for free at <a href="https://www.mathexpression.com/">www.mathexpression.com</a>.<br> All Music Theory content is available for free at <a href="https://www.musictheory.net/">www.musictheory.net</a>.<br> All HealthPhone content is available for free at <a href="http://www.healthphone.org/">www.healthphone.org</a>.<br> From 27871463cb8bb3b55084b9e9785097c30278acad Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 09:09:34 -0400 Subject: [PATCH 128/374] Update main.yml --- roles/sugarizer/defaults/main.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index 8f5c40c57..58e822327 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -5,13 +5,11 @@ sugarizer_location: "{{ iiab_base }}" # /opt/iiab sugarizer_version: sugarizer-1.0 sugarizer_git_version: v1.0.1 -# PLEASE HELP MONITOR https://github.com/llaske/sugarizer/releases FOR -# STABLE/OFFICIAL RELEASES! +# PLEASE HELP MONITOR https://github.com/llaske/sugarizer/releases sugarizer_server_version: sugarizer-server-1.0 -sugarizer_server_git_version: master -# CLONING SUGARIZER-SERVER'S MASTER BRANCH IS NOT A LONG-TERM SOLUTION, -# SO LET'S MONITOR https://github.com/llaske/sugarizer-server/releases -# FOR A MORE STABLE/OFFICIAL RELEASE DURING MID-2018! +sugarizer_server_git_version: v1.0.1 # was "master" 11-14 July 2018 +# PLEASE HELP MONITOR https://github.com/llaske/sugarizer-server/releases -node_modules_exists: False +# Unused as of 2018-07-14 +# node_modules_exists: False From 81412a6265815a9be0980d82a12517ef1fe95bbb Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 09:22:50 -0400 Subject: [PATCH 129/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 70 +++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index b5914dae5..d931aed2b 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -31,6 +31,10 @@ # Going forward let's "git clone" IIAB's preferred versions, of sugarizer # AND sugarizer-server, as specified in roles/sugarizer/defaults/main.yml +# 2018-07-14 BLOWBACK: git works well BUT even with "depth: 1" +# - 229MB is unfort downloaded to /opt/iiab/sugarizer/.git +# - 1.4MB is unfort downloaded to /opt/iiab/sugarizer-server/.git + - name: Clone llaske/sugarizer-server ({{ sugarizer_server_git_version }}) from GitHub to /opt/iiab git: repo: https://github.com/llaske/sugarizer-server @@ -48,8 +52,8 @@ # 3. INSTALL A GOOD VERSION OF Node.js AND npm -# Both Raspbian and Debian 9 STILL need this approach as of July 2018, -# as documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 +# Raspbian & Debian 9 STILL need this approach (July 2018) to get a recent +# version of npm. As documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 - name: Set up Node.js 8.x apt sources (debuntu but avoid ubuntu-18) shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - when: internet_available and is_debuntu and not is_ubuntu_18 @@ -57,56 +61,60 @@ - name: Install latest Node.js which includes /usr/bin/npm (debuntu but avoid ubuntu-18) package: name: nodejs - # name: nodejs=8.x state: latest + # name: nodejs=8.x # state: present when: internet_available and is_debuntu and not is_ubuntu_18 -- name: Install Node.js and npm (ubuntu-18) +#- name: Install Node.js and npm (ubuntu-18) +- name: Install Node.js and npm (ubuntu-18 or not is_debuntu) package: name: "{{ item }}" state: latest - when: internet_available and is_ubuntu_18 + when: internet_available and (is_ubuntu_18 or (not is_debuntu)) with_items: - nodejs - npm -- name: Install npm (OS's other than debuntu) - package: - name: "{{ item }}" - state: present - when: internet_available and not is_debuntu - with_items: - - nodejs - - npm +#- name: Install npm (OS's other than debuntu) +# package: +# name: "{{ item }}" +# state: present +# when: internet_available and not is_debuntu +# with_items: +# - nodejs +# - npm # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules -# Re-running "npm install" fails on Raspbian 9 if not other OS's -- name: Check for /opt/iiab/{{ sugarizer_server_version }}/node_modules - stat: - path: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" - register: nmtest - ignore_errors: true +# OLD WAY: Re-running "npm install" fails on Raspbian 9 if not other OS's, so... -- name: Set a flag to prevent re-running of "npm install" - set_fact: - node_modules_exists: True - when: nmtest.stat is defined and nmtest.stat.exists +#- name: Check for /opt/iiab/{{ sugarizer_server_version }}/node_modules +# stat: +# path: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" +# register: nmtest +# ignore_errors: true +# +#- name: Set a flag to prevent re-running of "npm install" +# set_fact: +# node_modules_exists: True +# when: nmtest.stat is defined and nmtest.stat.exists -- name: Create the express framework for Node.js (OS's other than Fedora 18) +# NEW WAY: "creates: ..." below (checks for existence of "node_modules") + +#- name: Create the express framework for Node.js (OS's other than Fedora 18) +- name: Run 'npm install' to create the express framework for Node.js shell: npm install args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" - #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/server/node_modules" - when: not is_F18 and not node_modules_exists +# when: not is_F18 and not node_modules_exists -- name: Create the express framework for Node.js (Fedora 18) - shell: npm install - args: - chdir: "{{ sugarizer_location }}/sugarizer/server" - when: is_F18 and not node_modules_exists +#- name: Create the express framework for Node.js (Fedora 18) +# shell: npm install +# args: +# chdir: "{{ sugarizer_location }}/sugarizer/server" +# when: is_F18 and not node_modules_exists # 5. PLACE CONFIG FILES From f2aa427579803aea9d924750fa5e5b56bc8877bf Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 11:59:26 -0400 Subject: [PATCH 130/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index d931aed2b..3b4df747c 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -52,17 +52,19 @@ # 3. INSTALL A GOOD VERSION OF Node.js AND npm -# Raspbian & Debian 9 STILL need this approach (July 2018) to get a recent -# version of npm. As documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 -- name: Set up Node.js 8.x apt sources (debuntu but avoid ubuntu-18) +# Raspbian & Debian 9 STILL need this nodesource.com approach (July 2018) to get a recent version of npm. +# As documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 +# This nodesource.com approach (brings in npm 5.6.0 with nodejs 8.11.3) +# would also work on Ubuntu 18.04, but U18's apt brings in npm 3.5.2, which is sufficient (SO FAR!?) +- name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18) shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - when: internet_available and is_debuntu and not is_ubuntu_18 -- name: Install latest Node.js which includes /usr/bin/npm (debuntu but avoid ubuntu-18) +- name: Install latest Node.js which includes /usr/bin/npm (debuntu, but avoid ubuntu-18) package: name: nodejs - state: latest # name: nodejs=8.x + state: latest # state: present when: internet_available and is_debuntu and not is_ubuntu_18 @@ -87,7 +89,14 @@ # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules -# OLD WAY: Re-running "npm install" fails on Raspbian 9 if not other OS's, so... +# Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's. +# Several strategies to avoid re-running it: +# OLD WAY 1: test & set flag node_modules_exists: True +# OLD WAY 2: "creates: ..." checks for non-existence of /opt/iiab/sugarizer-server-1.0/node_modules +# OLD WAY 3: set "register: git_sug_server_output" above, then as nec delete /opt/iiab/sugarizer-server-1.0/node_modules "when: git_sug_server_output.changed" and as nec run "npm install" + +# NEW WAY: run "npm install" every time, as modern versions of npm are +# incremental, with sanity checks (as tested with npm 3.5.2 and 5.6.0) #- name: Check for /opt/iiab/{{ sugarizer_server_version }}/node_modules # stat: @@ -100,15 +109,14 @@ # node_modules_exists: True # when: nmtest.stat is defined and nmtest.stat.exists -# NEW WAY: "creates: ..." below (checks for existence of "node_modules") - #- name: Create the express framework for Node.js (OS's other than Fedora 18) -- name: Run 'npm install' to create the express framework for Node.js - shell: npm install +- name: Run 'npm install' to create /opt/iiab/{{ sugarizer_server_version }}/node_modules (CAN TAKE SEVERAL MINUTES) + command: npm install # slightly safer than "shell:" args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" - creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" -# when: not is_F18 and not node_modules_exists +# creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" # OLD WAY 2 +# when: git_sug_server_output.changed # OLD WAY 3 +# when: not is_F18 and not node_modules_exists # OLD WAY 1 #- name: Create the express framework for Node.js (Fedora 18) # shell: npm install @@ -144,7 +152,7 @@ enabled: yes state: restarted with_items: - - { name: mongodb } +# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot does usually does! (Is a daemon-reload or some such nec?) - { name: sugarizer } when: sugarizer_enabled From ceec00d9ac255aa661cac4474eb5f1705e09fc2e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 12:01:05 -0400 Subject: [PATCH 131/374] Update main.yml --- roles/sugarizer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index 58e822327..1b0d7f0bf 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -8,7 +8,7 @@ sugarizer_git_version: v1.0.1 # PLEASE HELP MONITOR https://github.com/llaske/sugarizer/releases sugarizer_server_version: sugarizer-server-1.0 -sugarizer_server_git_version: v1.0.1 # was "master" 11-14 July 2018 +sugarizer_server_git_version: v1.0.1 # "master" worked over July 11-14, 2018 # PLEASE HELP MONITOR https://github.com/llaske/sugarizer-server/releases # Unused as of 2018-07-14 From 59aec67a559773525a5525c588a3ae22d2466c57 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 12:11:50 -0400 Subject: [PATCH 132/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 3b4df747c..2edffb9bd 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -69,11 +69,11 @@ when: internet_available and is_debuntu and not is_ubuntu_18 #- name: Install Node.js and npm (ubuntu-18) -- name: Install Node.js and npm (ubuntu-18 or not is_debuntu) +- name: Install Node.js and npm (ubuntu-18 or not debuntu) package: name: "{{ item }}" state: latest - when: internet_available and (is_ubuntu_18 or (not is_debuntu)) + when: internet_available and (is_ubuntu_18 or not is_debuntu) with_items: - nodejs - npm @@ -152,7 +152,7 @@ enabled: yes state: restarted with_items: -# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot does usually does! (Is a daemon-reload or some such nec?) +# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot usually does! (Is a daemon-reload or some such nec?) - { name: sugarizer } when: sugarizer_enabled From 0a1897a4559f3bcd0a587804de5a91f098909dde Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 12:25:58 -0400 Subject: [PATCH 133/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 2edffb9bd..c33ba9152 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -31,7 +31,7 @@ # Going forward let's "git clone" IIAB's preferred versions, of sugarizer # AND sugarizer-server, as specified in roles/sugarizer/defaults/main.yml -# 2018-07-14 BLOWBACK: git works well BUT even with "depth: 1" +# 2018-07-14 BLOAT: git works well BUT even with "depth: 1" # - 229MB is unfort downloaded to /opt/iiab/sugarizer/.git # - 1.4MB is unfort downloaded to /opt/iiab/sugarizer-server/.git From a177edbafdd90c80728f7330b1f014f01d8567af Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 12:39:43 -0400 Subject: [PATCH 134/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index c33ba9152..bde050ada 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -44,7 +44,7 @@ depth: 1 when: internet_available -- name: Create symbolic link /opt/iiab/sugarizer-server -> /opt/iiab/{ sugarizer_server_version }} +- name: Create symbolic link /opt/iiab/sugarizer-server -> /opt/iiab/{{ sugarizer_server_version }} file: src: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" dest: "{{ sugarizer_location }}/sugarizer-server" From febd64207daa33a425bbe5cbb65a4f14dfc1526f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 13:28:39 -0400 Subject: [PATCH 135/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index bde050ada..b4cba0abf 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -52,10 +52,6 @@ # 3. INSTALL A GOOD VERSION OF Node.js AND npm -# Raspbian & Debian 9 STILL need this nodesource.com approach (July 2018) to get a recent version of npm. -# As documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 -# This nodesource.com approach (brings in npm 5.6.0 with nodejs 8.11.3) -# would also work on Ubuntu 18.04, but U18's apt brings in npm 3.5.2, which is sufficient (SO FAR!?) - name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18) shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - when: internet_available and is_debuntu and not is_ubuntu_18 @@ -68,7 +64,23 @@ # state: present when: internet_available and is_debuntu and not is_ubuntu_18 -#- name: Install Node.js and npm (ubuntu-18) +# 2018-07-14: Raspbian (apt offers npm 1.4.21) & Debian 9 (apt offers no npm!) +# STILL NEED the above nodesource.com approach to get a version of npm that +# works with Sugarizer, as documented at: +# https://github.com/iiab/iiab/issues/798#issuecomment-404324530 + +# FYI this nodesource.com approach (brings in npm 5.6.0 with nodejs 8.11.3 +# for now) would also work on Ubuntu 18.04, and might even bring about a +# more sane consistency between mainline OS's? +# +# But For Now: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, +# which appears suffic "SO FAR"? 18.04's nodejs 8.10.0 is more reassuring! + +# Crazy Aside: some versions of npm can upgrade themselves to the latest +# (6.1.0 for now) using command "npm install -g npm", but careful as it +# ends up in /usr/local/bin causing future/pkg management issues: +# https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation + - name: Install Node.js and npm (ubuntu-18 or not debuntu) package: name: "{{ item }}" @@ -78,15 +90,6 @@ - nodejs - npm -#- name: Install npm (OS's other than debuntu) -# package: -# name: "{{ item }}" -# state: present -# when: internet_available and not is_debuntu -# with_items: -# - nodejs -# - npm - # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules # Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's. From 5cc6072824fc5df65f80cdea9de4ab8694e52800 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 13:38:06 -0400 Subject: [PATCH 136/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index b4cba0abf..64f9d9b89 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -6,7 +6,7 @@ # 1. DOWNLOAD /opt/iiab/sugarizer -- name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab +- name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab (CAN TAKE SEVERAL MINUTES) git: repo: https://github.com/llaske/sugarizer dest: "{{ sugarizer_location }}/{{ sugarizer_version }}" From 14efa35628218a5ec26f477a63fc0a037a411a0d Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 13:46:38 -0400 Subject: [PATCH 137/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 64f9d9b89..87171e88e 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -161,11 +161,9 @@ - name: Disable service (all OS's) service: - name: "{{ item.name }}" + name: sugarizer enabled: no state: stopped - with_items: - - { name: sugarizer } when: not sugarizer_enabled - name: Add 'sugarizer' to list of services at /etc/iiab/iiab.ini From 41b8cb3b61d62c9ed93a4bca5ca05266a11173d5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 14:01:20 -0400 Subject: [PATCH 138/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 87171e88e..9f98df0a4 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -35,6 +35,9 @@ # - 229MB is unfort downloaded to /opt/iiab/sugarizer/.git # - 1.4MB is unfort downloaded to /opt/iiab/sugarizer-server/.git +# CLARIF: during repeat runs of "./runrole sugarizer", this git sync shows +# "changed" (whereas above git sync shows "ok"). Reason: "npm install" +# (below) modifies /opt/iiab/sugarizer-server/node_modules - name: Clone llaske/sugarizer-server ({{ sugarizer_server_git_version }}) from GitHub to /opt/iiab git: repo: https://github.com/llaske/sugarizer-server @@ -76,9 +79,10 @@ # But For Now: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, # which appears suffic "SO FAR"? 18.04's nodejs 8.10.0 is more reassuring! -# Crazy Aside: some versions of npm can upgrade themselves to the latest -# (6.1.0 for now) using command "npm install -g npm", but careful as it -# ends up in /usr/local/bin causing future/pkg management issues: +# CRAZY IDEA: some versions of npm can upgrade themselves to the latest +# (6.1.0 for now) with command "npm install -g npm" if that helps us in +# future, if that helps TK's memory issue etc? If so, be CAREFUL this +# may put npm in /usr/local/bin causing future/pkg management issues: # https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation - name: Install Node.js and npm (ubuntu-18 or not debuntu) From e352cd54f7aa8529fa6db1893f34bbbdb4386088 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 14:16:44 -0400 Subject: [PATCH 139/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 9f98df0a4..e55df129f 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -67,22 +67,22 @@ # state: present when: internet_available and is_debuntu and not is_ubuntu_18 -# 2018-07-14: Raspbian (apt offers npm 1.4.21) & Debian 9 (apt offers no npm!) -# STILL NEED the above nodesource.com approach to get a version of npm that -# works with Sugarizer, as documented at: +# 2018-07-14: BOTH STEPS ABOVE TAKE TIME, but Raspbian (apt offers npm +# 1.4.21) & Debian 9 (apt offers no npm!) STILL NEED the above +# nodesource.com approach to get a version of npm that works with Sugarizer: # https://github.com/iiab/iiab/issues/798#issuecomment-404324530 - -# FYI this nodesource.com approach (brings in npm 5.6.0 with nodejs 8.11.3 -# for now) would also work on Ubuntu 18.04, and might even bring about a -# more sane consistency between mainline OS's? -# -# But For Now: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, +# +# MORE POSITIVELY: this nodesource.com approach (brings in npm 5.6.0 with +# nodejs 8.11.3 for now, to any OS) would also work on Ubuntu 18.04, and +# might even bring about a sane consistency across mainline OS's? +# +# BUT FOR NOW: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, # which appears suffic "SO FAR"? 18.04's nodejs 8.10.0 is more reassuring! # CRAZY IDEA: some versions of npm can upgrade themselves to the latest -# (6.1.0 for now) with command "npm install -g npm" if that helps us in -# future, if that helps TK's memory issue etc? If so, be CAREFUL this -# may put npm in /usr/local/bin causing future/pkg management issues: +# (6.1.0 for now) using command "npm install -g npm", if that helps us in +# future, e.g. TK's memory issue etc? If so, be CAREFUL this might put +# npm in /usr/local/bin causing future/pkg management issues: # https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation - name: Install Node.js and npm (ubuntu-18 or not debuntu) From c0317a885b085764b0188e87f3c0af2568104f21 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 14:25:12 -0400 Subject: [PATCH 140/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index e55df129f..12e8f6b14 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -121,15 +121,16 @@ command: npm install # slightly safer than "shell:" args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" -# creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" # OLD WAY 2 -# when: git_sug_server_output.changed # OLD WAY 3 -# when: not is_F18 and not node_modules_exists # OLD WAY 1 + #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" # OLD WAY 2 + when: internet_available # "npm install" generally requires Internet access +# when: internet_available and git_sug_server_output.changed # OLD WAY 3 +# when: internet_available and not is_F18 and not node_modules_exists # OLD WAY 1 #- name: Create the express framework for Node.js (Fedora 18) # shell: npm install # args: # chdir: "{{ sugarizer_location }}/sugarizer/server" -# when: is_F18 and not node_modules_exists +# when: internet_available and is_F18 and not node_modules_exists # 5. PLACE CONFIG FILES @@ -141,9 +142,9 @@ owner: root group: root with_items: - - { src: 'sugarizer.service.j2', dest: '/etc/systemd/system/sugarizer.service', mode: '0644' } - { src: 'sugarizer.ini', dest: '{{ sugarizer_location }}/{{ sugarizer_server_version }}/env/sugarizer.ini', mode: '0644' } - { src: 'sugarizer.conf', dest: '/etc/apache2/sites-available', mode: '0644' } + - { src: 'sugarizer.service.j2', dest: '/etc/systemd/system/sugarizer.service', mode: '0644' } - name: Create symlink for short URL http://box/sugarizer file: From 16cce1eb4ab3c1be13d4bd86d87260789026de83 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 16:10:13 -0400 Subject: [PATCH 141/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 12e8f6b14..48d2c5fa4 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -79,10 +79,11 @@ # BUT FOR NOW: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, # which appears suffic "SO FAR"? 18.04's nodejs 8.10.0 is more reassuring! -# CRAZY IDEA: some versions of npm can upgrade themselves to the latest -# (6.1.0 for now) using command "npm install -g npm", if that helps us in -# future, e.g. TK's memory issue etc? If so, be CAREFUL this might put -# npm in /usr/local/bin causing future/pkg management issues: +# CRAZY IDEA: most versions of npm can upgrade themselves to the latest +# (6.2.0 for now) using command "npm install -g npm", if that helps us in +# future, e.g. TK's memory issue etc? If so, be CAREFUL this puts npm +# in /usr/local/bin on Ubuntu 18.04 -- unlike Ubuntu 16.04 and Raspbian +# where it upgrades /usr/bin/npm in place: # https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation - name: Install Node.js and npm (ubuntu-18 or not debuntu) From 72d3b792f584b81cc20c8532eb47db3d28db4993 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 16:14:06 -0400 Subject: [PATCH 142/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 48d2c5fa4..11f4aaef0 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -161,7 +161,7 @@ enabled: yes state: restarted with_items: -# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot usually does! (Is a daemon-reload or some such nec?) +# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot usually does! (Is a "systemctl daemon-reload" or some such nec?) - { name: sugarizer } when: sugarizer_enabled From d8f813252aa270dce3cb6a00519de79a5f839f79 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 14 Jul 2018 16:43:39 -0400 Subject: [PATCH 143/374] comments/readability --- roles/sugarizer/tasks/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 11f4aaef0..07880c0f0 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -4,7 +4,7 @@ shell: "rm -rf {{ doc_root }}/sugarizer*" when: sugarizer_version == "sugarizer-1.0" -# 1. DOWNLOAD /opt/iiab/sugarizer +# 1. DOWNLOAD+LINK /opt/iiab/sugarizer - name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab (CAN TAKE SEVERAL MINUTES) git: @@ -21,9 +21,9 @@ dest: "{{ sugarizer_location }}/sugarizer" state: link -# 2. DOWNLOAD /opt/iiab/sugarizer-server +# 2. DOWNLOAD+LINK /opt/iiab/sugarizer-server -# July 2018: http://download.iiab.io/packages/sugarizer-server-1.0.tar.gz +# 2018-07-11: http://download.iiab.io/packages/sugarizer-server-1.0.tar.gz # was flawed, as documented at: # https://github.com/iiab/iiab/pull/814#issuecomment-404211098 # Versions of MongoDB, npm (& Node.js ?) matter! Sugarizer 1.0 Context: @@ -90,10 +90,10 @@ package: name: "{{ item }}" state: latest - when: internet_available and (is_ubuntu_18 or not is_debuntu) with_items: - nodejs - npm + when: internet_available and (is_ubuntu_18 or not is_debuntu) # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules From fa65f215a42b6513884aca8a606a269da1c562fe Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 01:18:42 -0400 Subject: [PATCH 144/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 07880c0f0..fe9b59108 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -95,6 +95,14 @@ - npm when: internet_available and (is_ubuntu_18 or not is_debuntu) +# 2018-07-15: TK Kang showed that "npm install" fails if run through sudo, with code EACCES, errno -13 (permission denied), "missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" +- name: Change ownership of /root/.npm from iiab-admin to root + file: + path: /root/.npm + owner: root + group: root + recurse: yes + # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules # Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's. From 3434452eab7cea5a97951dae62f16187464e4180 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 01:33:35 -0400 Subject: [PATCH 145/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index fe9b59108..af0fccb2f 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -95,7 +95,7 @@ - npm when: internet_available and (is_ubuntu_18 or not is_debuntu) -# 2018-07-15: TK Kang showed that "npm install" fails if run through sudo, with code EACCES, errno -13 (permission denied), "missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" +# 2018-07-15: TK Kang showed that "npm install" fails if run through sudo, with code EACCES, errno -13 (permission denied), "Missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" - name: Change ownership of /root/.npm from iiab-admin to root file: path: /root/.npm From 7cf000debcd704830a20d04815b9a8d0349eaca1 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 01:38:19 -0400 Subject: [PATCH 146/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index af0fccb2f..6abdfb7fb 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -96,7 +96,7 @@ when: internet_available and (is_ubuntu_18 or not is_debuntu) # 2018-07-15: TK Kang showed that "npm install" fails if run through sudo, with code EACCES, errno -13 (permission denied), "Missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" -- name: Change ownership of /root/.npm from iiab-admin to root +- name: Change ownership of /root/.npm [from iiab-admin] to root file: path: /root/.npm owner: root From 162a367885cdcd1ff76458d82a2436cb32d0b26e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 07:10:31 -0400 Subject: [PATCH 147/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 37 ++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 6abdfb7fb..d6374c8d0 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -95,25 +95,14 @@ - npm when: internet_available and (is_ubuntu_18 or not is_debuntu) -# 2018-07-15: TK Kang showed that "npm install" fails if run through sudo, with code EACCES, errno -13 (permission denied), "Missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" -- name: Change ownership of /root/.npm [from iiab-admin] to root - file: - path: /root/.npm - owner: root - group: root - recurse: yes - # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules -# Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's. -# Several strategies to avoid re-running it: +# Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's? +# Strategies considered to avoid re-running it: # OLD WAY 1: test & set flag node_modules_exists: True # OLD WAY 2: "creates: ..." checks for non-existence of /opt/iiab/sugarizer-server-1.0/node_modules # OLD WAY 3: set "register: git_sug_server_output" above, then as nec delete /opt/iiab/sugarizer-server-1.0/node_modules "when: git_sug_server_output.changed" and as nec run "npm install" -# NEW WAY: run "npm install" every time, as modern versions of npm are -# incremental, with sanity checks (as tested with npm 3.5.2 and 5.6.0) - #- name: Check for /opt/iiab/{{ sugarizer_server_version }}/node_modules # stat: # path: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" @@ -125,9 +114,27 @@ # node_modules_exists: True # when: nmtest.stat is defined and nmtest.stat.exists +# NEW WAY BELOW: run "npm install --allow-root" every time, as modern versions +# of npm are incremental, with sanity checks (all 3 may work: but npm 6.2.0 +# is better than 5.6.0 better than 3.5.2 + +# 2018-07-15: TK Kang & Holt confirmed sudo-driven "npm install" maxes out CPU +# for hours. Error code EACCES, errno -13 (permission denied): +# "Missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" +# +# SOLUTION: +# Implemented '--allow-root' below, as is critical for 1st run of sudo-driven +# 'npm install' (causing it to create /root/.npm cache & lock files owned by +# root:root instead of iiab-admin:iiab-admin) permitting it and IIAB install +# scripts toactually complete :) +# +# CLARIF: something like 'chown -R root:root /root/.npm' cannot happen +# synchronously with the 1st run of 'npm install' (when it's needed!) +# nor is 'chown' functionality nec, now that --allow-root does the job) + #- name: Create the express framework for Node.js (OS's other than Fedora 18) -- name: Run 'npm install' to create /opt/iiab/{{ sugarizer_server_version }}/node_modules (CAN TAKE SEVERAL MINUTES) - command: npm install # slightly safer than "shell:" +- name: Run 'npm install --allow-root' to create /opt/iiab/{{ sugarizer_server_version }}/node_modules (CAN TAKE SEVERAL MINUTES) + command: npm install --allow-root # "command:" a bit safer than "shell:" args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" # OLD WAY 2 From 095d9b6caa26429ca04e618b795ae7fb7ce406d2 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 07:16:50 -0400 Subject: [PATCH 148/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index d6374c8d0..d2b9f4cff 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -116,21 +116,20 @@ # NEW WAY BELOW: run "npm install --allow-root" every time, as modern versions # of npm are incremental, with sanity checks (all 3 may work: but npm 6.2.0 -# is better than 5.6.0 better than 3.5.2 +# is better than 5.6.0. which is better than Ubuntu 18.04's 3.5.2). # 2018-07-15: TK Kang & Holt confirmed sudo-driven "npm install" maxes out CPU -# for hours. Error code EACCES, errno -13 (permission denied): +# for hours, on diff OS's. Error code EACCES, errno -13 (permission denied): # "Missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" # -# SOLUTION: -# Implemented '--allow-root' below, as is critical for 1st run of sudo-driven -# 'npm install' (causing it to create /root/.npm cache & lock files owned by -# root:root instead of iiab-admin:iiab-admin) permitting it and IIAB install -# scripts toactually complete :) +# SOLUTION: Implement '--allow-root' below, as is critical for 1st run of +# sudo-driven 'npm install' (causing it to create /root/.npm cache & lock +# files owned by root:root instead of iiab-admin:iiab-admin) permitting it +# and IIAB install scripts to actually complete :) # # CLARIF: something like 'chown -R root:root /root/.npm' cannot happen # synchronously with the 1st run of 'npm install' (when it's needed!) -# nor is 'chown' functionality nec, now that --allow-root does the job) +# Nor is 'chown' functionality nec, now that --allow-root does the job. #- name: Create the express framework for Node.js (OS's other than Fedora 18) - name: Run 'npm install --allow-root' to create /opt/iiab/{{ sugarizer_server_version }}/node_modules (CAN TAKE SEVERAL MINUTES) From b5822f1213845a5f60d2a4a3c4e5a5d735539d37 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 07:22:49 -0400 Subject: [PATCH 149/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index d2b9f4cff..7fe312ca3 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -97,7 +97,7 @@ # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules -# Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's? +# Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's ? # Strategies considered to avoid re-running it: # OLD WAY 1: test & set flag node_modules_exists: True # OLD WAY 2: "creates: ..." checks for non-existence of /opt/iiab/sugarizer-server-1.0/node_modules From d31437c43a1853f7899b44db76b988485c622fa7 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 08:38:41 -0400 Subject: [PATCH 150/374] Internal doc/comment updated for Ubuntu 18.04's npm 3.5.2 --- roles/sugarizer/tasks/main.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 7fe312ca3..a2d7fc8ac 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -119,7 +119,8 @@ # is better than 5.6.0. which is better than Ubuntu 18.04's 3.5.2). # 2018-07-15: TK Kang & Holt confirmed sudo-driven "npm install" maxes out CPU -# for hours, on diff OS's. Error code EACCES, errno -13 (permission denied): +# for hours, on diff OS's using npm 5.6.0 and 6.2.0. Error code EACCES, +# errno -13 (permission denied): # "Missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" # # SOLUTION: Implement '--allow-root' below, as is critical for 1st run of @@ -127,9 +128,14 @@ # files owned by root:root instead of iiab-admin:iiab-admin) permitting it # and IIAB install scripts to actually complete :) # -# CLARIF: something like 'chown -R root:root /root/.npm' cannot happen +# CLARIF 1: Something like 'chown -R root:root /root/.npm' cannot happen # synchronously with the 1st run of 'npm install' (when it's needed!) # Nor is 'chown' functionality nec, now that --allow-root does the job. +# +# CLARIF 2: Ubuntu 18.04 is currently unaffected due to its ancient +# npm 3.5.2, which instead uses /home/iiab-admin/.npm (these remain owned +# by iiab-admin:iiab-admin, even with the new "npm install --allow-root", +# but thankfully still get the job done, for now!) #- name: Create the express framework for Node.js (OS's other than Fedora 18) - name: Run 'npm install --allow-root' to create /opt/iiab/{{ sugarizer_server_version }}/node_modules (CAN TAKE SEVERAL MINUTES) From 8ea20d9b6812d63d3e39052fba367941c154be2e Mon Sep 17 00:00:00 2001 From: Arky <hitmanarky@gmail.com> Date: Mon, 16 Jul 2018 00:36:05 +0700 Subject: [PATCH 151/374] Kolibri role Add Kolibri role for IIAB 6.6 Preview --- roles/kolibri/README.rst | 65 +++++++++++++++ roles/kolibri/defaults/main.yml | 34 ++++++++ roles/kolibri/tasks/main.yml | 97 ++++++++++++++++++++++ roles/kolibri/templates/kolibri.service.j2 | 16 ++++ 4 files changed, 212 insertions(+) create mode 100644 roles/kolibri/README.rst create mode 100644 roles/kolibri/defaults/main.yml create mode 100644 roles/kolibri/tasks/main.yml create mode 100644 roles/kolibri/templates/kolibri.service.j2 diff --git a/roles/kolibri/README.rst b/roles/kolibri/README.rst new file mode 100644 index 000000000..eb0b5d4ee --- /dev/null +++ b/roles/kolibri/README.rst @@ -0,0 +1,65 @@ +============== +Kolibri README +============== + +This role install Kolibri, an open-source educational platform specially designed +to provide offline access to a wide range of quality, openly licensed educational +contents in low-resource contexts like rural schools, refugee camps, orphanages, +and also in non-formal school programs. + +Access +------ + +If enabled and with the default settings Kolibri should be accessible at http://box:8009/ + +To login to Kolibri enter + + User Name: Admin + + Password: changeme + +Configuration Parameters +------------------------ + +Please look in defaults/main.yml for the default values of the various install parameters. Everything +in this readme assumes the default values. + +Automatic Device Provisioning +----------------------------- +When kolibri_provision is enabled, the installation will setup the following settings: + + Kolibri Facility name: 'Kolibri-in-a-Box' + + Kolibri Preset type: formal (Other options are nonformal, informal) + + Kolibri default language: en (Otherwise language are ar,bn-bd,en,es-es,fa,fr-fr,hi-in,mr,nyn,pt-br,sw-tz,ta,te,ur-pk,yo,zu) + + Kolibri Admin User: Admin + + Kolibri Admin password: changeme + +Cloning content +--------------- +In Kolibri 0.10 introduced `kolibri manage deprovision` which will remove +user configuration, leaving content intact. You can then copy/clone /library/kolibri +to a new location. + + +Trouble Shooting +---------------- + +You can run the server manually with the following commands: + + systemctl stop kolibri (make sure the systemd service is not running) + + export KOLIBRI_HOME=/library/kolibri + + export KOLIBRI_HTTP_PORT=8009 (other Kolibri will run on default port 8080) + + kolibri start + +To return to using the systemd unit: + + kolibri stop + + systemctl start kolibri diff --git a/roles/kolibri/defaults/main.yml b/roles/kolibri/defaults/main.yml new file mode 100644 index 000000000..769604cd1 --- /dev/null +++ b/roles/kolibri/defaults/main.yml @@ -0,0 +1,34 @@ +# The values here are defaults. +# To override them edit the main var definitions in iiab/vars + +# Installation Variables +kolibri_install: True +kolibri_enabled: True + +# Kolibri folder to store its data and configuration files. +kolibri_home: "{{ content_base }}/kolibri" + +kolibri_http_port: 8009 +kolibri_url: /kolibri/ +kolibri_path: "{{ iiab_base }}/kolibri" +kolibri_exec_path: /usr/local/bin/kolibri + +# Kolibri system user +kolibri_user: kolibri + +# Kolibri setup will be provisioned with default administration account, preset and +# language. You could turn this to 'False' while reinstalling kolibri. +kolibri_provision: True + +# Kolibri Facility name +kolibri_facility: 'Kolibri-in-a-Box' + +# Kolibri Preset type: formal, nonformal, informal +kolibri_preset: 'formal' + +# Kolibri default language (ar,bn-bd,en,es-es,fa,fr-fr,hi-in,mr,nyn,pt-br,sw-tz,ta,te,ur-pk,yo,zu) +kolibri_language: 'en' + +# Kolibri admin account +kolibri_admin_user: 'Admin' +kolibri_admin_password: 'changeme' diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml new file mode 100644 index 000000000..89ce010d6 --- /dev/null +++ b/roles/kolibri/tasks/main.yml @@ -0,0 +1,97 @@ +--- +- name: Create a Kolibri system user and to www-data, disk groups + user: + name: "{{ kolibri_user }}" + groups: + - "{{ apache_user }}" + - disk + state: present + shell: /bin/false + system: yes + create_home: no + +- name: Create Kolibri folder to store data and configuration files. + file: + path: "{{ item }}" + owner: "{{ kolibri_user }}" + group: "{{ apache_user }}" + mode: 0755 + state: directory + with_items: + - "{{ kolibri_home }}" + + +- name: Install kolibri using pip on all OS's + pip: + name: kolibri + state: latest + when: internet_available + +- name: Create kolibri systemd service file + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: 'kolibri.service.j2' , dest: '/etc/systemd/system/kolibri.service', mode: '0644' } + +- name: Set kolibri default language. + shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" language setdefault "{{ kolibri_language }}" + ignore_errors: yes + when: kolibri_provision + +- name: Create kolibri default facility name, admin account and language. + shell: > + export KOLIBRI_HOME="{{ kolibri_home }}" && + "{{ kolibri_exec_path }}" manage provisiondevice --facility "{{ kolibri_facility }}" + --superusername "{{ kolibri_admin_user }}" --superuserpassword "{{ kolibri_admin_password }}" + --preset "{{ kolibri_preset }}" --language_id "{{ kolibri_language }}" --verbosity 0 --noinput + ignore_errors: yes + when: kolibri_provision + +- name: Change /library/kolibri directory permissions. + file: + path: "{{ kolibri_home }}" + owner: "{{ kolibri_user }}" + group: "{{ apache_user }}" + recurse: yes + +- name: Enable kolibri service. + service: + name: "{{ item.name }}" + enabled: yes + state: restarted + with_items: + - { name: kolibri } + when: kolibri_enabled + +- name: Disable kolibri service. + service: + name: "{{ item.name }}" + enabled: no + state: stopped + with_items: + - { name: kolibri } + when: not kolibri_enabled + +- name: Add 'kolibri' to list of services at /etc/iiab/iiab.ini + ini_file: + dest: "{{ service_filelist }}" + section: kolibri + option: "{{ item.option }}" + value: "{{ item.value }}" + with_items: + - option: name + value: kolibri + - option: description + value: '"Kolibri is an open-source educational platform specially designed to provide offline access to a wide range of quality, openly licensed educational contents in low-resource contexts like rural schools, refugee camps, orphanages, and also in non-formal school programs."' + - option: kolibri_url + value: "{{ kolibri_url }}" + - option: kolibri_path + value: "{{ kolibri_path }}" + - option: kolibri_port + value: "{{ kolibri_http_port }}" + - option: enabled + value: "{{ kolibri_enabled }}" diff --git a/roles/kolibri/templates/kolibri.service.j2 b/roles/kolibri/templates/kolibri.service.j2 new file mode 100644 index 000000000..ef420c4a1 --- /dev/null +++ b/roles/kolibri/templates/kolibri.service.j2 @@ -0,0 +1,16 @@ +[Unit] +Description=Kolibri + +[Service] +Type=oneshot +RemainAfterExit=yes +Environment=KOLIBRI_USER={{ kolibri_user }} +Environment=KOLIBRI_HOME={{ kolibri_home }} +Environment=KOLIBRI_HTTP_PORT={{ kolibri_http_port }} +User={{ kolibri_user }} +Group={{ apache_user }} +ExecStart={{ kolibri_exec_path }} start +ExecStop={{ kolibri_exec_path }} stop + +[Install] +WantedBy=multi-user.target From e0cb0b4f55e0538fb531c9675f3c5a75a64527aa Mon Sep 17 00:00:00 2001 From: Arky <hitmanarky@gmail.com> Date: Mon, 16 Jul 2018 01:17:39 +0700 Subject: [PATCH 152/374] [Debian 10] Add vars/debian-10 file --- vars/debian-10.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 vars/debian-10.yml diff --git a/vars/debian-10.yml b/vars/debian-10.yml new file mode 100644 index 000000000..b80d9e39f --- /dev/null +++ b/vars/debian-10.yml @@ -0,0 +1,24 @@ +is_debuntu: True +is_debian: True +is_debian_10: True +dns_service: bind9 +dhcp_service: isc-dhcp-server +dns_user: bind +proxy: squid +proxy_user: proxy +apache_service: apache2 +apache_config_dir: apache2/sites-available +apache_user: www-data +apache_log_dir: /var/log/apache2 +smb_service: smbd +nmb_service: nmbd +systemctl_program: /bin/systemctl +mysql_service: mariadb +apache_log: /var/log/apache2/access.log +sshd_service: ssh +php_version: 7.2 +postgresql_version: 10 +systemd_location: /lib/systemd/system +# Upgrade OS's own Calibre to very latest: +calibre_via_debs: True +calibre_via_python: False From 4b2f6c295664224d3f388358cb24f43b1b812692 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 18:50:19 -0400 Subject: [PATCH 153/374] --unsafe-perm=true (for npm 5.6.0 on RPi) --- roles/sugarizer/tasks/main.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index a2d7fc8ac..ea4398783 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -6,7 +6,7 @@ # 1. DOWNLOAD+LINK /opt/iiab/sugarizer -- name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab (CAN TAKE SEVERAL MINUTES) +- name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab (MAY DOWNLOAD 600+ MB) git: repo: https://github.com/llaske/sugarizer dest: "{{ sugarizer_location }}/{{ sugarizer_version }}" @@ -119,27 +119,32 @@ # is better than 5.6.0. which is better than Ubuntu 18.04's 3.5.2). # 2018-07-15: TK Kang & Holt confirmed sudo-driven "npm install" maxes out CPU -# for hours, on diff OS's using npm 5.6.0 and 6.2.0. Error code EACCES, -# errno -13 (permission denied): +# for hours, on diff OS's using npm 5.6.0 and 6.2.0. Hours later you get +# error: code EACCES, errno -13 (permission denied), # "Missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" # -# SOLUTION: Implement '--allow-root' below, as is critical for 1st run of -# sudo-driven 'npm install' (causing it to create /root/.npm cache & lock -# files owned by root:root instead of iiab-admin:iiab-admin) permitting it -# and IIAB install scripts to actually complete :) +# SOLUTION: Implement '--allow-root --unsafe-perm=true' below, as is critical +# for 1st run of sudo-driven 'npm install' especially: # -# CLARIF 1: Something like 'chown -R root:root /root/.npm' cannot happen -# synchronously with the 1st run of 'npm install' (when it's needed!) -# Nor is 'chown' functionality nec, now that --allow-root does the job. +# ON DEBIAN: npm 5.6.0's --allow-root is sufficient: causing creation of +# /root/.npm cache & lock files to owned by root:root instead of +# iiab-admin:iiab-admin...thus permitting it & IIAB installs to complete! +# +# ON RASPBIAN: npm 5.6.0's --unsafe-perm=true is required, so that npm install +# actually finished (in about 5 minutes). +# +# CLARIF 1: Something like 'chown -R root:root /root/.npm' would do the job, +# but cannot happen synchronously with the 1st run of 'npm install' (when +# it's needed!) Similar to what --allow-root does on Debian. # # CLARIF 2: Ubuntu 18.04 is currently unaffected due to its ancient # npm 3.5.2, which instead uses /home/iiab-admin/.npm (these remain owned -# by iiab-admin:iiab-admin, even with the new "npm install --allow-root", -# but thankfully still get the job done, for now!) +# by iiab-admin:iiab-admin, even with '--allow-root', but thankfully still +# gets the job done, for now!) #- name: Create the express framework for Node.js (OS's other than Fedora 18) -- name: Run 'npm install --allow-root' to create /opt/iiab/{{ sugarizer_server_version }}/node_modules (CAN TAKE SEVERAL MINUTES) - command: npm install --allow-root # "command:" a bit safer than "shell:" +- name: Run 'npm install --allow-root --unsafe-perm=true' to create /opt/iiab/{{ sugarizer_server_version }}/node_modules (CAN TAKE ~3 MINUTES) + command: npm install --allow-root --unsafe-perm=true # "command:" a bit safer than "shell:" args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" # OLD WAY 2 From c2afd5d9beffb3f6d5f11919c7f41410289b284b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 18:56:20 -0400 Subject: [PATCH 154/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index ea4398783..e4622d8d4 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -126,19 +126,21 @@ # SOLUTION: Implement '--allow-root --unsafe-perm=true' below, as is critical # for 1st run of sudo-driven 'npm install' especially: # -# ON DEBIAN: npm 5.6.0's --allow-root is sufficient: causing creation of -# /root/.npm cache & lock files to owned by root:root instead of +# ON DEBIAN: npm 5.6.0's --allow-root would be sufficient: causing creation +# of /root/.npm cache & lock files to owned by root:root instead of # iiab-admin:iiab-admin...thus permitting it & IIAB installs to complete! # -# ON RASPBIAN: npm 5.6.0's --unsafe-perm=true is required, so that npm install -# actually finished (in about 5 minutes). +# ON RASPBIAN: npm 5.6.0's --unsafe-perm=true is *required* so that npm +# install actually finished (in about 5 minutes). It's possible we should +# remove --allow-root in favore of --unsafe-perm=true alone. But this needs +# testing on different Linuxes before proceeding. # # CLARIF 1: Something like 'chown -R root:root /root/.npm' would do the job, -# but cannot happen synchronously with the 1st run of 'npm install' (when -# it's needed!) Similar to what --allow-root does on Debian. +# but cannot happen synchronously throughout the 1st run of 'npm install' +# (when it's needed!) Similar to what --allow-root does on Debian. # # CLARIF 2: Ubuntu 18.04 is currently unaffected due to its ancient -# npm 3.5.2, which instead uses /home/iiab-admin/.npm (these remain owned +# npm 3.5.2, which instead uses /home/iiab-admin/.npm (which remains owned # by iiab-admin:iiab-admin, even with '--allow-root', but thankfully still # gets the job done, for now!) From 7dc67810fbeddf5cc1cb14d32498780bc997d4d5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 15 Jul 2018 19:04:48 -0400 Subject: [PATCH 155/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index e4622d8d4..0b33f1f1a 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -119,8 +119,8 @@ # is better than 5.6.0. which is better than Ubuntu 18.04's 3.5.2). # 2018-07-15: TK Kang & Holt confirmed sudo-driven "npm install" maxes out CPU -# for hours, on diff OS's using npm 5.6.0 and 6.2.0. Hours later you get -# error: code EACCES, errno -13 (permission denied), +# for hours, on diff OS's using npm 5.6.0 and 6.2.0. Hours later you may get +# error: code EACCES, errno -13 (permission denied), # "Missing write access to /opt/iiab/sugarizer-server-1.0/node_modules" # # SOLUTION: Implement '--allow-root --unsafe-perm=true' below, as is critical From a6e8d8e79e0c3befc3a57347afc841634af3d7b6 Mon Sep 17 00:00:00 2001 From: Arky <hitmanarky@gmail.com> Date: Mon, 16 Jul 2018 01:22:30 +0700 Subject: [PATCH 156/374] [Debian 10]Add case switch for debian-10 Fixes #902 --- scripts/local_facts.fact | 1 + vars/debian-10.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index d08dc9f3a..b83d5305a 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -23,6 +23,7 @@ case $OS_VER in "fedora-22" | \ "debian-8" | \ "debian-9" | \ + "debian-10" | \ "ubuntu-16" | \ "ubuntu-17" | \ "ubuntu-18" | \ diff --git a/vars/debian-10.yml b/vars/debian-10.yml index b80d9e39f..bf4245c86 100644 --- a/vars/debian-10.yml +++ b/vars/debian-10.yml @@ -16,7 +16,7 @@ systemctl_program: /bin/systemctl mysql_service: mariadb apache_log: /var/log/apache2/access.log sshd_service: ssh -php_version: 7.2 +php_version: 7.1 postgresql_version: 10 systemd_location: /lib/systemd/system # Upgrade OS's own Calibre to very latest: From 486f66b6ae56dbf41e59cf5442d1681a986d888a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 11:54:19 -0400 Subject: [PATCH 157/374] Update main.yml --- roles/kolibri/defaults/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/kolibri/defaults/main.yml b/roles/kolibri/defaults/main.yml index 769604cd1..d0c0d29e3 100644 --- a/roles/kolibri/defaults/main.yml +++ b/roles/kolibri/defaults/main.yml @@ -1,9 +1,9 @@ # The values here are defaults. -# To override them edit the main var definitions in iiab/vars +# To override them edit /opt/iiab/iiab/vars/local_vars.yml # Installation Variables -kolibri_install: True -kolibri_enabled: True +kolibri_install: False +kolibri_enabled: False # Kolibri folder to store its data and configuration files. kolibri_home: "{{ content_base }}/kolibri" @@ -21,14 +21,14 @@ kolibri_user: kolibri kolibri_provision: True # Kolibri Facility name -kolibri_facility: 'Kolibri-in-a-Box' +kolibri_facility: Kolibri-in-a-Box # Kolibri Preset type: formal, nonformal, informal -kolibri_preset: 'formal' +kolibri_preset: formal # Kolibri default language (ar,bn-bd,en,es-es,fa,fr-fr,hi-in,mr,nyn,pt-br,sw-tz,ta,te,ur-pk,yo,zu) -kolibri_language: 'en' +kolibri_language: en # Kolibri admin account -kolibri_admin_user: 'Admin' -kolibri_admin_password: 'changeme' +kolibri_admin_user: Admin +kolibri_admin_password: changeme From 33bbf5f906203be6c76817069095b75d83315633 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:00:08 -0400 Subject: [PATCH 158/374] Update main.yml --- roles/kolibri/tasks/main.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml index 89ce010d6..064efaca1 100644 --- a/roles/kolibri/tasks/main.yml +++ b/roles/kolibri/tasks/main.yml @@ -1,4 +1,3 @@ ---- - name: Create a Kolibri system user and to www-data, disk groups user: name: "{{ kolibri_user }}" @@ -10,7 +9,7 @@ system: yes create_home: no -- name: Create Kolibri folder to store data and configuration files. +- name: Create /library/kolibri to store data and configuration files file: path: "{{ item }}" owner: "{{ kolibri_user }}" @@ -37,12 +36,12 @@ with_items: - { src: 'kolibri.service.j2' , dest: '/etc/systemd/system/kolibri.service', mode: '0644' } -- name: Set kolibri default language. +- name: Set kolibri default language shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" language setdefault "{{ kolibri_language }}" ignore_errors: yes when: kolibri_provision -- name: Create kolibri default facility name, admin account and language. +- name: Create kolibri default facility name, admin account and language shell: > export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" manage provisiondevice --facility "{{ kolibri_facility }}" @@ -51,14 +50,14 @@ ignore_errors: yes when: kolibri_provision -- name: Change /library/kolibri directory permissions. +- name: Change /library/kolibri directory permissions file: path: "{{ kolibri_home }}" owner: "{{ kolibri_user }}" group: "{{ apache_user }}" recurse: yes -- name: Enable kolibri service. +- name: Enable kolibri service service: name: "{{ item.name }}" enabled: yes @@ -67,7 +66,7 @@ - { name: kolibri } when: kolibri_enabled -- name: Disable kolibri service. +- name: Disable kolibri service service: name: "{{ item.name }}" enabled: no From 5efdb563b4f8bbf9fb7224f206268125c540e4e4 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:04:50 -0400 Subject: [PATCH 159/374] Update README.rst --- roles/kolibri/README.rst | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/roles/kolibri/README.rst b/roles/kolibri/README.rst index eb0b5d4ee..80427440f 100644 --- a/roles/kolibri/README.rst +++ b/roles/kolibri/README.rst @@ -2,7 +2,7 @@ Kolibri README ============== -This role install Kolibri, an open-source educational platform specially designed +This role installs Kolibri, an open-source educational platform specially designed to provide offline access to a wide range of quality, openly licensed educational contents in low-resource contexts like rural schools, refugee camps, orphanages, and also in non-formal school programs. @@ -10,12 +10,12 @@ and also in non-formal school programs. Access ------ -If enabled and with the default settings Kolibri should be accessible at http://box:8009/ +If enabled and with the default settings Kolibri should be accessible at http://box:8009 To login to Kolibri enter - User Name: Admin - + Username: Admin + Password: changeme Configuration Parameters @@ -26,6 +26,7 @@ in this readme assumes the default values. Automatic Device Provisioning ----------------------------- + When kolibri_provision is enabled, the installation will setup the following settings: Kolibri Facility name: 'Kolibri-in-a-Box' @@ -40,12 +41,12 @@ When kolibri_provision is enabled, the installation will setup the following set Cloning content --------------- -In Kolibri 0.10 introduced `kolibri manage deprovision` which will remove + +Kolibri 0.10 introduced `kolibri manage deprovision` which will remove user configuration, leaving content intact. You can then copy/clone /library/kolibri to a new location. - -Trouble Shooting +Troubleshooting ---------------- You can run the server manually with the following commands: @@ -54,7 +55,7 @@ You can run the server manually with the following commands: export KOLIBRI_HOME=/library/kolibri - export KOLIBRI_HTTP_PORT=8009 (other Kolibri will run on default port 8080) + export KOLIBRI_HTTP_PORT=8009 (otherwise Kolibri will try to run on default port 8080) kolibri start From 9dd9db7e5aa7fbd40f238f3d3a24f31f6ec3d704 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:06:39 -0400 Subject: [PATCH 160/374] Update README.rst --- roles/kolibri/README.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/kolibri/README.rst b/roles/kolibri/README.rst index 80427440f..3ab9bcf19 100644 --- a/roles/kolibri/README.rst +++ b/roles/kolibri/README.rst @@ -2,10 +2,11 @@ Kolibri README ============== -This role installs Kolibri, an open-source educational platform specially designed -to provide offline access to a wide range of quality, openly licensed educational -contents in low-resource contexts like rural schools, refugee camps, orphanages, -and also in non-formal school programs. +This Ansible role installs Kolibri within Internet-in-a-Box. Kolibri is an +open-source educational platform specially designed to provide offline access +to a wide range of quality, openly licensed educational contents in +low-resource contexts like rural schools, refugee camps, orphanages, and also +in non-formal school programs. Access ------ From ea09e45c4cefcc241444a96c7d276219aa19cc77 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:09:52 -0400 Subject: [PATCH 161/374] Update default_vars.yml --- vars/default_vars.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 18beac3d4..05cc37f58 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -313,6 +313,10 @@ kalite_password: kalite # Unused in 2018 # kalite_server_name: kalite +# Kolibri +kolibri_install: False +kolibri_enabled: False + # Kiwix kiwix_install: True kiwix_enabled: True From c437375eaac789825a704946788af22996d3e771 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:10:33 -0400 Subject: [PATCH 162/374] Update local_vars_min.yml --- vars/local_vars_min.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index 2029a64e5..6ca4dcb05 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -170,6 +170,9 @@ kalite_enabled: True # Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True +kolibri_install: False +kolibri_enabled: False + kiwix_install: True kiwix_enabled: True From a16a467caac45c3c63b9b20a6d05acc123de9a81 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:10:56 -0400 Subject: [PATCH 163/374] Update local_vars_min_vpn.yml --- vars/local_vars_min_vpn.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/local_vars_min_vpn.yml b/vars/local_vars_min_vpn.yml index 55f57fefb..ec7aeb7bf 100644 --- a/vars/local_vars_min_vpn.yml +++ b/vars/local_vars_min_vpn.yml @@ -170,6 +170,9 @@ kalite_enabled: True # Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True +kolibri_install: False +kolibri_enabled: False + kiwix_install: True kiwix_enabled: True From 67098c54a03a53236fe69e8a9c9630ff66cf2522 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:11:13 -0400 Subject: [PATCH 164/374] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index be4c943cc..f45033497 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -170,6 +170,9 @@ kalite_enabled: True # Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True +kolibri_install: False +kolibri_enabled: False + kiwix_install: True kiwix_enabled: True From b4c1aad744e432b014a04028136f9000b928d33b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:11:48 -0400 Subject: [PATCH 165/374] Update local_vars_medium_vpn.yml --- vars/local_vars_medium_vpn.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/local_vars_medium_vpn.yml b/vars/local_vars_medium_vpn.yml index 6718b6ac4..0750d4a2c 100644 --- a/vars/local_vars_medium_vpn.yml +++ b/vars/local_vars_medium_vpn.yml @@ -170,6 +170,9 @@ kalite_enabled: True # Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True +kolibri_install: False +kolibri_enabled: False + kiwix_install: True kiwix_enabled: True From 5d099a1bceb37cc30b5508b8a0118141cc73d089 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:12:23 -0400 Subject: [PATCH 166/374] Update local_vars_big.yml --- vars/local_vars_big.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index 50103c6fc..66f5bd196 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -170,6 +170,9 @@ kalite_enabled: True # Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True +kolibri_install: True +kolibri_enabled: True + kiwix_install: True kiwix_enabled: True From 3474dc9388dd0e4a9068605b7fa245dd2dd9e212 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:12:46 -0400 Subject: [PATCH 167/374] Update local_vars_big_vpn.yml --- vars/local_vars_big_vpn.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/local_vars_big_vpn.yml b/vars/local_vars_big_vpn.yml index 7664b19f3..054c428df 100644 --- a/vars/local_vars_big_vpn.yml +++ b/vars/local_vars_big_vpn.yml @@ -170,6 +170,9 @@ kalite_enabled: True # Unused in 2018; but remains as placeholder for Fedora 18 legacy (XO laptops) kalite_cron_enabled: True +kolibri_install: True +kolibri_enabled: True + kiwix_install: True kiwix_enabled: True From 1a677955e087672bdcaf104e036339377d262b21 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:13:53 -0400 Subject: [PATCH 168/374] Update main.yml --- roles/7-edu-apps/tasks/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/7-edu-apps/tasks/main.yml b/roles/7-edu-apps/tasks/main.yml index 62699e42b..941f6347e 100644 --- a/roles/7-edu-apps/tasks/main.yml +++ b/roles/7-edu-apps/tasks/main.yml @@ -9,6 +9,12 @@ when: kalite_install tags: kalite +- name: KOLIBRI + include_role: + name: kolibri + when: kolibri_install + tags: kolibri + - name: KIWIX include_role: name: kiwix From 12755266679c6d72223baa2878a7b32c38f86818 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:16:53 -0400 Subject: [PATCH 169/374] Update README.rst --- roles/kolibri/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kolibri/README.rst b/roles/kolibri/README.rst index 3ab9bcf19..197581251 100644 --- a/roles/kolibri/README.rst +++ b/roles/kolibri/README.rst @@ -16,7 +16,7 @@ If enabled and with the default settings Kolibri should be accessible at http:// To login to Kolibri enter Username: Admin - + Password: changeme Configuration Parameters From 3ee69f613b031ea007623207b68ff705dafb3c1f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:31:57 -0400 Subject: [PATCH 170/374] Update main.yml --- roles/kolibri/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml index 064efaca1..14230d9ad 100644 --- a/roles/kolibri/tasks/main.yml +++ b/roles/kolibri/tasks/main.yml @@ -19,7 +19,6 @@ with_items: - "{{ kolibri_home }}" - - name: Install kolibri using pip on all OS's pip: name: kolibri From 1d168efe89e0bad4bb4984fcf48e0c0e189b5111 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:33:58 -0400 Subject: [PATCH 171/374] Update main.yml --- roles/kolibri/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kolibri/defaults/main.yml b/roles/kolibri/defaults/main.yml index d0c0d29e3..e19db7b0d 100644 --- a/roles/kolibri/defaults/main.yml +++ b/roles/kolibri/defaults/main.yml @@ -11,7 +11,7 @@ kolibri_home: "{{ content_base }}/kolibri" kolibri_http_port: 8009 kolibri_url: /kolibri/ kolibri_path: "{{ iiab_base }}/kolibri" -kolibri_exec_path: /usr/local/bin/kolibri +kolibri_exec_path: /usr/bin/kolibri # Kolibri system user kolibri_user: kolibri From 300fbbc57c6f310b1f5cbedcfc5e6ff1695d756b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 13:57:58 -0400 Subject: [PATCH 172/374] kolibri in /usr/local/bin for now, not /usr/bin --- roles/kolibri/defaults/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/kolibri/defaults/main.yml b/roles/kolibri/defaults/main.yml index e19db7b0d..1d9f660bf 100644 --- a/roles/kolibri/defaults/main.yml +++ b/roles/kolibri/defaults/main.yml @@ -11,7 +11,8 @@ kolibri_home: "{{ content_base }}/kolibri" kolibri_http_port: 8009 kolibri_url: /kolibri/ kolibri_path: "{{ iiab_base }}/kolibri" -kolibri_exec_path: /usr/bin/kolibri +# 2018-07-16: IIAB recommends /usr/bin but @arky says this isn't yet possible, due to pip +kolibri_exec_path: /usr/local/bin/kolibri # Kolibri system user kolibri_user: kolibri From 9895f872af6dc3cf08811a312c640190a3b27b16 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 14:08:58 -0400 Subject: [PATCH 173/374] Update main.yml --- roles/kolibri/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml index 14230d9ad..e1022ce3b 100644 --- a/roles/kolibri/tasks/main.yml +++ b/roles/kolibri/tasks/main.yml @@ -1,4 +1,4 @@ -- name: Create a Kolibri system user and to www-data, disk groups +- name: Create Linux user {{ kolibri_user }} and it to groups www-data, disk user: name: "{{ kolibri_user }}" groups: From a1ebbabef97e9c2db611b0fed44683b03cf8972a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 14:11:07 -0400 Subject: [PATCH 174/374] Update main.yml --- roles/kolibri/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml index e1022ce3b..f0083d067 100644 --- a/roles/kolibri/tasks/main.yml +++ b/roles/kolibri/tasks/main.yml @@ -1,4 +1,4 @@ -- name: Create Linux user {{ kolibri_user }} and it to groups www-data, disk +- name: Create Linux user {{ kolibri_user }} and add it to groups {{ apache_user }}, disk user: name: "{{ kolibri_user }}" groups: From 7a76f4e87ac164575438d7962ab7e9a77bf25c17 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 14:47:34 -0400 Subject: [PATCH 175/374] Update assessment.yml --- roles/kalite/tasks/assessment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kalite/tasks/assessment.yml b/roles/kalite/tasks/assessment.yml index 43839eb7f..73faec727 100644 --- a/roles/kalite/tasks/assessment.yml +++ b/roles/kalite/tasks/assessment.yml @@ -8,7 +8,7 @@ - name: Run the assessment setup using kalite manage command: "{{ kalite_program }} manage unpack_assessment_zip {{ downloads_dir }}/khan_assessment.zip" environment: - KALITE_HOME: "{{ kalite_root }}" + KALITE_HOME: "{{ kalite_root }}" async: 900 poll: 10 when: not khan_assessment_installed.stat.exists or khan_assessment_installed.stat.size < 20000 From 15eecbc48eb81a53b6c3535722fdfc5ee7f73cee Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 14:49:29 -0400 Subject: [PATCH 176/374] Update main.yml --- roles/kalite/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index 84c508fe1..1cbbdfa5a 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -13,7 +13,8 @@ when: not is_F18 - name: See if KA Lite is already configured - stat: path="{{ kalite_db_name }}" + stat: + path: "{{ kalite_db_name }}" register: kalite_installed - include_tasks: install-f18.yml From a39d496420cc1bbf34b6ec207884b14d668819ef Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 14:51:51 -0400 Subject: [PATCH 177/374] Update enable.yml --- roles/kalite/tasks/enable.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/roles/kalite/tasks/enable.yml b/roles/kalite/tasks/enable.yml index ed278a863..7a95aabeb 100644 --- a/roles/kalite/tasks/enable.yml +++ b/roles/kalite/tasks/enable.yml @@ -2,26 +2,30 @@ # And the systemd unit files should be defined - name: Enable 'kalite-serve' service - service: name=kalite-serve - enabled=yes - state=started + service: + name: kalite-serve + enabled: yes + state: started - name: Disable 'kalite-serve' service - service: name=kalite-serve - enabled=no - state=stopped + service: + name: kalite-serve + enabled: no + state: stopped when: not kalite_enabled # Since Fedora 18 we don't have a separate unit file for kalite-cron - name: Disable kalite cron server F18 - service: name=kalite-cron - enabled=no - state=stopped + service: + name: kalite-cron + enabled: no + state: stopped when: not kalite_cron_enabled and is_F18 - name: Enable kalite cron server F18 - service: name=kalite-cron - enabled=yes - state=started + service: + name: kalite-cron + enabled: yes + state: started when: kalite_cron_enabled and is_F18 From 8e1f2fc4938a35d9344e1c983567b9b35895ea32 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 14:55:56 -0400 Subject: [PATCH 178/374] Update install-f18.yml --- roles/kalite/tasks/install-f18.yml | 73 +++++++++++++++++------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/roles/kalite/tasks/install-f18.yml b/roles/kalite/tasks/install-f18.yml index bad6c551a..7d38866fc 100644 --- a/roles/kalite/tasks/install-f18.yml +++ b/roles/kalite/tasks/install-f18.yml @@ -1,66 +1,75 @@ # This is for Fedora 18, assumed to be an XO - name: Install dependent packages (Fedora 18) - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - python-psutil - expect when: is_F18 - name: Install dependent pip packages (Fedora 18) - pip: name=selenium + pip: + name: selenium when: internet_available and is_F18 - name: Determine if KA Lite is already downloaded - stat: path={{ downloads_dir }}/ka-lite + stat: + path: "{{ downloads_dir }}/ka-lite" register: kalite - name: Download the latest KA Lite repo - git: repo={{ kalite_repo_url }} - dest={{ downloads_dir }}/ka-lite - depth=1 - version="0.13.x" + git: + repo: "{{ kalite_repo_url }}" + dest: "{{ downloads_dir }}/ka-lite" + depth: 1 + version: 0.13.x ignore_errors: yes when: internet_available and kalite.stat.exists is defined and not kalite.stat.exists - name: Create iiab-kalite user and password (Fedora 18) - user: name={{ kalite_user }} - password={{ kalite_password_hash }} - update_password=on_create + user: + name: "{{ kalite_user }}" + password: "{{ kalite_password_hash }}" + update_password: on_create - name: Create kalite_root directory (Fedora 18) - file: path={{ kalite_root }} - owner=root - group=root - mode=0755 - state=directory + file: + path: "{{ kalite_root }}" + owner: root + group: root + mode: 0755 + state: directory - name: Copy the KA Lite repo into place (Fedora 18) command: "rsync -at {{ downloads_dir }}/ka-lite/ {{ kalite_root }}" - name: Make kalite_user owner - file: path={{ kalite_root }} - owner={{ kalite_user }} - group={{ kalite_user }} - recurse=yes - state=directory + file: + path: "{{ kalite_root }}" + owner: "{{ kalite_user }}" + group: "{{ kalite_user }}" + recurse: yes + state: directory # local_settings is deprecated - name: Copy local_settings file - template: src=f18/local_settings.py.j2 - dest="{{ kalite_root }}/kalite/local_settings.py" - owner={{ kalite_user }} - group={{ kalite_user }} - mode=0644 + template: + src: f18/local_settings.py.j2 + dest: "{{ kalite_root }}/kalite/local_settings.py" + owner: "{{ kalite_user }}" + group: "{{ kalite_user }}" + mode: 0644 - name: Create kalite-serve & kalite-cron services, and iiab_cronservectl.sh - template: backup=no - src={{ item.src }} - dest={{ item.dest }} - owner=root - group=root - mode={{ item.mode }} + template: + backup: no + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: root + group: root + mode: "{{ item.mode }}" with_items: - { src: 'f18/kalite-serve.service.j2', dest: '/etc/systemd/system/kalite-serve.service', mode: '0644'} - { src: 'f18/kalite-cron.service.j2', dest: '/etc/systemd/system/kalite-cron.service', mode: '0644'} From dab1632816c500c547e4a5aeb11d8c494ea5e22e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 14:56:37 -0400 Subject: [PATCH 179/374] Update setup.yml --- roles/kalite/tasks/setup.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/roles/kalite/tasks/setup.yml b/roles/kalite/tasks/setup.yml index 2ad239833..05b8d5674 100644 --- a/roles/kalite/tasks/setup.yml +++ b/roles/kalite/tasks/setup.yml @@ -1,15 +1,16 @@ # This is for an OS other than Fedora 18 - name: Create kalite_root directory - file: path={{ kalite_root }}/httpsrv/static - owner=root - group=root - mode=0755 - state=directory + file: + path: "{{ kalite_root }}/httpsrv/static" + owner: root + group: root + mode: 0755 + state: directory - name: Run the setup using 'kalite manage' command: "{{ kalite_program }} manage setup --username={{ kalite_admin_user }} --password={{ kalite_admin_password }} --noinput" environment: - KALITE_HOME: "{{ kalite_root }}" + KALITE_HOME: "{{ kalite_root }}" async: 900 poll: 10 From 5c9ad5a9b451575b838963594b87293cbbac829d Mon Sep 17 00:00:00 2001 From: Arky <hitmanarky@gmail.com> Date: Tue, 17 Jul 2018 02:04:58 +0700 Subject: [PATCH 180/374] Adding 'no-cache-dir' extra argumuments Perhaps using no-cache-dir will preview out-of-memory errors on Raspberry Pi. Fixes #908 --- roles/kolibri/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml index f0083d067..d2921a38a 100644 --- a/roles/kolibri/tasks/main.yml +++ b/roles/kolibri/tasks/main.yml @@ -23,6 +23,7 @@ pip: name: kolibri state: latest + extra_args: --no-cache-dir when: internet_available - name: Create kolibri systemd service file From 2f31228a6f5d200753985f0cc1dadfa5c5de64b8 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 16:19:18 -0400 Subject: [PATCH 181/374] Update main.yml --- roles/kolibri/tasks/main.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml index d2921a38a..3188acaad 100644 --- a/roles/kolibri/tasks/main.yml +++ b/roles/kolibri/tasks/main.yml @@ -17,7 +17,7 @@ mode: 0755 state: directory with_items: - - "{{ kolibri_home }}" + - "{{ kolibri_home }}" - name: Install kolibri using pip on all OS's pip: @@ -59,20 +59,16 @@ - name: Enable kolibri service service: - name: "{{ item.name }}" + name: kolibri enabled: yes state: restarted - with_items: - - { name: kolibri } when: kolibri_enabled - name: Disable kolibri service service: - name: "{{ item.name }}" + name: kolibri enabled: no state: stopped - with_items: - - { name: kolibri } when: not kolibri_enabled - name: Add 'kolibri' to list of services at /etc/iiab/iiab.ini From 231717c1f315277b04704b3b49f99737dfd31b57 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 16:23:07 -0400 Subject: [PATCH 182/374] Update main.yml --- roles/kolibri/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml index 3188acaad..7e2580ceb 100644 --- a/roles/kolibri/tasks/main.yml +++ b/roles/kolibri/tasks/main.yml @@ -2,8 +2,8 @@ user: name: "{{ kolibri_user }}" groups: - - "{{ apache_user }}" - - disk + - "{{ apache_user }}" + - disk state: present shell: /bin/false system: yes @@ -34,7 +34,7 @@ owner: root group: root with_items: - - { src: 'kolibri.service.j2' , dest: '/etc/systemd/system/kolibri.service', mode: '0644' } + - { src: 'kolibri.service.j2', dest: '/etc/systemd/system/kolibri.service', mode: '0644' } - name: Set kolibri default language shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" language setdefault "{{ kolibri_language }}" From bed75d8c453ff48b81d884a71de90c6610de99d6 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 16:51:39 -0400 Subject: [PATCH 183/374] Update udev.yml --- roles/2-common/tasks/udev.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/2-common/tasks/udev.yml b/roles/2-common/tasks/udev.yml index c5ed659a1..d6b58eed4 100644 --- a/roles/2-common/tasks/udev.yml +++ b/roles/2-common/tasks/udev.yml @@ -26,6 +26,12 @@ shell: systemctl daemon-reload when: udev_unit.stat.exists is defined and udev_unit.stat.exists +# ubuntu 16.04 comes with ansible 2.0.0.2 -- no systemd module +- name: Ask systemd to recognize the changes (daemon-reloard) + systemd: + daemon_reload: yes + when: udev_unit.stat.exists is defined and udev_unit.stat.exists + - name: Restart so systemd recognizes the changes shell: systemctl restart systemd-udevd.service when: udev_unit.stat.exists is defined and udev_unit.stat.exists From eb11d85ad48cc83d4980221876da28c3cfa4dd17 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 16:53:19 -0400 Subject: [PATCH 184/374] Update main.yml --- roles/kalite/tasks/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index 1cbbdfa5a..06201da87 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -23,8 +23,9 @@ - include_tasks: install.yml when: kalite_installed is defined and not kalite_installed.stat.exists and not is_F18 -- name: Ask systemd to reread the unit files - shell: systemctl daemon-reload +- name: Ask systemd to reread the unit files (daemon-reload) + systemd: + daemon_reload: yes when: not kalite_installed.stat.exists - include_tasks: setup-f18.yml From 25ab293776c8251879a72ce0d8ae1b3b2422fdf0 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 16:54:20 -0400 Subject: [PATCH 185/374] Update udev.yml --- roles/2-common/tasks/udev.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/roles/2-common/tasks/udev.yml b/roles/2-common/tasks/udev.yml index d6b58eed4..2944518ec 100644 --- a/roles/2-common/tasks/udev.yml +++ b/roles/2-common/tasks/udev.yml @@ -22,12 +22,7 @@ when: udev_unit.stat.exists is defined and udev_unit.stat.exists # ubuntu 16.04 comes with ansible 2.0.0.2 -- no systemd module -- name: Ask systemd to recognize the changes - shell: systemctl daemon-reload - when: udev_unit.stat.exists is defined and udev_unit.stat.exists - -# ubuntu 16.04 comes with ansible 2.0.0.2 -- no systemd module -- name: Ask systemd to recognize the changes (daemon-reloard) +- name: Ask systemd to reread the unit files (daemon-reload) systemd: daemon_reload: yes when: udev_unit.stat.exists is defined and udev_unit.stat.exists From ee92bbb54f6f2c7885a8a7f855a85e8e07e7864f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 16:56:23 -0400 Subject: [PATCH 186/374] Update main.yml --- roles/kalite/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index 06201da87..6f8908d86 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -23,7 +23,7 @@ - include_tasks: install.yml when: kalite_installed is defined and not kalite_installed.stat.exists and not is_F18 -- name: Ask systemd to reread the unit files (daemon-reload) +- name: Ask systemd to reread unit files (daemon-reload) systemd: daemon_reload: yes when: not kalite_installed.stat.exists From abbd80c5fd7f9c2169c11b39ea70db40e35e767e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 16:56:42 -0400 Subject: [PATCH 187/374] Update udev.yml --- roles/2-common/tasks/udev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/2-common/tasks/udev.yml b/roles/2-common/tasks/udev.yml index 2944518ec..293280d6c 100644 --- a/roles/2-common/tasks/udev.yml +++ b/roles/2-common/tasks/udev.yml @@ -22,7 +22,7 @@ when: udev_unit.stat.exists is defined and udev_unit.stat.exists # ubuntu 16.04 comes with ansible 2.0.0.2 -- no systemd module -- name: Ask systemd to reread the unit files (daemon-reload) +- name: Ask systemd to reread unit files (daemon-reload) systemd: daemon_reload: yes when: udev_unit.stat.exists is defined and udev_unit.stat.exists From 787ac3bbe9af5ab4907c2db4650b65da42e48348 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 16 Jul 2018 16:57:11 -0400 Subject: [PATCH 188/374] Update main.yml --- roles/kolibri/tasks/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml index d2921a38a..6e43cc631 100644 --- a/roles/kolibri/tasks/main.yml +++ b/roles/kolibri/tasks/main.yml @@ -26,7 +26,7 @@ extra_args: --no-cache-dir when: internet_available -- name: Create kolibri systemd service file +- name: Create kolibri systemd service unit file template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -34,7 +34,11 @@ owner: root group: root with_items: - - { src: 'kolibri.service.j2' , dest: '/etc/systemd/system/kolibri.service', mode: '0644' } + - { src: 'kolibri.service.j2', dest: '/etc/systemd/system/kolibri.service', mode: '0644' } + +- name: Ask systemd to reread unit files (daemon-reload) + systemd: + daemon_reload: yes - name: Set kolibri default language shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" language setdefault "{{ kolibri_language }}" From 16e2cccec37d1c55e91b37f2305cbb1ea98c14f3 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:05:49 -0400 Subject: [PATCH 189/374] Update iiab-gen-iptables --- roles/network/templates/gateway/iiab-gen-iptables | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/network/templates/gateway/iiab-gen-iptables b/roles/network/templates/gateway/iiab-gen-iptables index 0e456dab1..9130b6e49 100755 --- a/roles/network/templates/gateway/iiab-gen-iptables +++ b/roles/network/templates/gateway/iiab-gen-iptables @@ -57,6 +57,7 @@ services_externally_visible={{ services_externally_visible }} calibre_port={{ calibre_port }} kiwix_port={{ kiwix_port }} kalite_server_port={{ kalite_server_port }} +kolibri_port={{ kolibri_port }} sugarizer_port={{ sugarizer_port }} block_DNS={{ block_DNS }} captive_portal_enabled={{ captive_portal_enabled }} @@ -90,6 +91,7 @@ fi if [ "$services_externally_visible" == "True" ]; then $IPTABLES -A INPUT -p tcp --dport $kiwix_port -m state --state NEW -i $wan -j ACCEPT $IPTABLES -A INPUT -p tcp --dport $kalite_server_port -m state --state NEW -i $wan -j ACCEPT + $IPTABLES -A INPUT -p tcp --dport $kolibri_server_port -m state --state NEW -i $wan -j ACCEPT $IPTABLES -A INPUT -p tcp --dport $calibre_port -m state --state NEW -i $wan -j ACCEPT $IPTABLES -A INPUT -p tcp --dport $sugarizer_port -m state --state NEW -i $wan -j ACCEPT fi From 3c031c88a3d048c2866bf03d8212e3306bf2aecb Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:10:37 -0400 Subject: [PATCH 190/374] Update iiab-gen-iptables --- roles/network/templates/gateway/iiab-gen-iptables | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/network/templates/gateway/iiab-gen-iptables b/roles/network/templates/gateway/iiab-gen-iptables index 9130b6e49..b3ce923b2 100755 --- a/roles/network/templates/gateway/iiab-gen-iptables +++ b/roles/network/templates/gateway/iiab-gen-iptables @@ -57,7 +57,7 @@ services_externally_visible={{ services_externally_visible }} calibre_port={{ calibre_port }} kiwix_port={{ kiwix_port }} kalite_server_port={{ kalite_server_port }} -kolibri_port={{ kolibri_port }} +kolibri_http_port={{ kolibri_http_port }} sugarizer_port={{ sugarizer_port }} block_DNS={{ block_DNS }} captive_portal_enabled={{ captive_portal_enabled }} @@ -91,7 +91,7 @@ fi if [ "$services_externally_visible" == "True" ]; then $IPTABLES -A INPUT -p tcp --dport $kiwix_port -m state --state NEW -i $wan -j ACCEPT $IPTABLES -A INPUT -p tcp --dport $kalite_server_port -m state --state NEW -i $wan -j ACCEPT - $IPTABLES -A INPUT -p tcp --dport $kolibri_server_port -m state --state NEW -i $wan -j ACCEPT + $IPTABLES -A INPUT -p tcp --dport $kolibri_http_port -m state --state NEW -i $wan -j ACCEPT $IPTABLES -A INPUT -p tcp --dport $calibre_port -m state --state NEW -i $wan -j ACCEPT $IPTABLES -A INPUT -p tcp --dport $sugarizer_port -m state --state NEW -i $wan -j ACCEPT fi From eaf878e08f2f0065b2fbd932663b7de501ec255c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:11:46 -0400 Subject: [PATCH 191/374] Update default_vars.yml --- vars/default_vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 05cc37f58..ce69cc687 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -316,6 +316,7 @@ kalite_password: kalite # Kolibri kolibri_install: False kolibri_enabled: False +kolibri_http_port: 8009 # Kiwix kiwix_install: True From d473921cb759229ce571ce914d37a50cc16c3fff Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:12:24 -0400 Subject: [PATCH 192/374] Update local_vars_min.yml --- vars/local_vars_min.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index 6ca4dcb05..812e6d0a5 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -172,6 +172,7 @@ kalite_cron_enabled: True kolibri_install: False kolibri_enabled: False +kolibri_http_port: 8009 kiwix_install: True kiwix_enabled: True From 60ceb2f1957d2679b9717e5f073f11c241ab75d8 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:16:44 -0400 Subject: [PATCH 193/374] Update local_vars_min.yml --- vars/local_vars_min.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index 812e6d0a5..6ca4dcb05 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -172,7 +172,6 @@ kalite_cron_enabled: True kolibri_install: False kolibri_enabled: False -kolibri_http_port: 8009 kiwix_install: True kiwix_enabled: True From be2a9eb1ac67287c03a484f5a14c154a6f845d54 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:23:43 -0400 Subject: [PATCH 194/374] Update iiab-gen-iptables --- roles/network/templates/gateway/iiab-gen-iptables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/templates/gateway/iiab-gen-iptables b/roles/network/templates/gateway/iiab-gen-iptables index b3ce923b2..812fe1b39 100755 --- a/roles/network/templates/gateway/iiab-gen-iptables +++ b/roles/network/templates/gateway/iiab-gen-iptables @@ -63,7 +63,7 @@ block_DNS={{ block_DNS }} captive_portal_enabled={{ captive_portal_enabled }} py_captive_portal_enabled={{ py_captive_portal_enabled }} -echo "Lan is $lan and WAN is $wan" +echo "LAN is $lan and WAN is $wan" # # delete all existing rules. # From 44c1c0293ad88c45368ec3c36ef9661d680ba520 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:41:51 -0400 Subject: [PATCH 195/374] Update restart.yml --- roles/network/tasks/restart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/tasks/restart.yml b/roles/network/tasks/restart.yml index 30aa4b307..6a60ec235 100644 --- a/roles/network/tasks/restart.yml +++ b/roles/network/tasks/restart.yml @@ -1,4 +1,4 @@ -- name: restart hostapd when wifi is present +- name: Restart hostapd when WiFi is present systemd: name: hostapd state: restarted From 7790fd6624c5d8212761854c5e186f2475788d18 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:48:19 -0400 Subject: [PATCH 196/374] Update ifcfg_mods.yml --- roles/network/tasks/ifcfg_mods.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/roles/network/tasks/ifcfg_mods.yml b/roles/network/tasks/ifcfg_mods.yml index b5a3f5f9c..ce47f5133 100644 --- a/roles/network/tasks/ifcfg_mods.yml +++ b/roles/network/tasks/ifcfg_mods.yml @@ -26,16 +26,22 @@ with_items: - "{{ discovered_lan_iface }}" -- name: bind may be affected - service: name={{ dns_service }} state=stopped +- name: BIND may be affected + service: + name: "{{ dns_service }}" + state: stopped when: named_install and dnsmasq_enabled - name: dhcpd_server may be affected - stopping dhcpd - service: name=dhcpd state=stopped + service: + name: dhcpd + state: stopped when: dhcpd_install - name: dhcpd_server may be affected - stopping dnsmasq - service: name=dnsmasq state=stopped + service: + name: dnsmasq + state: stopped when: dnsmasq_install - name: Stop the LAN/Bridge deleting iiab-LAN @@ -65,15 +71,17 @@ # can be more than one wired interface - name: Wired enslaving ## lan_list_result ## to Bridge - template: src=network/ifcfg-slave.j2 - dest=/etc/sysconfig/network-scripts/ifcfg-{{ item|trim }} + template: + src: network/ifcfg-slave.j2 + dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item|trim }}" when: iiab_lan_iface == "br0" and item|trim != iiab_wireless_lan_iface and item|trim != iiab_wan_iface with_items: - - "{{ lan_list_result.stdout_lines }}" + - "{{ lan_list_result.stdout_lines }}" - name: WiFi enslaving {{ iiab_wireless_lan_iface }} to Bridge - template: src=network/wifi-slave.j2 - dest=/etc/sysconfig/network-scripts/ifcfg-{{ iiab_wireless_lan_iface }} + template: + src: network/wifi-slave.j2 + dest: "/etc/sysconfig/network-scripts/ifcfg-{{ iiab_wireless_lan_iface }}" when: iiab_lan_iface == "br0" and iiab_wireless_lan_iface != "none" tags: - network @@ -81,7 +89,7 @@ - include_tasks: enable_wan.yml when: not installing and not iiab_demo_mode -- name: ask systemd to reread the unit files, picks up changes done +- name: Ask systemd to reread the unit files, picks up changes done systemd: daemon_reload: yes when: not installing @@ -111,7 +119,7 @@ ignore_errors: True when: iiab_lan_iface == "br0" and item|trim != iiab_wireless_lan_iface and item|trim != iiab_wan_iface and not iiab_demo_mode with_items: - - "{{ lan_list_result.stdout_lines }}" + - "{{ lan_list_result.stdout_lines }}" #- name: restart hostapd when wifi is present # service: name=hostapd state=started From 74dca68882e22be3019e6547f9d75a52fd204e49 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:49:14 -0400 Subject: [PATCH 197/374] Update down-debian.yml --- roles/network/tasks/down-debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/tasks/down-debian.yml b/roles/network/tasks/down-debian.yml index 393d7fd4e..c5954a72a 100644 --- a/roles/network/tasks/down-debian.yml +++ b/roles/network/tasks/down-debian.yml @@ -5,7 +5,7 @@ # dest: /etc/resolvconf.conf # src: network/resolvconf.j2 -- name: bind may be affected +- name: BIND may be affected service: name: "{{ dns_service }}" state: stopped From 0247ee1930ad498d5d77011b4d8283645c77faad Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:54:14 -0400 Subject: [PATCH 198/374] Update debian.yml --- roles/network/tasks/debian.yml | 64 +++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/roles/network/tasks/debian.yml b/roles/network/tasks/debian.yml index 4ec38b22a..10ec29312 100644 --- a/roles/network/tasks/debian.yml +++ b/roles/network/tasks/debian.yml @@ -21,52 +21,64 @@ # state=present - name: For upgrades from earlier IIAB 6.2, remove br0 file - file: path=/etc/network/interfaces.d/br0 - state=absent + file: + path: /etc/network/interfaces.d/br0 + state: absent when: iiab_lan_iface != "br0" and wan_ip == "dhcp" - name: Supply resolvconf.conf - template: dest=/etc/resolvconf.conf - src=network/resolvconf.j2 + template: + dest: /etc/resolvconf.conf + src: network/resolvconf.j2 - name: Supply dhcpcd.conf - template: dest=/etc/dhcpcd.conf - src=network/dhcpcd.conf.j2 + template: + dest: /etc/dhcpcd.conf + src: network/dhcpcd.conf.j2 when: dhcpcd_result == "enabled" - name: Copy the bridge script - template: dest=/etc/network/interfaces.d/iiab - src=network/systemd.j2 + template: + dest: /etc/network/interfaces.d/iiab + src: network/systemd.j2 when: not is_rpi and (iiab_lan_iface == "br0" or wan_ip != "dhcp" or gui_static_wan_ip == "undefined") - name: Copy the bridge script for RPi - template: dest=/etc/network/interfaces.d/iiab - src=network/rpi.j2 + template: + dest: /etc/network/interfaces.d/iiab + src: network/rpi.j2 when: is_rpi and iiab_lan_iface == "br0" -- name: Workaround auto issue on Debian-9 - template: dest=/etc/network/interfaces.d/patch_auto - src=network/debian-auto.j2 +- name: Workaround auto issue (debian-9) + template: + dest: /etc/network/interfaces.d/patch_auto + src: network/debian-auto.j2 when: iiab_wan_iface != "none" and is_debian_9 -- name: Clearing out /etc/network/interfaces for static addresses (is_debian_9) +- name: Clearing out /etc/network/interfaces for static addresses (debian-9) lineinfile: - state: absent - path: /etc/network/interfaces - regexp: "{{ iiab_wan_iface }}" + state: absent + path: /etc/network/interfaces + regexp: "{{ iiab_wan_iface }}" when: wan_ip != "dhcp" and iiab_wan_iface != "none" and is_debian_9 -- name: bind may be affected - service: name={{ dns_service }} state=stopped +- name: BIND may be affected + service: + name: "{{ dns_service }}" + state: stopped when: named_install and dnsmasq_enabled # dhcpd_server release the interface - name: dhcpd_server may be affected - stopping dhcpd - service: name=dhcpd state=stopped + service: + name: dhcpd + state: stopped when: dhcpd_install -- name: dhcpd_server may be affected - stopping dnsmasq - service: name=dnsmasq state=stopped +- name: dnsmasq may be affected - stopping dnsmasq + service: + name: dnsmasq + state: stopped when: dnsmasq_install - name: Reload systemd @@ -75,9 +87,13 @@ # now pick up denyinterfaces - name: Restart dhcpcd - service: name=dhcpcd state=restarted + service: + name: dhcpcd + state: restarted when: dhcpcd_result == "enabled" - name: Restart the networking service - service: name=networking state=restarted + service: + name: networking + state: restarted when: not nobridge is defined and not no_net_restart From b3dbf16a2757a88fed2fcf5b85f9c5bf6ba94d78 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:56:14 -0400 Subject: [PATCH 199/374] Update ifcfg_mods.yml --- roles/network/tasks/ifcfg_mods.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/network/tasks/ifcfg_mods.yml b/roles/network/tasks/ifcfg_mods.yml index ce47f5133..444f3241f 100644 --- a/roles/network/tasks/ifcfg_mods.yml +++ b/roles/network/tasks/ifcfg_mods.yml @@ -65,8 +65,9 @@ # when: iiab_wan_iface != "none" and not has_WAN and has_ifcfg_gw == "none" and xo_model == "none" and not iiab_demo_mode - name: Configuring LAN interface as iiab_lan_iface - template: src=network/ifcfg.j2 - dest=/etc/sysconfig/network-scripts/ifcfg-LAN + template: + src: network/ifcfg.j2 + dest: /etc/sysconfig/network-scripts/ifcfg-LAN when: iiab_lan_iface != "none" # can be more than one wired interface From 51611524328200170a49e94750e43250f563b480 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 01:57:12 -0400 Subject: [PATCH 200/374] Update debian.yml --- roles/network/tasks/debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/tasks/debian.yml b/roles/network/tasks/debian.yml index 10ec29312..f8222eee7 100644 --- a/roles/network/tasks/debian.yml +++ b/roles/network/tasks/debian.yml @@ -75,7 +75,7 @@ state: stopped when: dhcpd_install -- name: dnsmasq may be affected - stopping dnsmasq +- name: dhcpd_server may be affected - stopping dnsmasq service: name: dnsmasq state: stopped From 1d128593eeec0723471ec426e481d575549816f1 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 02:01:01 -0400 Subject: [PATCH 201/374] Update debian.yml --- roles/network/tasks/debian.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/network/tasks/debian.yml b/roles/network/tasks/debian.yml index f8222eee7..9eeddb4f6 100644 --- a/roles/network/tasks/debian.yml +++ b/roles/network/tasks/debian.yml @@ -71,8 +71,8 @@ # dhcpd_server release the interface - name: dhcpd_server may be affected - stopping dhcpd service: - name: dhcpd - state: stopped + name: dhcpd + state: stopped when: dhcpd_install - name: dhcpd_server may be affected - stopping dnsmasq From 8a46b11eece3235d5f64b36cd9a9322fad9cc98c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 12:08:50 -0400 Subject: [PATCH 202/374] Update kolibri.service.j2 --- roles/kolibri/templates/kolibri.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kolibri/templates/kolibri.service.j2 b/roles/kolibri/templates/kolibri.service.j2 index ef420c4a1..0b230f7d1 100644 --- a/roles/kolibri/templates/kolibri.service.j2 +++ b/roles/kolibri/templates/kolibri.service.j2 @@ -2,7 +2,7 @@ Description=Kolibri [Service] -Type=oneshot +Type=forking RemainAfterExit=yes Environment=KOLIBRI_USER={{ kolibri_user }} Environment=KOLIBRI_HOME={{ kolibri_home }} From 9c7aaaca7a5f649b77826851af4db8377547fce9 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 12:45:46 -0400 Subject: [PATCH 203/374] Update main.yml --- roles/mongodb/defaults/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/mongodb/defaults/main.yml b/roles/mongodb/defaults/main.yml index 2553868fb..6b5e4f357 100644 --- a/roles/mongodb/defaults/main.yml +++ b/roles/mongodb/defaults/main.yml @@ -1,2 +1,4 @@ mongodb_install: False mongodb_enabled: False + +mongodb_db_path: {{ content_base }}/dbdata/mongodb # /library/dbdata/mongodb/ From 1a6d3dd8fd574f32feb69601fe8cd7db1d583b49 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 12:50:52 -0400 Subject: [PATCH 204/374] Update main.yml --- roles/mongodb/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 5ba9a9d83..edf0fed17 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -16,7 +16,7 @@ owner: mongodb with_items: - { path: '/var/run/mongodb' } - - { path: '/library/dbdata/mongodb' } + - { path: "{{ mongodb_db_path }}" } - { path: '/var/log/mongodb' } - name: Position /etc/mongod.conf and mongodb.service From 4e0fc10017c97c92055c17461478825efb430240 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 12:51:55 -0400 Subject: [PATCH 205/374] Update mongodb.service --- roles/mongodb/templates/mongodb.service | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/mongodb/templates/mongodb.service b/roles/mongodb/templates/mongodb.service index 40f4f573f..1cfc98b05 100644 --- a/roles/mongodb/templates/mongodb.service +++ b/roles/mongodb/templates/mongodb.service @@ -6,7 +6,9 @@ After=syslog.target network.target Type=simple User=mongodb Group=mongodb +ExecStartPre=/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} ExecStart=/usr/bin/mongod -f /etc/mongod.conf +ExecStop=/usr/bin/killall mongod [Install] WantedBy=multi-user.target From 77416f4d528104ce443589b7c39e9687062759a4 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 12:55:25 -0400 Subject: [PATCH 206/374] Update main.yml --- roles/mongodb/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index edf0fed17..4bc7653f8 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -19,7 +19,7 @@ - { path: "{{ mongodb_db_path }}" } - { path: '/var/log/mongodb' } -- name: Position /etc/mongod.conf and mongodb.service +- name: Populate & position /etc/mongod.conf, /etc/systemd/system/mongodb.service template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -27,8 +27,8 @@ group: root mode: 0644 with_items: - - { src: 'mongodb.service' , dest: '/etc/systemd/system/' } - - { src: 'mongod.conf' , dest: '/etc/mongod.conf'} + - { src: 'mongodb.service.j2' , dest: '/etc/systemd/system/' } + - { src: 'mongod.conf.j2' , dest: '/etc/mongod.conf'} - name: Restart service if enabled service: From 1c3498603d20d07238d1a88b64f75431b86e6d9a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 12:57:17 -0400 Subject: [PATCH 207/374] Update and rename mongod.conf to mongod.conf.j2 --- roles/mongodb/templates/{mongod.conf => mongod.conf.j2} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename roles/mongodb/templates/{mongod.conf => mongod.conf.j2} (99%) diff --git a/roles/mongodb/templates/mongod.conf b/roles/mongodb/templates/mongod.conf.j2 similarity index 99% rename from roles/mongodb/templates/mongod.conf rename to roles/mongodb/templates/mongod.conf.j2 index 478375a5e..f8b3f1497 100644 --- a/roles/mongodb/templates/mongod.conf +++ b/roles/mongodb/templates/mongod.conf.j2 @@ -21,7 +21,7 @@ logpath = /var/log/mongodb/mongod.log # unixSocketPrefix = /var/run/mongodb # Directory for datafiles (defaults to /data/db/) -dbpath = /library/dbdata/mongodb +dbpath = {{ mongodb_db_path }} # Enable/Disable journaling (journaling is on by default for 64 bit) journal = true @@ -234,4 +234,3 @@ smallfiles = true # Activate FIPS 140-2 mode at startup #sslFIPSMode = true - From 639bb43f92fd6befdb2f151e672480d942578aa5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 12:57:35 -0400 Subject: [PATCH 208/374] Rename mongodb.service to mongodb.service.j2 --- roles/mongodb/templates/{mongodb.service => mongodb.service.j2} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename roles/mongodb/templates/{mongodb.service => mongodb.service.j2} (100%) diff --git a/roles/mongodb/templates/mongodb.service b/roles/mongodb/templates/mongodb.service.j2 similarity index 100% rename from roles/mongodb/templates/mongodb.service rename to roles/mongodb/templates/mongodb.service.j2 From 4cdcda9438b3280cc50a33ab966d36f413085796 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 13:11:14 -0400 Subject: [PATCH 209/374] Update main.yml --- roles/mongodb/defaults/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/mongodb/defaults/main.yml b/roles/mongodb/defaults/main.yml index 6b5e4f357..86f699596 100644 --- a/roles/mongodb/defaults/main.yml +++ b/roles/mongodb/defaults/main.yml @@ -2,3 +2,4 @@ mongodb_install: False mongodb_enabled: False mongodb_db_path: {{ content_base }}/dbdata/mongodb # /library/dbdata/mongodb/ +mongodb_conf: /etc/mongod.conf From db9d9be955d11ddffb0e62da46a7416a0594b887 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 13:12:37 -0400 Subject: [PATCH 210/374] Update main.yml --- roles/mongodb/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 4bc7653f8..49230c5ac 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -27,8 +27,8 @@ group: root mode: 0644 with_items: - - { src: 'mongodb.service.j2' , dest: '/etc/systemd/system/' } - - { src: 'mongod.conf.j2' , dest: '/etc/mongod.conf'} + - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/' } + - { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" } - name: Restart service if enabled service: From b35b612c5281fad1e464fb9682e2e061aa368d1a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 13:15:04 -0400 Subject: [PATCH 211/374] Update mongodb.service.j2 --- roles/mongodb/templates/mongodb.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/templates/mongodb.service.j2 b/roles/mongodb/templates/mongodb.service.j2 index 1cfc98b05..4407efddc 100644 --- a/roles/mongodb/templates/mongodb.service.j2 +++ b/roles/mongodb/templates/mongodb.service.j2 @@ -7,7 +7,7 @@ Type=simple User=mongodb Group=mongodb ExecStartPre=/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} -ExecStart=/usr/bin/mongod -f /etc/mongod.conf +ExecStart=/usr/bin/mongod -f {{ mongodb_conf }} ExecStop=/usr/bin/killall mongod [Install] From 21dd6ab03f7ed2b7ee9abe31b548bd7ffc5db90d Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 13:15:52 -0400 Subject: [PATCH 212/374] Update main.yml --- roles/mongodb/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/defaults/main.yml b/roles/mongodb/defaults/main.yml index 86f699596..5dfc8d4df 100644 --- a/roles/mongodb/defaults/main.yml +++ b/roles/mongodb/defaults/main.yml @@ -1,5 +1,5 @@ mongodb_install: False mongodb_enabled: False -mongodb_db_path: {{ content_base }}/dbdata/mongodb # /library/dbdata/mongodb/ +mongodb_db_path: {{ content_base }}/dbdata/mongodb # == /library/dbdata/mongodb/ mongodb_conf: /etc/mongod.conf From a1a3b4f6778a63777f8e34705fe98509d4e7c565 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 13:19:40 -0400 Subject: [PATCH 213/374] Update main.yml --- roles/mongodb/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/defaults/main.yml b/roles/mongodb/defaults/main.yml index 5dfc8d4df..6aed9834a 100644 --- a/roles/mongodb/defaults/main.yml +++ b/roles/mongodb/defaults/main.yml @@ -1,5 +1,5 @@ mongodb_install: False mongodb_enabled: False -mongodb_db_path: {{ content_base }}/dbdata/mongodb # == /library/dbdata/mongodb/ +mongodb_db_path: "{{ content_base }}/dbdata/mongodb" # == /library/dbdata/mongodb/ mongodb_conf: /etc/mongod.conf From 0f1346aa8eae2413915b278da2c5b1ce9f881e75 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 13:29:45 -0400 Subject: [PATCH 214/374] Update main.yml --- roles/mongodb/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 49230c5ac..0bd2fa5a6 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -27,7 +27,7 @@ group: root mode: 0644 with_items: - - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/' } + - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' } - { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" } - name: Restart service if enabled From 0a58c34000698b007d135e51c82a9dd8c4a8c296 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 15:06:14 -0400 Subject: [PATCH 215/374] Update main.yml --- roles/moodle/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index 8226ad1ff..adee4c320 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -22,7 +22,7 @@ - php{{ php_version }}-cli when: is_debuntu -- name: php-zip name (debian_9 or ubuntu) +- name: php-zip name (debian-9 or ubuntu) package: name: "php{{ php_version }}-zip" when: is_debian_9 or is_ubuntu From edb0526190d5a870f3dbbc909ef8ded1a2094dae Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 15:07:28 -0400 Subject: [PATCH 216/374] Update main.yml --- roles/moodle/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index adee4c320..7374ae31e 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -27,7 +27,7 @@ name: "php{{ php_version }}-zip" when: is_debian_9 or is_ubuntu -- name: php-zip name for (debian_8) +- name: php-zip name for (debian-8) package: name: php-pclzip when: is_debian_8 From 334f2f22c71ad0ec50a98e2f216950f950667168 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 15:07:39 -0400 Subject: [PATCH 217/374] Update main.yml --- roles/mysql/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 02f879cd1..3fad2b357 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -19,13 +19,13 @@ tags: - download - - name: php-xml (ubuntu or debian_9) + - name: php-xml (ubuntu or debian-9) package: name: "php{{ php_version }}-xml" state: present when: is_ubuntu or is_debian_9 - - name: php-xml (debian_8) + - name: php-xml (debian-8) package: name: "php-xml-parser" state: present From 50b792869d65114daccfc77ab290b16295e207a2 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 17 Jul 2018 15:09:23 -0400 Subject: [PATCH 218/374] Update packages.yml --- roles/2-common/tasks/packages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index fdb840965..f64c25936 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -14,14 +14,14 @@ - avahi-tools when: is_redhat -- name: Download usbmount -- not in Debian Stretch (debian_9) +- name: Download usbmount -- not in Debian Stretch (debian-9) get_url: url: "{{ iiab_download_url }}/usbmount_0.0.14.1_all.deb" dest: "{{ downloads_dir }}" timeout: "{{ download_timeout }}" when: internet_available and is_debian_9 -- name: Install usbmount (debian_9) +- name: Install usbmount (debian-9) command: apt install -y {{ downloads_dir }}/usbmount_0.0.14.1_all.deb when: is_debian_9 From 2040142ed2069eea50a3131e571a94f796e8d411 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 17:41:38 -0400 Subject: [PATCH 219/374] Update main.yml --- roles/httpd/tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 848a42fa2..a57c9af64 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -169,6 +169,10 @@ tags: - base +- include_tasks: php-stem.yml + tags: + - base + - name: Place the script to generate homepages template: src: refresh-wiki-docs.sh From 6ab5bf0618e5978bca510165274460f6e953c8d5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 17:49:09 -0400 Subject: [PATCH 220/374] Update main.yml --- roles/homepage/tasks/main.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/roles/homepage/tasks/main.yml b/roles/homepage/tasks/main.yml index 91b570df5..f88503082 100644 --- a/roles/homepage/tasks/main.yml +++ b/roles/homepage/tasks/main.yml @@ -1,16 +1,19 @@ - name: Create home directory - file: path={{ doc_root }}/home - mode=0755 - owner={{ apache_user }} - group={{ apache_user }} - state=directory + file: + path: "{{ doc_root }}/home" + owner: "{{ apache_user }}" + group: "{{ apache_user }}" + mode: 0755 + state: directory - name: Install admin homepage into apache2 - template: src=iiab-homepage.conf - dest=/etc/{{ apache_config_dir }}/iiab-homepage.conf + template: + src: iiab-homepage.conf + dest: "/etc/{{ apache_config_dir }}/iiab-homepage.conf" - name: Enable the home page - file: src=/etc/{{ apache_config_dir }}/iiab-homepage.conf - dest=/etc/apache2/sites-enabled/iiab-homepage.conf - state=link + file: + src: "/etc/{{ apache_config_dir }}/iiab-homepage.conf" + dest: /etc/apache2/sites-enabled/iiab-homepage.conf + state: link when: is_debuntu From 8d64a3b50d75bea57602be1f5fef1d48531c01e6 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 17:57:09 -0400 Subject: [PATCH 221/374] Update main.yml --- roles/osm/tasks/main.yml | 155 ++++++++++++++++++++++----------------- 1 file changed, 87 insertions(+), 68 deletions(-) diff --git a/roles/osm/tasks/main.yml b/roles/osm/tasks/main.yml index 2789a2dd5..a0d34e321 100644 --- a/roles/osm/tasks/main.yml +++ b/roles/osm/tasks/main.yml @@ -1,6 +1,7 @@ - name: Install OSM required packages - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - gcc - python-dev @@ -10,8 +11,9 @@ when: is_debuntu - name: Install OSM required packages - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - python-pip - gcc @@ -23,26 +25,29 @@ # OSM wants a specific version do that first - name: Install Whoosh 2.6 - pip: name=whoosh - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - version=2.6 - extra_args="--no-cache-dir" + pip: + name=whoosh + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + version: 2.6 + extra_args: "--no-cache-dir" when: internet_available and is_debuntu - name: Install Flask 0.12X - pip: name=Flask - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - version=0.12.4 - extra_args="--no-cache-dir" + pip: + name: Flask + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + version: 0.12.4 + extra_args: "--no-cache-dir" when: internet_available and is_debuntu - name: Install OSM with dependencies - pip: name={{ item }} - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - extra_args="--no-cache-dir" + pip: + name: "{{ item }}" + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + extra_args: "--no-cache-dir" with_items: - MarkupSafe - pytz @@ -51,25 +56,28 @@ # OSM wants a specific version do that first - name: Install Whoosh 2.6 - pip: name=whoosh - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - version=2.6 + pip: + name: whoosh + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + version: 2.6 # extra_args="--no-cache-dir" when: internet_available and not is_debuntu - name: Install Flask 0.12X - pip: name=Flask - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - version=0.12.4 + pip: + name=Flask + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + version: 0.12.4 # extra_args="--no-cache-dir" when: internet_available and not is_debuntu - name: Install OSM with dependencies - pip: name={{ item }} - virtualenv={{ osm_venv }} - virtualenv_site_packages=no + pip: + name: "{{ item }}" + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no # extra_args="--no-cache-dir" with_items: - MarkupSafe @@ -79,79 +87,90 @@ - name: Set osm_path set_fact: - osm_path: "{{ osm_venv }}/{{ python_path }}/iiab" + osm_path: "{{ osm_venv }}/{{ python_path }}/iiab" when: osm_enabled and is_redhat - name: Set osm_path set_fact: - osm_path: "{{ osm_venv }}/lib/python2.7/site-packages/iiab" + osm_path: "{{ osm_venv }}/lib/python2.7/site-packages/iiab" when: osm_enabled and is_debuntu - name: Point wsgi to virtual environment (all OS's) - lineinfile: dest={{ osm_venv }}/bin/iiab.wsgi - regexp="path_to_virtualenv = None" - line="path_to_virtualenv = '/usr/local/osm'" - state=present + lineinfile: + dest: "{{ osm_venv }}/bin/iiab.wsgi" + regexp: "path_to_virtualenv = None" + line: "path_to_virtualenv = '/usr/local/osm'" + state: present - name: Copy OSM config file (all OS's) - template: backup=no - src=osm.conf.j2 - dest=/etc/{{ apache_config_dir }}/osm.conf - owner=root - group=root - mode=0644 + template: + src: osm.conf.j2 + dest: "/etc/{{ apache_config_dir }}/osm.conf" + owner: root + group: root + mode: 0644 + backup: no when: osm_enabled - name: Create a link from sites-enabled to sites-available (debuntu) - file: src=/etc/{{ apache_config_dir }}/osm.conf - dest=/etc/apache2/sites-enabled/osm.conf - state=link + file: + src: "/etc/{{ apache_config_dir }}/osm.conf" + dest: /etc/apache2/sites-enabled/osm.conf + state: link when: osm_enabled and is_debuntu - name: Remove the link from sites-enabled to sites-available (debuntu) - file: dest=/etc/apache2/sites-enabled/osm.conf - state=absent + file: + dest: /etc/apache2/sites-enabled/osm.conf + state: absent when: not osm_enabled and is_debuntu - name: Remove the osm.conf (redhat) - file: dest=/{{ apache_config_dir }}/osm.conf - state=absent + file: + dest: "/{{ apache_config_dir }}/osm.conf" + state: absent when: not osm_enabled and is_redhat - name: Remove link to cgi (all OS's) - file: dest={{ doc_root }}/osm.wsgi - state=absent + file: + dest: "{{ doc_root }}/osm.wsgi" + state: absent when: not osm_enabled - name: Create link to cgi (all OS's) - file: src={{ osm_venv }}/bin/iiab.wsgi - dest={{ doc_root }}/osm.wsgi - owner=root - group=root - state=link + file: + src: "{{ osm_venv }}/bin/iiab.wsgi" + dest: "{{ doc_root }}/osm.wsgi" + owner: root + group: root + state: link when: osm_enabled - name: Create the knowledge data set folders - file: path=/library/knowledge/modules - state=directory - owner={{ apache_user }} - group={{ apache_user }} + file: + path: /library/knowledge/modules + state: directory + owner: "{{ apache_user }}" + group: "{{ apache_user }}" # the following was brought into OSM playbook from iiab-factory osm-fix script - name: Copy the files - template: src={{ item.src }} dest={{ item.dest }} + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" with_items: - - { src: 'defaults.ini', dest: "{{ osm_path }}/" } - - { src: 'etc.iiab.conf', dest: '/etc/iiab.conf' } - - { src: 'map_search.py', dest: "{{ osm_path }}/map_search.py" } - - { src: 'map.html', dest: "{{ osm_path }}/static/map.html" } - - { src: 'l.control.geosearch.js', dest: "{{ osm_path }}/static/lib/leaflet/geosearch/l.control.geosearch.js" } - - { src: '{{ osm_path }}/static/map.html', dest: "{{ osm_path }}/static/index.html" } + - { src: 'defaults.ini', dest: "{{ osm_path }}/" } + - { src: 'etc.iiab.conf', dest: '/etc/iiab.conf' } + - { src: 'map_search.py', dest: "{{ osm_path }}/map_search.py" } + - { src: 'map.html', dest: "{{ osm_path }}/static/map.html" } + - { src: 'l.control.geosearch.js', dest: "{{ osm_path }}/static/lib/leaflet/geosearch/l.control.geosearch.js" } + - { src: "{{ osm_path }}/static/map.html", dest: "{{ osm_path }}/static/index.html" } when: osm_enabled - name: Restart httpd service - service: name={{ apache_service }} - state=restarted + service: + name: "{{ apache_service }}" + state: restarted - name: Add 'osm' to list of services at /etc/iiab/iiab.ini ini_file: From 5f13a94858c8278823525875a70d0f75925262b5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 18:02:55 -0400 Subject: [PATCH 222/374] Update main.yml --- roles/osm/tasks/main.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/roles/osm/tasks/main.yml b/roles/osm/tasks/main.yml index a0d34e321..a9ed97c62 100644 --- a/roles/osm/tasks/main.yml +++ b/roles/osm/tasks/main.yml @@ -1,4 +1,4 @@ -- name: Install OSM required packages +- name: Install OSM required packages (debuntu) package: name: "{{ item }}" state: present @@ -10,7 +10,7 @@ - libapache2-mod-xsendfile when: is_debuntu -- name: Install OSM required packages +- name: Install OSM required packages (not debuntu) package: name: "{{ item }}" state: present @@ -24,16 +24,16 @@ when: not is_debuntu # OSM wants a specific version do that first -- name: Install Whoosh 2.6 +- name: Install Whoosh 2.6 (debuntu) pip: - name=whoosh + name: whoosh virtualenv: "{{ osm_venv }}" virtualenv_site_packages: no version: 2.6 extra_args: "--no-cache-dir" when: internet_available and is_debuntu -- name: Install Flask 0.12X +- name: Install Flask 0.12X (debuntu) pip: name: Flask virtualenv: "{{ osm_venv }}" @@ -42,7 +42,7 @@ extra_args: "--no-cache-dir" when: internet_available and is_debuntu -- name: Install OSM with dependencies +- name: Install OSM with dependencies (debuntu) pip: name: "{{ item }}" virtualenv: "{{ osm_venv }}" @@ -55,7 +55,7 @@ when: internet_available and is_debuntu # OSM wants a specific version do that first -- name: Install Whoosh 2.6 +- name: Install Whoosh 2.6 (not debuntu) pip: name: whoosh virtualenv: "{{ osm_venv }}" @@ -64,16 +64,16 @@ # extra_args="--no-cache-dir" when: internet_available and not is_debuntu -- name: Install Flask 0.12X +- name: Install Flask 0.12X (not debuntu) pip: - name=Flask + name: Flask virtualenv: "{{ osm_venv }}" virtualenv_site_packages: no version: 0.12.4 # extra_args="--no-cache-dir" when: internet_available and not is_debuntu -- name: Install OSM with dependencies +- name: Install OSM with dependencies (not debuntu) pip: name: "{{ item }}" virtualenv: "{{ osm_venv }}" @@ -85,12 +85,12 @@ - Internet-in-a-Box when: internet_available and not is_debuntu -- name: Set osm_path +- name: Set osm_path (redhat) set_fact: osm_path: "{{ osm_venv }}/{{ python_path }}/iiab" when: osm_enabled and is_redhat -- name: Set osm_path +- name: Set osm_path (debuntu) set_fact: osm_path: "{{ osm_venv }}/lib/python2.7/site-packages/iiab" when: osm_enabled and is_debuntu From 60da9ef95a20150636f11c84d668597a869b7a42 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 18:07:53 -0400 Subject: [PATCH 223/374] Update main.yml --- roles/httpd/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index a57c9af64..2980760da 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -169,6 +169,7 @@ tags: - base +# So search works @ http://box/modules/es-wikihow - see https://github.com/iiab/iiab/issues/829 - include_tasks: php-stem.yml tags: - base From 7e9817679744203b9d8e9af0c131da6794c5e543 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 18:17:33 -0400 Subject: [PATCH 224/374] Create php-stem.yml --- roles/httpd/tasks/php-stem.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 roles/httpd/tasks/php-stem.yml diff --git a/roles/httpd/tasks/php-stem.yml b/roles/httpd/tasks/php-stem.yml new file mode 100644 index 000000000..782df336e --- /dev/null +++ b/roles/httpd/tasks/php-stem.yml @@ -0,0 +1,28 @@ +# Fixes search @ http://box/modules/es-wikihow - see https://github.com/iiab/iiab/issues/829 + +#- name: Download php-stem.rpi.tar +# command: cd /; wget http://download.iiab.io/packages/php-stem.rpi.tar +# when: is_rpi + +#- name: Download php-stem.x86.tar +# command: cd /; wget http://download.iiab.io/packages/php-stem.x64.tar +# when: not is_rpi + +- name: Download & unpack php-stem.rpi.tar to / (rpi) + unarchive: + src: http://download.iiab.io/packages/php-stem.rpi.tar + dest: / + remote_src: yes + when: is_rpi + +- name: Download & unpack php-stem.x86.tar to / (not rpi) + unarchive: + src: http://download.iiab.io/packages/php-stem.x64.tar + dest: / + remote_src: yes + when: not is_rpi + +- name: Restart Apache + service: + name: "{{ apache_service }}" + state: restarted From 95c46292f02337328b88c3bbd299645325faf3b5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 18:18:17 -0400 Subject: [PATCH 225/374] Update main.yml --- roles/httpd/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 2980760da..97417971d 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -169,7 +169,7 @@ tags: - base -# So search works @ http://box/modules/es-wikihow - see https://github.com/iiab/iiab/issues/829 +# Fixes search @ http://box/modules/es-wikihow - see https://github.com/iiab/iiab/issues/829 - include_tasks: php-stem.yml tags: - base From 8bd3ee999c26682495834dca25ed287e3c38ea18 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 18:26:36 -0400 Subject: [PATCH 226/374] Update php-stem.yml --- roles/httpd/tasks/php-stem.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/roles/httpd/tasks/php-stem.yml b/roles/httpd/tasks/php-stem.yml index 782df336e..115b4ece5 100644 --- a/roles/httpd/tasks/php-stem.yml +++ b/roles/httpd/tasks/php-stem.yml @@ -1,4 +1,7 @@ -# Fixes search @ http://box/modules/es-wikihow - see https://github.com/iiab/iiab/issues/829 +# Fixes search @ http://box/modules/es-wikihow (popular with Spanish youth) +# Source code: http://download.iiab.io/packages/php-stem.src.tar +# June 2018 debugging & compilation thanks to Tim Moody & George Hunt +# Original bug: https://github.com/iiab/iiab/issues/829 #- name: Download php-stem.rpi.tar # command: cd /; wget http://download.iiab.io/packages/php-stem.rpi.tar @@ -12,6 +15,9 @@ unarchive: src: http://download.iiab.io/packages/php-stem.rpi.tar dest: / + owner: root + group: root + #mode: ???? remote_src: yes when: is_rpi @@ -19,6 +25,9 @@ unarchive: src: http://download.iiab.io/packages/php-stem.x64.tar dest: / + owner: root + group: root + #mode: ???? remote_src: yes when: not is_rpi From 1459e6963b6b935286c40c03f67f1378b344cca1 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 18:31:35 -0400 Subject: [PATCH 227/374] Update php-stem.yml --- roles/httpd/tasks/php-stem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/tasks/php-stem.yml b/roles/httpd/tasks/php-stem.yml index 115b4ece5..2b2a8891a 100644 --- a/roles/httpd/tasks/php-stem.yml +++ b/roles/httpd/tasks/php-stem.yml @@ -31,7 +31,7 @@ remote_src: yes when: not is_rpi -- name: Restart Apache +- name: Restart apache2 / httpd service: name: "{{ apache_service }}" state: restarted From e52b8e5625aa3266a04eab5723684a3efc210a0e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 18:37:47 -0400 Subject: [PATCH 228/374] Update main.yml --- roles/httpd/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 97417971d..a62c9b955 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -174,7 +174,7 @@ tags: - base -- name: Place the script to generate homepages +- name: Install /usr/bin/refresh-wiki-docs.sh (scraper script) to create http://box/info offline documentation template: src: refresh-wiki-docs.sh dest: /usr/bin/iiab-refresh-wiki-docs From 0d64c88dd0a9cab23206a0307dc8169b5e1c9f61 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 18:42:16 -0400 Subject: [PATCH 229/374] No need to restart Aoache twice --- roles/httpd/tasks/php-stem.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/httpd/tasks/php-stem.yml b/roles/httpd/tasks/php-stem.yml index 2b2a8891a..191872775 100644 --- a/roles/httpd/tasks/php-stem.yml +++ b/roles/httpd/tasks/php-stem.yml @@ -31,7 +31,8 @@ remote_src: yes when: not is_rpi -- name: Restart apache2 / httpd - service: - name: "{{ apache_service }}" - state: restarted +# No need to do this twice? Happens later @ https://github.com/iiab/iiab/blob/master/roles/3-base-server/tasks/main.yml#L24-L28 +#- name: Restart apache2 / httpd +# service: +# name: "{{ apache_service }}" +# state: restarted From 91a325a5b7782485fade4b72205eb2bc9ea9f656 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 18:58:51 -0400 Subject: [PATCH 230/374] Update main.yml --- roles/httpd/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index a62c9b955..95c36bf0f 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -174,7 +174,7 @@ tags: - base -- name: Install /usr/bin/refresh-wiki-docs.sh (scraper script) to create http://box/info offline documentation +- name: Install /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation template: src: refresh-wiki-docs.sh dest: /usr/bin/iiab-refresh-wiki-docs From bd6324fe22fafce7f2db62359be167873ded0cd9 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 19:42:53 -0400 Subject: [PATCH 231/374] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 8afc057de..666485305 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -2,7 +2,7 @@ echo -e '\n\nSTRONGLY RECOMMENDED PREREQUISITE: (1) remove all prior versions of Ansible using "apt purge ansible" and/or "pip uninstall ansible" and (2) clear out all lines containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n' -echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirror.\n' +echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirrors.\n' echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n' From db7d956324528f76e49c22b7ba47042eccdfd3b1 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 19:43:11 -0400 Subject: [PATCH 232/374] 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 6e9c76daf..f8cf8b077 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -2,7 +2,7 @@ echo -e '\n\nSTRONGLY RECOMMENDED PREREQUISITE: (1) remove all prior versions of Ansible using "apt purge ansible" and/or "pip uninstall ansible" and (2) clear out all lines containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n' -echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirror.\n' +echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirrors.\n' echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n' From d42ac31e104fc564c305f313f2640e5a55482f3b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 20:34:57 -0400 Subject: [PATCH 233/374] Update main.yml --- roles/httpd/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 95c36bf0f..ba5543dc5 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -174,7 +174,7 @@ tags: - base -- name: Install /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation +- name: Install /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation (will be run at the end of Stage 4 = roles/4-server-options/tasks/main.yml) template: src: refresh-wiki-docs.sh dest: /usr/bin/iiab-refresh-wiki-docs From e6021a1f33eba94a70d5ecc6fda9786b34a513c5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 20:35:43 -0400 Subject: [PATCH 234/374] Update main.yml --- roles/4-server-options/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/4-server-options/tasks/main.yml b/roles/4-server-options/tasks/main.yml index edd787d28..fbe551818 100644 --- a/roles/4-server-options/tasks/main.yml +++ b/roles/4-server-options/tasks/main.yml @@ -85,7 +85,7 @@ src: roles/1-prep/templates/iiab_env.py.j2 dest: /etc/iiab/iiab_env.py -- name: Generate the offline documents +- name: Run /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation (script was installed at the beginning of Stage 3 = roles/3-base-server/tasks/main.yml, which runs the HTTPD playbook = roles/httpd/tasks/main.yml) command: /usr/bin/iiab-refresh-wiki-docs when: not nodocs From 2a58b8ec6e563ccb41ff8be1477667207a907494 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Wed, 18 Jul 2018 23:25:32 -0400 Subject: [PATCH 235/374] clarified 4 comments --- roles/usb-lib/tasks/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/usb-lib/tasks/main.yml b/roles/usb-lib/tasks/main.yml index 1f312b188..e146ecf90 100644 --- a/roles/usb-lib/tasks/main.yml +++ b/roles/usb-lib/tasks/main.yml @@ -26,7 +26,7 @@ - { src: 'iiab-usb-lib-show-all-on' , dest: '/usr/bin/', mode: '0755' } - { src: 'iiab-usb-lib-show-all-off' , dest: '/usr/bin/', mode: '0755' } -- name: Enable exfat and ntfs +- name: Enable exFAT and NTFS lineinfile: regexp: '^FILESYSTEMS.*' line: 'FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus exfat fuseblk ntfs"' @@ -53,7 +53,7 @@ state: absent when: not usb_lib_enabled -- name: Put a variable in iiab.env for display of content at root of USB +- name: Put variable in iiab.env that enables display of content at root of USB lineinfile: dest: /etc/iiab/iiab.env regexp: "^IIAB_USB_LIB_SHOW_ALL.*" @@ -65,14 +65,14 @@ dest: "/etc/{{ apache_config_dir }}" when: usb_lib_enabled -- name: Create the link to enable (debian) +- name: Create the link to enable (debuntu) file: src: "/etc/{{ apache_config_dir }}/content_dir.conf" dest: /etc/apache2/sites-enabled/content_dir.conf state: link when: is_debuntu -- name: Remove the link that enables (debian) +- name: Remove the link that enables (debuntu) file: src: "/etc/{{ apache_config_dir }}/content_dir.conf" dest: /etc/apache2/sites-enabled/content_dir.conf From 1a64b64d06f81c6805bfd0b5ed4aacc12405683b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 11:17:30 -0400 Subject: [PATCH 236/374] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index f45033497..764ea5eae 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -51,6 +51,7 @@ iiab_gateway_enabled: False dnsmasq_install: True dnsmasq_enabled: False +# Enable AFTER installing IIAB! Then run "cd /opt/iiab/iiab; ./iiab-network" dns_jail_enabled: False # Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 From 74a1c764f1655a71b27921f6dc4278952e643869 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 11:18:52 -0400 Subject: [PATCH 237/374] Update default_vars.yml --- vars/default_vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index ce69cc687..e430b13b3 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -109,6 +109,7 @@ block_DNS: False dnsmasq_install: True dnsmasq_enabled: False +# Enable AFTER installing IIAB! Then run "cd /opt/iiab/iiab; ./iiab-network" dns_jail_enabled: False # For @tim-moody's Nodogsplash approach to Captive Portal? High experimental as of June 2018: github.com/iiab/iiab/issues/608 From f71faeb3342b8537bb8387588f4478d73a8c4cd4 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 11:19:23 -0400 Subject: [PATCH 238/374] Update local_vars_medium_vpn.yml --- vars/local_vars_medium_vpn.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_medium_vpn.yml b/vars/local_vars_medium_vpn.yml index 0750d4a2c..29705971c 100644 --- a/vars/local_vars_medium_vpn.yml +++ b/vars/local_vars_medium_vpn.yml @@ -51,6 +51,7 @@ iiab_gateway_enabled: False dnsmasq_install: True dnsmasq_enabled: False +# Enable AFTER installing IIAB! Then run "cd /opt/iiab/iiab; ./iiab-network" dns_jail_enabled: False # Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 From 12bb1ae630ae58c633217120ddf368f47895a632 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 11:20:01 -0400 Subject: [PATCH 239/374] Update local_vars_big.yml --- vars/local_vars_big.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index 66f5bd196..14da99f8b 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -51,6 +51,7 @@ iiab_gateway_enabled: False dnsmasq_install: True dnsmasq_enabled: False +# Enable AFTER installing IIAB! Then run "cd /opt/iiab/iiab; ./iiab-network" dns_jail_enabled: False # Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 From 50270066e7bdfc56adc1011774418061e1effe27 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 11:20:19 -0400 Subject: [PATCH 240/374] Update local_vars_big_vpn.yml --- vars/local_vars_big_vpn.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_big_vpn.yml b/vars/local_vars_big_vpn.yml index 054c428df..b4105b314 100644 --- a/vars/local_vars_big_vpn.yml +++ b/vars/local_vars_big_vpn.yml @@ -51,6 +51,7 @@ iiab_gateway_enabled: False dnsmasq_install: True dnsmasq_enabled: False +# Enable AFTER installing IIAB! Then run "cd /opt/iiab/iiab; ./iiab-network" dns_jail_enabled: False # Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 From a54000f268a2e86a1fe5b5e3c2ac6fef81bfe4af Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 11:20:40 -0400 Subject: [PATCH 241/374] Update local_vars_min.yml --- vars/local_vars_min.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index 6ca4dcb05..f054de459 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -51,6 +51,7 @@ iiab_gateway_enabled: False dnsmasq_install: True dnsmasq_enabled: False +# Enable AFTER installing IIAB! Then run "cd /opt/iiab/iiab; ./iiab-network" dns_jail_enabled: False # Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 From dc5cb753826c00f5db39707ac949e818c6dca49f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 11:20:59 -0400 Subject: [PATCH 242/374] Update local_vars_min_vpn.yml --- vars/local_vars_min_vpn.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/local_vars_min_vpn.yml b/vars/local_vars_min_vpn.yml index ec7aeb7bf..711faab90 100644 --- a/vars/local_vars_min_vpn.yml +++ b/vars/local_vars_min_vpn.yml @@ -51,6 +51,7 @@ iiab_gateway_enabled: False dnsmasq_install: True dnsmasq_enabled: False +# Enable AFTER installing IIAB! Then run "cd /opt/iiab/iiab; ./iiab-network" dns_jail_enabled: False # Simple python Captive Portal, that @m-anish & @jvonau are experimenting with in July 2018: github.com/iiab/iiab/pull/870 From 664a88ace45555e11fde2483495ea6795eb0143a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 11:23:12 -0400 Subject: [PATCH 243/374] Update default_vars.yml --- vars/default_vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index e430b13b3..0f1672981 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -109,7 +109,7 @@ block_DNS: False dnsmasq_install: True dnsmasq_enabled: False -# Enable AFTER installing IIAB! Then run "cd /opt/iiab/iiab; ./iiab-network" +# Enable in local_vars.yml AFTER installing IIAB! Then run "cd /opt/iiab/iiab; ./iiab-network" dns_jail_enabled: False # For @tim-moody's Nodogsplash approach to Captive Portal? High experimental as of June 2018: github.com/iiab/iiab/issues/608 From da99df667ae36260b383c79beffaeb2ccbf23009 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:20:05 -0400 Subject: [PATCH 244/374] Update iiab-install --- iiab-install | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iiab-install b/iiab-install index 7cae43b7b..f6d5cd554 100755 --- a/iiab-install +++ b/iiab-install @@ -118,16 +118,16 @@ if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then echo -e "\n'--debug' *ignored* as STAGE (counter) < 2." fi -# If vars/local_vars.yml is missing, put a default file in place. -if [ ! -f ./vars/local_vars.yml ]; then +# If /etc/iiab/local_vars.yml is missing, put a default file in place. +if [ ! -f /etc/iiab/local_vars.yml ]; then case $OS in OLPC | fedora) - cp ./vars/local_vars_olpc.yml ./vars/local_vars.yml - echo -e "\nvars/local_vars.yml created from local_vars_olpc.yml defaults." + cp ./vars/local_vars_olpc.yml /etc/iiab/local_vars.yml + echo -e "\n/etc/iiab/local_vars.yml created from local_vars_olpc.yml defaults." ;; centos | debian | ubuntu | raspbian) - cp ./vars/local_vars_medium.yml ./vars/local_vars.yml - echo -e "\nvars/local_vars.yml created from local_vars_medium.yml defaults." + cp ./vars/local_vars_medium.yml /etc/iiab/local_vars.yml + echo -e "\/etc/iiab/local_vars.yml created from local_vars_medium.yml defaults." echo "See MIN/MEDIUM/BIG options @ http://wiki.iiab.io/local_vars.yml" ;; *) From d1360171c170272ebe6c3c546579eade75217159 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:20:49 -0400 Subject: [PATCH 245/374] Update iiab-stages.yml --- iiab-stages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-stages.yml b/iiab-stages.yml index 0f0d0ae56..35db6f84f 100644 --- a/iiab-stages.yml +++ b/iiab-stages.yml @@ -6,7 +6,7 @@ - roles/0-init/defaults/main.yml - vars/default_vars.yml - vars/{{ ansible_local.local_facts.os_ver }}.yml - - vars/local_vars.yml + - /etc/iiab/local_vars.yml tasks: From d31735ead94ea296d67c6739403ee2af8d6720ad Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:21:30 -0400 Subject: [PATCH 246/374] Update iiab-network.yml --- iiab-network.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-network.yml b/iiab-network.yml index 989108cb3..721bedac9 100644 --- a/iiab-network.yml +++ b/iiab-network.yml @@ -5,7 +5,7 @@ vars_files: - vars/default_vars.yml - vars/{{ ansible_local.local_facts.os_ver }}.yml - - vars/local_vars.yml + - /etc/iiab/local_vars.yml - /etc/iiab/config_vars.yml roles: From f6af40a7f54f344a9eb5e2e9576b8043260f6d4a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:21:53 -0400 Subject: [PATCH 247/374] Update iiab-from-console.yml --- iiab-from-console.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-from-console.yml b/iiab-from-console.yml index 97e8de990..c6275a641 100644 --- a/iiab-from-console.yml +++ b/iiab-from-console.yml @@ -5,7 +5,7 @@ vars_files: - vars/default_vars.yml - vars/{{ ansible_local.local_facts.os_ver }}.yml - - vars/local_vars.yml + - /etc/iiab/local_vars.yml - /etc/iiab/config_vars.yml roles: From 8325bc0dc11284ec5d5bdb9b6cda198c0b1168d8 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:22:09 -0400 Subject: [PATCH 248/374] Update run-one-role.yml --- run-one-role.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-one-role.yml b/run-one-role.yml index e1ae27c2f..abd41ff1d 100644 --- a/run-one-role.yml +++ b/run-one-role.yml @@ -5,7 +5,7 @@ vars_files: - vars/default_vars.yml - vars/{{ ansible_local.local_facts.os_ver }}.yml - - vars/local_vars.yml + - /etc/iiab/local_vars.yml - /etc/iiab/config_vars.yml roles: From 2ee6d048bca1a13ee90d38f5e2fef95df6455982 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:22:59 -0400 Subject: [PATCH 249/374] Update install-support --- install-support | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-support b/install-support index 79439f2f7..b5ae9a12e 100755 --- a/install-support +++ b/install-support @@ -14,7 +14,7 @@ then exit 1 fi -sed -i -e "s/openvpn_install: False/openvpn_install: True/" vars/local_vars.yml -sed -i -e "s/openvpn_enabled: False/openvpn_enabled: True/" vars/local_vars.yml +sed -i -e "s/openvpn_install: False/openvpn_install: True/" /etc/iiab/local_vars.yml +sed -i -e "s/openvpn_enabled: False/openvpn_enabled: True/" /etc/iiab/local_vars.yml ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local From 419a4b829663ba6d4941536133444436a63c52ab Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:23:19 -0400 Subject: [PATCH 250/374] Update iiab-base.yml --- iiab-base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-base.yml b/iiab-base.yml index adf698fb9..de2238008 100644 --- a/iiab-base.yml +++ b/iiab-base.yml @@ -5,7 +5,7 @@ vars_files: - vars/default_vars.yml - vars/{{ ansible_local.local_facts.os_ver }}.yml - - vars/local_vars.yml + - /etc/iiab/local_vars.yml roles: - { role: 0-init, tags: ['0-init'] } From 07754401b5955c6e7c2ea4d2a83286ae9a51836c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:23:50 -0400 Subject: [PATCH 251/374] Update iiab.yml --- iiab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab.yml b/iiab.yml index 721203544..d387a1d7c 100644 --- a/iiab.yml +++ b/iiab.yml @@ -5,7 +5,7 @@ vars_files: - vars/default_vars.yml - vars/{{ ansible_local.local_facts.os_ver }}.yml - - vars/local_vars.yml + - /etc/iiab/local_vars.yml - /etc/iiab/config_vars.yml roles: From fab541f31a28c29292fedb1e3e26f499cf4388b8 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:55:12 -0400 Subject: [PATCH 252/374] Update CONTRIBUTING.md --- CONTRIBUTING.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f543665a..234f5f934 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Contributing to Internet-in-a-Box (IIAB) ======================================= Internet-in-a-Box runs on various GNU/Linux operating systems such as Fedora, Ubuntu, Debian, CentOS and Raspbian. -You can install Internet-in-a-Box on most late model desktop and laptop computers. It also supports Intel NUC, Intel Gigabyte BRIX, OLPC XO-1.5, XO-1.75, XO-4, Raspberry Pi 2 and Raspberry Pi 3. A VirtualBox VM can also used for testing purposes. Using Docker containers however is not recommended as our Ansible provisioning system requires low-level access to the operating system. +You can install Internet-in-a-Box on x86_64 PCs/laptops and Raspberry Pi 3 (or 3 B+). Example PC's include Intel NUC and Gigabyte BRIX. Partial support is also available on OLPC laptops like the XO-1.5, XO-1.75 and XO-4. A VirtualBox VM can also used for testing purposes. Using Docker containers however is not recommended as our Ansible provisioning system requires low-level access to the operating system. Finally, running Internet-in-a-Box on the Raspberry Pi Zero W is also possible, if you transfer a working IIAB (microSD card) that was built up inside a Raspberry Pi 3. Please refer to [IIAB Platforms](https://github.com/iiab/iiab/wiki/IIAB-Platforms) for more information. @@ -11,12 +11,12 @@ Internet-in-a-Box uses [Ansible](https://www.ansible.com/) infrastructure automa ├── roles │ ├── 1-prep │ │ ├─ defaults -| | | ├──main.yml (lowest precedence variable definitions, overridden by <repo_root>/vars/default_vars.yml, overridden by ./vars/local_vars.yml. +| | | ├──main.yml (lowest precedence variable definitions, overridden by <repo_root>/vars/default_vars.yml, overridden by /etc/iiab/local_vars.yml) │ │ ├── README.rst │ │ ├── tasks | | | ├──main.yml (specifies the actions to install this role │ │ └── templates -| | | ├<(text files where ansible variables are substituted, specified via {% <variable> %} containers-(jinja2 language). +| | | ├──<text files where ansible variables are substituted, specified via {% <variable> %} containers-(jinja2 language)> │ ├── 2-common │ │ ├── README.rst │ │ ├── tasks @@ -24,11 +24,11 @@ Internet-in-a-Box uses [Ansible](https://www.ansible.com/) infrastructure automa ``` At runtime, Ansible gathers system information and makes it available (called 'facts') and combines this with playbook defined 'variables' to guide the installation process. The execution follows a sequence of cascading steps: -1. Bash script `./runansible` follows instructions in `iiab.yml` in the root directory. +1. Bash script `./iiab-install` follows instructions in `iiab-stages.yml` in the root directory. -2. `iiab.yml` calls 9 aggregate roles (the numbered directories under `./roles/`). +2. `iiab-stages.yml` calls 9 aggregate roles (AKA stages, these are the numbered directories under `./roles/`) and then the network role. (Aside: the network role can also later be run using `./iiab-network`) -3. Each aggregate role has a `<role>/meta/main.yml` which calls the individual named roles. +3. Each aggregate role AKA stage has a `<role>/meta/main.yml` which calls its needed roles. Please refer to the [IIAB Architecture](https://github.com/iiab/iiab/wiki/IIAB-Architecture) and [IIAB Variables]( https://github.com/iiab/iiab/wiki/IIAB-Variables) pages for more information. From 5a504224753e9e6ab4e5b5c7bca5a30b41bee3ee Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 18:00:19 -0400 Subject: [PATCH 253/374] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index f6d5cd554..ab6c17ff3 100755 --- a/iiab-install +++ b/iiab-install @@ -127,7 +127,7 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then ;; centos | debian | ubuntu | raspbian) cp ./vars/local_vars_medium.yml /etc/iiab/local_vars.yml - echo -e "\/etc/iiab/local_vars.yml created from local_vars_medium.yml defaults." + echo -e "\n/etc/iiab/local_vars.yml created from local_vars_medium.yml defaults." echo "See MIN/MEDIUM/BIG options @ http://wiki.iiab.io/local_vars.yml" ;; *) From a9d42b1b24d6735db6c8138b5b43e56d77c13c4c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 20:26:19 -0400 Subject: [PATCH 254/374] Rename iiab.yml to iiab.yml.deprecated --- iiab.yml => iiab.yml.deprecated | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename iiab.yml => iiab.yml.deprecated (100%) diff --git a/iiab.yml b/iiab.yml.deprecated similarity index 100% rename from iiab.yml rename to iiab.yml.deprecated From 27ec80c5938a739ac605343b4ba167f5579a7f33 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:01:57 -0400 Subject: [PATCH 255/374] Update main.yml --- roles/kolibri/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kolibri/defaults/main.yml b/roles/kolibri/defaults/main.yml index 1d9f660bf..990ac7b5e 100644 --- a/roles/kolibri/defaults/main.yml +++ b/roles/kolibri/defaults/main.yml @@ -1,5 +1,5 @@ # The values here are defaults. -# To override them edit /opt/iiab/iiab/vars/local_vars.yml +# To override them edit /etc/iiab/local_vars.yml # Installation Variables kolibri_install: False From 570b96731e83b6f979c0a5e79c4acd29f79b6834 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:03:56 -0400 Subject: [PATCH 256/374] Update main.yml --- roles/calibre/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/calibre/defaults/main.yml b/roles/calibre/defaults/main.yml index 4cbfc1caa..a89171f8b 100644 --- a/roles/calibre/defaults/main.yml +++ b/roles/calibre/defaults/main.yml @@ -21,5 +21,5 @@ calibre_src_url: "https://raw.githubusercontent.com/kovidgoyal/calibre/master/se # USE TO TEST debs.yml (RASPBIAN APPROACH!) ON DEBIAN 9.X: (now handled by calibre_via_debs in /opt/iiab/iiab/vars/*) #calibre_debs_on_debian: True -# Enable unstable .deb's, not just testing .deb's: (moved to vars/local_vars.yml & vars/default_vars.yml) +# Enable unstable .deb's, not just testing .deb's: (moved to /etc/iiab/local_vars.yml & /opt/iiab/iiab/vars/default_vars.yml) #calibre_unstable_debs: False From 6e70ee960d0f35e4beacde010f00eed72b25ffa3 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:04:52 -0400 Subject: [PATCH 257/374] Update calibre.conf --- roles/calibre/templates/calibre.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/calibre/templates/calibre.conf b/roles/calibre/templates/calibre.conf index 7318a51fb..5f5317268 100644 --- a/roles/calibre/templates/calibre.conf +++ b/roles/calibre/templates/calibre.conf @@ -1,4 +1,4 @@ -# http://box/XYZ mnemonic if properly set within /opt/iiab/iiab/vars/local_vars.yml +# http://box/XYZ mnemonic if properly set within /etc/iiab/local_vars.yml ProxyPass /{{ calibre_web_path }} http://localhost:{{ calibre_port }} ProxyPassReverse /{{ calibre_web_path }} http://localhost:{{ calibre_port }} From daa3c2d86d461de5469e7a126c24b543c917a8ce Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:06:16 -0400 Subject: [PATCH 258/374] Update main.yml --- roles/kalite/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kalite/defaults/main.yml b/roles/kalite/defaults/main.yml index e2c992e1e..3d4683c0f 100644 --- a/roles/kalite/defaults/main.yml +++ b/roles/kalite/defaults/main.yml @@ -1,5 +1,5 @@ # The values here are defaults. -# To override them edit the main var definitions in /opt/iiab/iiab/vars/local_vars.yml +# To override them edit /etc/iiab/local_vars.yml kalite_install: True kalite_enabled: False From 5e2fa847f2e95d3005dfc8714bcc444699f96971 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:06:59 -0400 Subject: [PATCH 259/374] Update README.rst --- roles/4-server-options/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/4-server-options/README.rst b/roles/4-server-options/README.rst index ca4afb22a..61d79f77e 100644 --- a/roles/4-server-options/README.rst +++ b/roles/4-server-options/README.rst @@ -2,7 +2,7 @@ 4-server-options README ======================= -Whereas 3-base-server installs critical packages needed by all, this 4th stage installs a broad array of *options* -- depending on which server apps will be installed in later stages -- as specified in /opt/iiab/iiab/vars/local_vars.yml +Whereas 3-base-server installs critical packages needed by all, this 4th stage installs a broad array of *options* -- depending on which server apps will be installed in later stages -- as specified in /etc/iiab/local_vars.yml This includes some networking fundamentals, before they're configured later on. From 57e97fd2bddbedcafe0601ba8f5fce856fe2fea0 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:07:57 -0400 Subject: [PATCH 260/374] Update README.rst --- roles/rachel/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/rachel/README.rst b/roles/rachel/README.rst index ac07828cb..31aa1453d 100644 --- a/roles/rachel/README.rst +++ b/roles/rachel/README.rst @@ -13,7 +13,7 @@ Do the following: * cd /library/rachel * mv /library/rachelusb_32EN_3.1.4/RACHEL/bin . * you should see /library/rachel/bin/www/index.php -* re-run ansible (making sure that rachel_enabled: True has been set in vars/local_vars.yml +* re-run ansible (making sure that rachel_enabled: True has been set in /etc/iiab/local_vars.yml Locations --------- From 7866041f2b203530d4fb42c67a6c84939860b0c3 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:09:15 -0400 Subject: [PATCH 261/374] Update main.yml --- roles/network/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 61f622f03..9adbf7ad8 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -44,7 +44,7 @@ hostapd_wait: 1 host_wifi_mode: g host_channel: 6 host_wireless_n: False -# Below moved to /opt/iiab/iiab/vars/local_vars.yml: (so implementer sets this) +# Below moved to /etc/iiab/local_vars.yml: (so implementer sets this) #host_country_code: US hostapd_secure: True hostapd_password: "iiab2017" From 5fd35fa48861060d7e63b46f69f119de55f4ff82 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:18:34 -0400 Subject: [PATCH 262/374] Update default_vars.yml --- vars/default_vars.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index ce69cc687..498087dee 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -1,7 +1,7 @@ # WARNING: DO NOT MODIFY THIS FILE. # CHANGES WILL BE LOST IF YOU DO A GIT PULL OR FETCH. -# Instead put changes in local_vars.yml which is not tracked by git: -# http://wiki.iiab.io/local_vars.yml +# Instead put changes in your own /etc/iiab/local_vars.yml +# See http://wiki.iiab.io/local_vars.yml to learn more! # By convention we use True/False to indicate boolean constants. @@ -64,7 +64,7 @@ lan_netmask: 255.255.224.0 # Internal Wi-Fi Access Point # Values are used if there is an internal Wi-Fi adapter and hostapd is enabled # The platform variable adapts install to specific hardware (raspberry pi=rpi2) -# Raspbian req WiFi country since March 2018. CHANGE IT IN vars/local_vars.yml +# Raspbian req WiFi country since March 2018. CHANGE IT IN /etc/iiab/local_vars.yml host_country_code: US host_ssid: "Internet in a Box" host_wifi_mode: g @@ -193,15 +193,15 @@ openvpn_enabled: False # roles/network runs here (MANY SETTINGS ABOVE) # Homepage -# Default to the GUI where the selection is made or override in local_vars.yml iiab_home_url: /home -# You can change iiab_home_url in local_vars.yml in order to get a different -# homepage. For example one of the following: (assuming they are enabled) +# You can change iiab_home_url in /etc/iiab/local_vars.yml to get a different +# homepage. For example one of the following: (if service is enabled!) # iiab_home_url: /home # iiab_home_url: /wordpress -# iiab_home_url: /wiki - either dokuwiki or mediawiki +# iiab_home_url: /wiki # for dokuwiki +# iiab_home_url: /mediawiki # PostgreSQL auto-installed by Moodle &/or Pathagar as nec, no need to touch! # roles/1-prep/tasks/computed_vars.yml, roles/4-server-options/tasks/main.yml @@ -413,9 +413,10 @@ xovis_chart_heading: "My School: Usage Data Visualization" # wide to narrow is_debuntu: False is_ubuntu: False -is_ubuntu_16: False is_ubuntu_18: False +is_ubuntu_16: False is_debian: False +is_debian_10: False is_debian_9: False is_debian_8: False is_rpi: False From 80a101f55205ad12e51565ee2a831e4405f48e42 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:20:08 -0400 Subject: [PATCH 263/374] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 234f5f934..554c4dd5a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,9 @@ Contributing to Internet-in-a-Box (IIAB) ======================================= Internet-in-a-Box runs on various GNU/Linux operating systems such as Fedora, Ubuntu, Debian, CentOS and Raspbian. -You can install Internet-in-a-Box on x86_64 PCs/laptops and Raspberry Pi 3 (or 3 B+). Example PC's include Intel NUC and Gigabyte BRIX. Partial support is also available on OLPC laptops like the XO-1.5, XO-1.75 and XO-4. A VirtualBox VM can also used for testing purposes. Using Docker containers however is not recommended as our Ansible provisioning system requires low-level access to the operating system. Finally, running Internet-in-a-Box on the Raspberry Pi Zero W is also possible, if you transfer a working IIAB (microSD card) that was built up inside a Raspberry Pi 3. +You can install Internet-in-a-Box on x86_64 PCs/laptops and Raspberry Pi 3 (or 3 B+). Example PC's include Intel NUC and Gigabyte BRIX. Partial support is also available on OLPC laptops like the XO-1.5, XO-1.75 and XO-4. A VirtualBox VM can also be used for testing purposes. Using Docker containers however is not recommended as our Ansible provisioning system requires low-level access to the operating system. + +Finally, running Internet-in-a-Box on the Raspberry Pi Zero W is also possible, if you transfer a working IIAB (microSD card) that was built up inside a Raspberry Pi 3. Please refer to [IIAB Platforms](https://github.com/iiab/iiab/wiki/IIAB-Platforms) for more information. From 6e6c9686c89f7ca669116ce1a1c02a25ec989d6a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:20:40 -0400 Subject: [PATCH 264/374] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 554c4dd5a..e81236bbe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Internet-in-a-Box runs on various GNU/Linux operating systems such as Fedora, Ub You can install Internet-in-a-Box on x86_64 PCs/laptops and Raspberry Pi 3 (or 3 B+). Example PC's include Intel NUC and Gigabyte BRIX. Partial support is also available on OLPC laptops like the XO-1.5, XO-1.75 and XO-4. A VirtualBox VM can also be used for testing purposes. Using Docker containers however is not recommended as our Ansible provisioning system requires low-level access to the operating system. -Finally, running Internet-in-a-Box on the Raspberry Pi Zero W is also possible, if you transfer a working IIAB (microSD card) that was built up inside a Raspberry Pi 3. +Finally, running Internet-in-a-Box on the Raspberry Pi Zero W is also possible, if you transfer a working IIAB (microSD card) that was built up inside a Raspberry Pi 3 (or 3 B+). Please refer to [IIAB Platforms](https://github.com/iiab/iiab/wiki/IIAB-Platforms) for more information. From 066113d2ab8ce84a43a34915840efa597bd5ccf2 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 22:45:37 -0400 Subject: [PATCH 265/374] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index ab6c17ff3..3cd9be0d5 100755 --- a/iiab-install +++ b/iiab-install @@ -30,7 +30,7 @@ if [ "$1" != "--debug" ] && [ "$1" != "--reinstall" ] && [ "$1" != "" ]; then echo "Use './iiab-install' for regular installs, or to continue an install." echo "Use './iiab-install --reinstall' to force running all Stages 0-9." echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9." - echo "Use './runtags' to run a single Stage or Tag or Role." + echo "Use './runrole' to run a single Stage or Role." echo "Use './iiab-network' to run Network sections." exit 1 fi From f8a26310298ffc6af404db30038b30c4f41bf845 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Thu, 19 Jul 2018 23:14:21 -0400 Subject: [PATCH 266/374] Update iiab-install --- iiab-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iiab-install b/iiab-install index 3cd9be0d5..addd648f5 100755 --- a/iiab-install +++ b/iiab-install @@ -110,8 +110,8 @@ if [ -f /etc/iiab/iiab.env ]; then echo "Use './iiab-install --reinstall' to force running all Stages 0-9." echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9." echo "Use './runtags' to run a single Stage or Tag or Role." - echo "Use './iiab-network' to run Network sections." - exit 1 + echo -e "Use './iiab-network' to run Network sections.\n" + exit 0 # allows rerunning http://d.iiab.io/6.6/install.txt fi fi if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then From 93a73fac8248b5d0cbd7e29cfc35dfa5c9058227 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 00:41:05 -0400 Subject: [PATCH 267/374] Update default_vars.yml --- vars/default_vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 498087dee..7f28a5f52 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -196,7 +196,7 @@ openvpn_enabled: False iiab_home_url: /home # You can change iiab_home_url in /etc/iiab/local_vars.yml to get a different -# homepage. For example one of the following: (if service is enabled!) +# homepage. For example one of the following: (if its service is enabled!) # iiab_home_url: /home # iiab_home_url: /wordpress From 05d6b3adabc8b5718fb2e028cca7c91e99beb662 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 00:44:40 -0400 Subject: [PATCH 268/374] Update iiab-install --- iiab-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iiab-install b/iiab-install index addd648f5..100d06659 100755 --- a/iiab-install +++ b/iiab-install @@ -123,11 +123,11 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then case $OS in OLPC | fedora) cp ./vars/local_vars_olpc.yml /etc/iiab/local_vars.yml - echo -e "\n/etc/iiab/local_vars.yml created from local_vars_olpc.yml defaults." + echo -e "\n/etc/iiab/local_vars.yml created from /opt/iiab/iiab/vars/local_vars_olpc.yml defaults." ;; centos | debian | ubuntu | raspbian) cp ./vars/local_vars_medium.yml /etc/iiab/local_vars.yml - echo -e "\n/etc/iiab/local_vars.yml created from local_vars_medium.yml defaults." + echo -e "\n/etc/iiab/local_vars.yml created from /opt/iiab/iiab/vars/local_vars_medium.yml defaults." echo "See MIN/MEDIUM/BIG options @ http://wiki.iiab.io/local_vars.yml" ;; *) From 38c63791482ce3feddf5d04b9bc23e0b43a98edc Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 00:58:24 -0400 Subject: [PATCH 269/374] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 666485305..6c34bee83 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -74,7 +74,7 @@ else #if [[ `grep -qi ansible /etc/apt/sources.list` ]] || [ -f /etc/apt/sources.list.d/ansible*.list ]; then elif (grep -qi ansible /etc/apt/sources.list) || (ls /etc/apt/sources.list.d/*ansible*.list >/dev/null 2>&1) ; then #echo "Ansible repo(s) found within /etc/apt/sources.list*" - echo -e 'MANUAL INTERVENTION URGED:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- MUST CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible/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 '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' else echo -e 'Upstream ansible source repo not found:\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.' exit 1 From fc66341299bc4ad132cbb26fc26a9d24acec4956 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 00:58:54 -0400 Subject: [PATCH 270/374] 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 f8cf8b077..bbb178b45 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -74,7 +74,7 @@ else #if [[ `grep -qi ansible /etc/apt/sources.list` ]] || [ -f /etc/apt/sources.list.d/ansible*.list ]; then elif (grep -qi ansible /etc/apt/sources.list) || (ls /etc/apt/sources.list.d/*ansible*.list >/dev/null 2>&1) ; then #echo "Ansible repo(s) found within /etc/apt/sources.list*" - echo -e 'MANUAL INTERVENTION URGED:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- MUST CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible-2.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' else echo -e 'Upstream ansible source repo not found:\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.' exit 1 From c1b0524649ff6cafad3415c7361810f2454e9b27 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 01:26:11 -0400 Subject: [PATCH 271/374] Update iiab-install --- iiab-install | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iiab-install b/iiab-install index 100d06659..d833a27f8 100755 --- a/iiab-install +++ b/iiab-install @@ -14,6 +14,8 @@ MIN_ANSIBLE_VER=2.5.6 export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" +echo -e "\n\n./iiab-install BEGUN IN /opt/iiab/iiab\n" + if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then mkdir -p /etc/ansible/facts.d fi @@ -109,8 +111,8 @@ if [ -f /etc/iiab/iiab.env ]; then echo -e "\nEXITING: STAGE (counter) in /etc/iiab/iiab.env shows Stage 9 Is Already Done." echo "Use './iiab-install --reinstall' to force running all Stages 0-9." echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9." - echo "Use './runtags' to run a single Stage or Tag or Role." - echo -e "Use './iiab-network' to run Network sections.\n" + echo "Use './runrole' to run a single Stage or Role." + echo -e "Use './iiab-network' to run Network sections.\n\n" exit 0 # allows rerunning http://d.iiab.io/6.6/install.txt fi fi @@ -142,3 +144,5 @@ echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local + +echo -e "\n./iiab-install COMPLETED IN /opt/iiab/iiab\n\n" From 383c46de620f4b988e21ea5aa292a79ad125eedc Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 01:28:05 -0400 Subject: [PATCH 272/374] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index d833a27f8..1a058495e 100755 --- a/iiab-install +++ b/iiab-install @@ -113,7 +113,7 @@ if [ -f /etc/iiab/iiab.env ]; then echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9." echo "Use './runrole' to run a single Stage or Role." echo -e "Use './iiab-network' to run Network sections.\n\n" - exit 0 # allows rerunning http://d.iiab.io/6.6/install.txt + exit 0 # allows rerunning http://download.iiab.io/6.6/install.txt fi fi if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then From eecf4792d94ce17b95bf8cf9784b8bbb03eaed4c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 04:38:35 -0400 Subject: [PATCH 273/374] scripts announces it's beginning --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 6c34bee83..91f74eeb7 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -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 "Installing --- Please Wait" + echo "scripts/ansible will now try to install Ansible --- Please Wait" if [ -f /etc/centos-release ]; then yum -y install ca-certificates nss epel-release yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python From e15e6fbc03566d7a4c730976aa8de5e5ebc00960 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 04:38:47 -0400 Subject: [PATCH 274/374] scripts announces it's beginning --- 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 bbb178b45..b051ff203 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -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 "Installing --- Please Wait" + echo "scripts/ansible-2.6.x will now try to install Ansible --- Please Wait" if [ -f /etc/centos-release ]; then yum -y install ca-certificates nss epel-release yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python From ee9e4a2c44b1d14b377e0f81d4217b71315898c6 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 04:46:51 -0400 Subject: [PATCH 275/374] Update local_vars_min.yml --- vars/local_vars_min.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index f054de459..c8ce902db 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -1,4 +1,4 @@ -# This is local_vars_min.yml -- copy it to local_vars.yml then... +# This is local_vars_min.yml -- copy it to /etc/iiab/local_vars.yml then... # Put variables herein to override /opt/iiab/iiab/vars/default_vars.yml From 7d6270cf260c4f440c41861d2034d82a9aa954fc Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 04:47:33 -0400 Subject: [PATCH 276/374] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index 764ea5eae..b6be18fed 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -1,4 +1,4 @@ -# This is local_vars_medium.yml -- copy it to local_vars.yml then... +# This is local_vars_medium.yml -- copy it to /etc/iiab/local_vars.yml then... # Put variables herein to override /opt/iiab/iiab/vars/default_vars.yml From 8b58e5de02a545dd477ecd7a62eb3e5134ab107e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 04:47:56 -0400 Subject: [PATCH 277/374] Update local_vars_big.yml --- vars/local_vars_big.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index 14da99f8b..56a81d9e8 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -1,4 +1,4 @@ -# This is local_vars_big.yml -- copy it to local_vars.yml then... +# This is local_vars_big.yml -- copy it to /etc/iiab/local_vars.yml then... # Put variables herein to override /opt/iiab/iiab/vars/default_vars.yml From ad1b1932aed6da9f5c652f63c2746b0635e3feac Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 04:48:27 -0400 Subject: [PATCH 278/374] Update local_vars_big_vpn.yml --- vars/local_vars_big_vpn.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/local_vars_big_vpn.yml b/vars/local_vars_big_vpn.yml index b4105b314..6911b7c38 100644 --- a/vars/local_vars_big_vpn.yml +++ b/vars/local_vars_big_vpn.yml @@ -1,4 +1,4 @@ -# This is local_vars_big_vpn.yml -- copy it to local_vars.yml then... +# This is local_vars_big_vpn.yml -- copy it to /etc/iiab/local_vars.yml then... # Put variables herein to override /opt/iiab/iiab/vars/default_vars.yml From 14e68360af4046596ee1e1a31e6f88bbe554f172 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 04:49:57 -0400 Subject: [PATCH 279/374] Update local_vars_min_vpn.yml --- vars/local_vars_min_vpn.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/local_vars_min_vpn.yml b/vars/local_vars_min_vpn.yml index 711faab90..31725c58f 100644 --- a/vars/local_vars_min_vpn.yml +++ b/vars/local_vars_min_vpn.yml @@ -1,4 +1,4 @@ -# This is local_vars_min_vpn.yml -- copy it to local_vars.yml then... +# This is local_vars_min_vpn.yml -- copy it to /etc/iiab/local_vars.yml then... # Put variables herein to override /opt/iiab/iiab/vars/default_vars.yml From ff878c3f05856cb6693750080e0520d557e83f59 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 04:50:13 -0400 Subject: [PATCH 280/374] Update local_vars_medium_vpn.yml --- vars/local_vars_medium_vpn.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/local_vars_medium_vpn.yml b/vars/local_vars_medium_vpn.yml index 29705971c..11d2af017 100644 --- a/vars/local_vars_medium_vpn.yml +++ b/vars/local_vars_medium_vpn.yml @@ -1,4 +1,4 @@ -# This is local_vars_medium_vpn.yml -- copy it to local_vars.yml then... +# This is local_vars_medium_vpn.yml -- copy it to /etc/iiab/local_vars.yml then... # Put variables herein to override /opt/iiab/iiab/vars/default_vars.yml From b3a7af09c5076089d04e6f1f9c53db2e42f2b427 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 05:16:57 -0400 Subject: [PATCH 281/374] Update named.yml --- roles/network/tasks/named.yml | 117 +++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 52 deletions(-) diff --git a/roles/network/tasks/named.yml b/roles/network/tasks/named.yml index bfeaa7c16..90dd17706 100644 --- a/roles/network/tasks/named.yml +++ b/roles/network/tasks/named.yml @@ -1,6 +1,7 @@ - name: Install named packages (debuntu) - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - bind9 - bind9utils @@ -9,8 +10,9 @@ - download - name: Install named packages (OS's that are not debuntu) - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - bind - bind-utils @@ -20,76 +22,87 @@ # or we have to change the serial number in the config files. - name: Stop named before copying files - service: name={{ dns_service }} state=stopped + service: + name: "{{ dns_service }}" + state: stopped when: first_run and is_debuntu - name: Set folder permission - file: path={{ item }} - owner={{ dns_user }} - group=root - mode=0755 - state=directory + file: + path: "{{ item }}" + owner: "{{ dns_user }}" + group: root + mode: 0755 + state: directory with_items: - /var/named-iiab - /var/named-iiab/data - /etc/sysconfig/olpc-scripts/domain_config.d - name: Configure named - template: src={{ item.src }} - dest={{ item.dest }} - owner={{ item.owner }} - group=root - mode={{ item.mode }} + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: "{{ item.owner }}" + group: root + mode: "{{ item.mode }}" with_items: - - { src: 'roles/network/templates/named/named-iiab.conf.j2', dest: '/etc/named-iiab.conf', owner: "root" , mode: '0644' } - - { src: 'roles/network/templates/named/named.j2', dest: '/etc/sysconfig/named', owner: "root" , mode: '0644' } - - { src: 'roles/network/templates/named/named', dest: '/etc/sysconfig/olpc-scripts/domain_config.d/named', owner: "root" , mode: '0644' } - - { src: 'roles/network/templates/named/localdomain.zone', dest: '/var/named-iiab/localdomain.zone',owner: "{{ dns_user }}" , mode: '0644' } - - { src: 'roles/network/templates/named/localhost.zone', dest: '/var/named-iiab/localhost.zone', owner: "{{ dns_user }}" , mode: '0644' } - - { src: 'roles/network/templates/named/named.broadcast', dest: '/var/named-iiab/named.broadcast', owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/named.ip6.local', dest: '/var/named-iiab/named.ip6.local' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/named.local', dest: '/var/named-iiab/named.local' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/named.rfc1912.zones', dest: '/var/named-iiab/named.rfc1912.zones' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/named.root', dest: '/var/named-iiab/named.root' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/named.root.hints', dest: '/var/named-iiab/named.root.hints' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/named.zero', dest: '/var/named-iiab/named.zero' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/school.external.zone.db', dest: '/var/named-iiab/school.external.zone.db' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/school.internal.zone.16.in-addr.db.j2', dest: '/var/named-iiab/school.internal.zone.16.in-addr.db' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/school.internal.zone.32.in-addr.db.j2', dest: '/var/named-iiab/school.internal.zone.32.in-addr.db' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/school.internal.zone.48.in-addr.db.j2', dest: '/var/named-iiab/school.internal.zone.48.in-addr.db' , owner: "{{ dns_user }}" , mode: '0644'} + - { src: 'roles/network/templates/named/named-iiab.conf.j2', dest: '/etc/named-iiab.conf', owner: "root", mode: '0644' } + - { src: 'roles/network/templates/named/named.j2', dest: '/etc/sysconfig/named', owner: "root", mode: '0644' } + - { src: 'roles/network/templates/named/named', dest: '/etc/sysconfig/olpc-scripts/domain_config.d/named', owner: "root", mode: '0644' } + - { src: 'roles/network/templates/named/localdomain.zone', dest: '/var/named-iiab/localdomain.zone', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/localhost.zone', dest: '/var/named-iiab/localhost.zone', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/named.broadcast', dest: '/var/named-iiab/named.broadcast', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/named.ip6.local', dest: '/var/named-iiab/named.ip6.local', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/named.local', dest: '/var/named-iiab/named.local', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/named.rfc1912.zones', dest: '/var/named-iiab/named.rfc1912.zones', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/named.root', dest: '/var/named-iiab/named.root', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/named.root.hints', dest: '/var/named-iiab/named.root.hints', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/named.zero', dest: '/var/named-iiab/named.zero', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/school.external.zone.db', dest: '/var/named-iiab/school.external.zone.db', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/school.internal.zone.16.in-addr.db.j2', dest: '/var/named-iiab/school.internal.zone.16.in-addr.db', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/school.internal.zone.32.in-addr.db.j2', dest: '/var/named-iiab/school.internal.zone.32.in-addr.db', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/school.internal.zone.48.in-addr.db.j2', dest: '/var/named-iiab/school.internal.zone.48.in-addr.db', owner: "{{ dns_user }}", mode: '0644' } # the following two files are not writeable by named, but bind 9.4 cannot discover that fact correctly - - { src: 'roles/network/templates/named/school.internal.zone.db', dest: '/var/named-iiab/school.internal.zone.db' , owner: "root" , mode: '0644'} - - { src: 'roles/network/templates/named/school.local.zone.db', dest: '/var/named-iiab/school.local.zone.db' , owner: "root" , mode: '0644'} - - { src: 'roles/network/templates/named/school.internal.zone.in-addr.db.j2', dest: '/var/named-iiab/school.internal.zone.in-addr.db' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/dummy', dest: '/var/named-iiab/data/dummy' , owner: "{{ dns_user }}" , mode: '0644'} - - { src: 'roles/network/templates/named/named.blackhole', dest: '/var/named-iiab/named.blackhole' , owner: "{{ dns_user }}" , mode: '0644'} + - { src: 'roles/network/templates/named/school.internal.zone.db', dest: '/var/named-iiab/school.internal.zone.db', owner: "root", mode: '0644' } + - { src: 'roles/network/templates/named/school.local.zone.db', dest: '/var/named-iiab/school.local.zone.db', owner: "root", mode: '0644' } + - { src: 'roles/network/templates/named/school.internal.zone.in-addr.db.j2', dest: '/var/named-iiab/school.internal.zone.in-addr.db', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/dummy', dest: '/var/named-iiab/data/dummy', owner: "{{ dns_user }}", mode: '0644' } + - { src: 'roles/network/templates/named/named.blackhole', dest: '/var/named-iiab/named.blackhole', owner: "{{ dns_user }}", mode: '0644' } - name: Substitute our unit file which uses $OPTIONS from sysconfig - template: src=roles/network/templates/named/{{ dns_service }}.service - dest=/etc/systemd/system/{{ dns_service }}.service - mode=0644 + template: + src: "roles/network/templates/named/{{ dns_service }}.service" + dest: "/etc/systemd/system/{{ dns_service }}.service" + mode: 0644 -- name: The dns-jail redirect requires the named.blackhole,disabling recursion +- name: The dns-jail redirect requires the named.blackhole, disabling recursion # in named-iiab.conf, and the redirection of 404 error documents to / - template: src=roles/network/templates/named/dns-jail.conf dest=/etc/{{ apache_config_dir }}/ + template: + src: roles/network/templates/named/dns-jail.conf + dest: "/etc/{{ apache_config_dir }}/" when: dns_jail_enabled -- name: Separate enabling required for debuntu - file: src=/etc/{{ apache_config_dir }}/dns-jail.conf - path=/etc/{{ apache_service }}/sites-enabled/dns-jail.conf - state=link +- name: Separate enabling required (debuntu) + file: + src: "/etc/{{ apache_config_dir }}/dns-jail.conf" + path: "/etc/{{ apache_service }}/sites-enabled/dns-jail.conf" + state: link when: is_debuntu and dns_jail_enabled -- name: Separate enabling/disabling required (debuntu) - file: src=/etc/{{ apache_config_dir }}/dns-jail.conf - path=/etc/{{ apache_service }}/sites-enabled/dns-jail.conf - state=absent +- name: Separate disabling required (debuntu) + file: + path: "/etc/{{ apache_service }}/sites-enabled/dns-jail.conf" + state: absent when: is_debuntu and not dns_jail_enabled - name: Separate enabling/disabling required (OS's that are not debuntu) - file: path=/etc/{{ apache_config_dir }}/dns-jail.conf - state=absent + file: + path: "/etc/{{ apache_config_dir }}/dns-jail.conf" + state: absent when: not is_debuntu and not dns_jail_enabled - name: Start named after copying files - service: name={{ dns_service }} state=started + service: + name: "{{ dns_service }}" + state: started From cf43b22d357cfde91526a348b60cd6f24ae2f671 Mon Sep 17 00:00:00 2001 From: tim-moody <tim@timmoody.com> Date: Fri, 20 Jul 2018 09:44:51 -0400 Subject: [PATCH 282/374] softcode local_vars path --- vars/default_vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 34889d8c7..015e9ce46 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -22,6 +22,7 @@ download_timeout: 200 # Configuration File(s) iiab_config_file: /etc/iiab/iiab.ini +iiab_local_vars_file: /etc/iiab/local_vars.yml service_filelist: "{{ iiab_config_file }}" # The following variable may be useful in debugging From 88bf2bc83722a99e6597861ec0edbacdeacd6646 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 16:33:17 -0400 Subject: [PATCH 283/374] Elgg 2.3.7 -> 2.3.8 --- roles/elgg/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/elgg/defaults/main.yml b/roles/elgg/defaults/main.yml index 3ceb90588..a3c91ab2f 100644 --- a/roles/elgg/defaults/main.yml +++ b/roles/elgg/defaults/main.yml @@ -1,5 +1,5 @@ elgg_xx: elgg -elgg_version: "2.3.7" +elgg_version: "2.3.8" # elgg_mysql_password: defined in default_vars elgg_url: /elgg From 5799d6078f7688cf89ec400470b18ff234b1cfef Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 17:13:15 -0400 Subject: [PATCH 284/374] Sync'd up with https://github.com/iiab/iiab/wiki/IIAB-Contributors-Guide --- CONTRIBUTING.md | 55 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e81236bbe..06c4fc660 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ Contributing to Internet-in-a-Box (IIAB) ======================================= -Internet-in-a-Box runs on various GNU/Linux operating systems such as Fedora, Ubuntu, Debian, CentOS and Raspbian. +Internet-in-a-Box runs on various GNU/Linux operating systems such as Raspbian, Ubuntu, Debian, CentOS and Fedora. You can install Internet-in-a-Box on x86_64 PCs/laptops and Raspberry Pi 3 (or 3 B+). Example PC's include Intel NUC and Gigabyte BRIX. Partial support is also available on OLPC laptops like the XO-1.5, XO-1.75 and XO-4. A VirtualBox VM can also be used for testing purposes. Using Docker containers however is not recommended as our Ansible provisioning system requires low-level access to the operating system. @@ -8,7 +8,7 @@ Finally, running Internet-in-a-Box on the Raspberry Pi Zero W is also possible, Please refer to [IIAB Platforms](https://github.com/iiab/iiab/wiki/IIAB-Platforms) for more information. -Internet-in-a-Box uses [Ansible](https://www.ansible.com/) infrastructure automation tool to deploy and configure all software packages. Ansible uses [playbooks](http://docs.ansible.com/ansible/latest/playbooks.html) a human readable instruction files in YAML format. Playbooks are divided into hosts, roles and tasks. +Internet-in-a-Box uses Ansible (acquired by Red Hat in October 2015, similar to Puppet) to install and configure all software packages. Ansible uses [playbooks](http://docs.ansible.com/ansible/latest/playbooks.html) as human-readable instruction files in [YAML](http://www.yaml.org/start.html) format. Playbooks are divided into hosts, roles and tasks. ``` ├── roles │ ├── 1-prep @@ -18,36 +18,54 @@ Internet-in-a-Box uses [Ansible](https://www.ansible.com/) infrastructure automa │ │ ├── tasks | | | ├──main.yml (specifies the actions to install this role │ │ └── templates -| | | ├──<text files where ansible variables are substituted, specified via {% <variable> %} containers-(jinja2 language)> +| | | ├──<text files where Ansible variables are substituted, using jinja2 templating e.g. {% <variable> %}> │ ├── 2-common │ │ ├── README.rst │ │ ├── tasks │ │ └── templates ``` -At runtime, Ansible gathers system information and makes it available (called 'facts') and combines this with playbook defined 'variables' to guide the installation process. The execution follows a sequence of cascading steps: +Specifically, Ansible installs Internet-in-a-Box starting with 0-init, followed by Stages 1 to 9, and finally runs the network stage: +- [0-init](https://github.com/iiab/iiab/tree/master/roles/0-init) +- [1-prep](https://github.com/iiab/iiab/tree/master/roles/1-prep) +- [2-common](https://github.com/iiab/iiab/tree/master/roles/2-common) +- [3-base-server](https://github.com/iiab/iiab/tree/master/roles/3-base-server) +- [4-server-options](https://github.com/iiab/iiab/tree/master/roles/4-server-options) +- [5-xo-services](https://github.com/iiab/iiab/tree/master/roles/5-xo-services) +- [6-generic-apps](https://github.com/iiab/iiab/tree/master/roles/6-generic-apps) +- [7-edu-apps](https://github.com/iiab/iiab/tree/master/roles/7-edu-apps) +- [8-mgmt-tools](https://github.com/iiab/iiab/tree/master/roles/8-mgmt-tools) +- [9-local-addons](https://github.com/iiab/iiab/tree/master/roles/9-local-addons) +- [network](https://github.com/iiab/iiab/tree/master/roles/network) -1. Bash script `./iiab-install` follows instructions in `iiab-stages.yml` in the root directory. +Click on Stages 1 to 9 above for descriptions of their specific purposes. -2. `iiab-stages.yml` calls 9 aggregate roles (AKA stages, these are the numbered directories under `./roles/`) and then the network role. (Aside: the network role can also later be run using `./iiab-network`) +At runtime (to build up your Internet-in-a-Box server) Ansible gathers system information making it available (as 'facts') and combines this with Ansible 'variables' to guide the installation process. The execution follows a sequence of cascading steps: -3. Each aggregate role AKA stage has a `<role>/meta/main.yml` which calls its needed roles. +1. Bash script `./iiab-install` uses Ansible to run `/opt/iiab/iiab/iiab-stages.yml` + +2. `iiab-stages.yml` calls 9+ aggregate roles (AKA stages, these are the numbered directories above, in /opt/iiab/iiab/roles) and then the network role. It avoids repeating any of these 9 core install stages (in case of Internet glitches etc) by keeping a counter ("STAGE") in `/etc/iiab/iiab.env` (Aside: the network role can also later be run using `./iiab-network`) + +3. Each aggregate role AKA stage has a `<role>/tasks/main.yml` (formerly `<role>/meta/main.yml`) to invoke all needed roles and tasks. Please refer to the [IIAB Architecture](https://github.com/iiab/iiab/wiki/IIAB-Architecture) and [IIAB Variables]( https://github.com/iiab/iiab/wiki/IIAB-Variables) pages for more information. Installation ============ -Before you start the installation please refer to the [hardware section of FAQ](http://wiki.laptop.org/go/IIAB/FAQ#What_hardware_should_I_use.3F) page for memory, storage and network requirements for your platform. Also note that downloading content might take a long time on slower Internet connections. +Before you start the installation please refer to the [hardware section of FAQ](http://wiki.laptop.org/go/IIAB/FAQ#What_hardware_should_I_use.3F) page for memory, storage and network requirements for your platform. Also note that downloading content might take a long time on slower Internet connections. -If you are a developer, please consider [building Internet-in-a-Box from scratch](https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch). +Most all implementers should use IIAB's 1-line installer at http://download.iiab.io (click on the version number, e.g. [6.6](http://download.iiab.io/6.6/)). + +If you are a developer, consider [building Internet-in-a-Box from scratch](https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch). Please refer to the [IIAB Installation](https://github.com/iiab/iiab/wiki/IIAB-Installation) page for more information. Setting up development environment =================================== + ( This section uses experimental development environment for Internet-in-a-Box. It is being developed in the [iiab-dev-mode repository](https://github.com/arky/iiab-dev-mode). ) -This section provide a quick setup of Internet-in-a-Box (IIAB) development environment using [Vagrant](https://www.vagrantup.com/). You will need a computer with [virtualization enabled](https://www.virtualbox.org/manual/UserManual.html) and git, Vagrant (2.0 or later) and [VirtualBox](https://www.virtualbox.org/) installed. +This section provide a quick setup of Internet-in-a-Box (IIAB) development environment using [Vagrant](https://www.vagrantup.com/). You will need a computer with [virtualization enabled](https://www.virtualbox.org/manual/UserManual.html) and git, Vagrant (2.0 or later) and [VirtualBox](https://www.virtualbox.org/) installed. ## Requirements @@ -57,14 +75,15 @@ This section provide a quick setup of Internet-in-a-Box (IIAB) development envir * Editor ([Atom](www.atom.io), Emacs, vi, etc) ## Setup Instructions + 1. Check out the repository and its submodules onto your development machine. `git clone --recursive git@github.com:arky/iiab-dev-mode.git` -2. Change directory into 'iiab-dev-mode' with `cd iiab-dev-mode`. You can update all the submodules to latest master using `git submodule foreach git pull origin master` +2. Change directory into 'iiab-dev-mode' with `cd iiab-dev-mode`. You can update all the submodules to the latest master using `git submodule foreach git pull origin master` -3. Set up a vagrant machine with `vagrant up` and provision it with `vagrant provision`. Please select the available bridge network interface (wlan0 or eth0) that connects your host machine to the Internet. +3. Set up a vagrant machine with `vagrant up` and provision it with `vagrant provision`. Please select the available bridge network interface (wlan0 or eth0) that connects your host machine to the Internet. -4. Connect to your vagrant machine with `vagrant ssh`. All your local development files available as shared folder in `/opt/iiab` directory. +4. Connect to your vagrant machine with `vagrant ssh`. All your local development files available as shared folder in `/opt/iiab` directory. 5. Install IIAB itself from the Ansible playbooks by following [IIAB Installation](https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch) instructions: ``` @@ -82,11 +101,11 @@ This section provide a quick setup of Internet-in-a-Box (IIAB) development envir ``` 6. Hack away! -7. You can commit your local changes to your personal forks of Internet-in-a-Box repository and then send pull request to IIAB project. Once you forked a repository, you change directory into that repository and setting a default git remote push setting with the following command. +7. You can commit your local changes to your personal forks of Internet-in-a-Box repository and then send pull request to the IIAB project. Once you've forked a repository, you change directory into that repository and set a default git remote push setting with the following command: `cd <repo> && git remote set-url --push origin git@github.com:<your_username>/<your_forked_iiab_repo_name>.git` - Learn more by reading blog post [Different git Push & Pull(fetch) URLs](http://blog.yuriy.tymch.uk/2012/05/different-git-push-pullfetch-urls.html) and the [Git Basics - Working with Remotes](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) chapter of Scott Chacon and Ben Straub's "Git Pro" book. + Learn more by reading the blog post [Different git Push & Pull(fetch) URLs](http://blog.yuriy.tymch.uk/2012/05/different-git-push-pullfetch-urls.html) and the [Git Basics - Working with Remotes](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) chapter of Scott Chacon and Ben Straub's "Git Pro" book. 8. Once you are done, you can stop your vagrant machine with `vagrant halt` or remove it completely with `vagrant destroy`. @@ -95,7 +114,7 @@ Debugging Here are few strategies for debugging problems during the Internet-in-a-Box installation. -* When a installation task fails, Ansible halts printing out a descriptive error message to the screen. This error information is also written to `iiab-install.log` file within `/opt/iiab/iiab`. (Look through logs to check if any preceding line contains the error). +* When a installation task fails, Ansible halts printing out a descriptive error message to the screen. This error information is also written to `iiab-install.log` file within `/opt/iiab/iiab`. (Look through logs to check if any preceding line contains the error). * When an installation succeeds, the last lines printed on the screen will look like the following (failed=0): ``` PLAY RECAP ********************************************************************* @@ -113,7 +132,7 @@ Testing your code with Travis CI To maintain the quality of the Internet-in-a-Box (IIAB) code we use [Travis Continuous Integration (CI)](https://travis-ci.org) build infrastructure. Travis CI does tests to ensure the code syntax is correct and the code is formatted properly using `ansible` syntax checker, `ansible-lint` and `ansible-review` tools. The results of Travis CI Internet-in-a-Box (IIAB) could be seen [here](https://travis-ci.org/iiab/iiab). -Every pull request is automatically tested by Travis CI. The results of these tests are added to the pull request. This aids Internet-in-a-Box (IIAB) developers in reviewing the quality of the code in a pull request. +Every pull request [was] automatically tested by Travis CI. The results of these tests [were] added to the pull request. This aids Internet-in-a-Box (IIAB) developers in reviewing the quality of the code in a pull request [this approach is currently on hold as of July 2018 &mdash; if it's tuned up this or any similar CI/CD alternatives would be welcome!] To test your forked repository of Internet-in-a-Box (IIAB) code. You have to enable automatic build tests in your [Travis-ci.org](https://travis-ci.org) profile page. @@ -142,4 +161,4 @@ Get in touch * Join our [live calls](http://minutes.iiab.io) most Mondays and Thursday * Join us on IRC live chat: [#schoolserver](https://webchat.freenode.net/?channels=#schoolserver) on [freenode]( https://www.freenode.net/) * Post an idea or question to our [community forums](http://iiab.io/) -* Read our Frequently Asked Questions ([FAQ.IIAB.IO](http://FAQ.IIAB.IO)) +* Read ["What are the best places for community support?"](http://FAQ.IIAB.IO#What_are_the_best_places_for_community_support.3F) within our Frequently Asked Questions ([FAQ.IIAB.IO](http://FAQ.IIAB.IO)) From 1d1503eb6f4f64c2d9e5e188868a6f92fd86af0e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 17:36:13 -0400 Subject: [PATCH 285/374] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 1a058495e..e38cca8f1 100755 --- a/iiab-install +++ b/iiab-install @@ -145,4 +145,4 @@ echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -echo -e "\n./iiab-install COMPLETED IN /opt/iiab/iiab\n\n" +echo -e "./iiab-install COMPLETED IN /opt/iiab/iiab\n\n" From 01a8c486d9c686148ae438de471c066f9c72c159 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 19:07:59 -0400 Subject: [PATCH 286/374] Update iiab-install --- iiab-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iiab-install b/iiab-install index 1a058495e..40e426c0d 100755 --- a/iiab-install +++ b/iiab-install @@ -14,7 +14,7 @@ MIN_ANSIBLE_VER=2.5.6 export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" -echo -e "\n\n./iiab-install BEGUN IN /opt/iiab/iiab\n" +echo -e "\n\n./iiab-install BEGUN IN $CWD\n" if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then mkdir -p /etc/ansible/facts.d @@ -145,4 +145,4 @@ echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -echo -e "\n./iiab-install COMPLETED IN /opt/iiab/iiab\n\n" +echo -e "\n./iiab-install COMPLETED IN $CWD\n\n" From 90e2d5ff6023875fbaea16f49ac3b316c84f5d05 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 19:11:24 -0400 Subject: [PATCH 287/374] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 28ef6c6bb..8f358c813 100755 --- a/iiab-install +++ b/iiab-install @@ -145,4 +145,4 @@ echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -echo -e "./iiab-install COMPLETED IN $CWD\n\n" \ No newline at end of file +echo -e "./iiab-install COMPLETED IN $CWD\n\n" From cbb5ba9926e86d9f68899624956b15a969e62561 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 20 Jul 2018 19:17:15 -0400 Subject: [PATCH 288/374] Update iiab-install --- iiab-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iiab-install b/iiab-install index 8f358c813..d3dcb4df9 100755 --- a/iiab-install +++ b/iiab-install @@ -14,7 +14,7 @@ MIN_ANSIBLE_VER=2.5.6 export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" -echo -e "\n\n./iiab-install BEGUN IN $CWD\n" +echo -e "\n\n./iiab-install $* BEGUN IN $CWD\n" if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then mkdir -p /etc/ansible/facts.d @@ -145,4 +145,4 @@ echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -echo -e "./iiab-install COMPLETED IN $CWD\n\n" +echo -e "./iiab-install $* COMPLETED IN $CWD\n\n" From 051f5387dca3c4ed671e058c0bd4b74eaf9f77e0 Mon Sep 17 00:00:00 2001 From: tim-moody <tim@timmoody.com> Date: Fri, 20 Jul 2018 22:33:54 -0400 Subject: [PATCH 289/374] add concurrency to make kiwix lib --- roles/kiwix/templates/iiab-make-kiwix-lib | 25 ++++++++++++++++---- roles/kiwix/templates/iiab-make-kiwix-lib.py | 2 +- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/roles/kiwix/templates/iiab-make-kiwix-lib b/roles/kiwix/templates/iiab-make-kiwix-lib index ae06bc0cd..a7d2b7818 100644 --- a/roles/kiwix/templates/iiab-make-kiwix-lib +++ b/roles/kiwix/templates/iiab-make-kiwix-lib @@ -1,8 +1,25 @@ #!/bin/bash -{{ systemctl_program }} stop kiwix-serve -/usr/bin/iiab-make-kiwix-lib.py -#/usr/bin/iiab-make-apache-config.py -{{ systemctl_program }} start kiwix-serve +LOCK_PATH=/run/lock/kiwix +WAITLOCK="$LOCK_PATH/make-kiwix-lib-wait.LCK"; +RUNLOCK=WAITLOCK="$LOCK_PATH/make-kiwix-lib-run.LCK"; +exec 200>$WAITLOCK; +exec 201>$RUNLOCK; +if flock -n -e 200; then : + echo 'Waiting to run iiab-make-kiwix-lib.py' + # wait for up to 5 min + flock -x -w 300 201 + echo "Now running iiab-make-kiwix-lib.py" + # write to {{ kiwix_library_xml }}.tmp to minimize kiwix down + # zim map could be out of sync for a few seconds + /usr/bin/iiab-make-kiwix-lib.py + {{ systemctl_program }} stop kiwix-serve + rm {{ kiwix_library_xml }} + mv {{ kiwix_library_xml }}.tmp {{ kiwix_library_xml }} + {{ systemctl_program }} start kiwix-serve +else + echo "Can't get wait lock for iiab-make-kiwix-lib.py"; + exit 1; +fi exit 0 diff --git a/roles/kiwix/templates/iiab-make-kiwix-lib.py b/roles/kiwix/templates/iiab-make-kiwix-lib.py index 40f45cb82..6a06728dc 100644 --- a/roles/kiwix/templates/iiab-make-kiwix-lib.py +++ b/roles/kiwix/templates/iiab-make-kiwix-lib.py @@ -30,7 +30,7 @@ iiab_config_file = "{{ iiab_config_file }}" # Variables that should be read from config file # All of these variables will be read from config files and recomputed in init() iiab_zim_path = "{{ iiab_zim_path }}" -kiwix_library_xml = "{{ kiwix_library_xml }}" +kiwix_library_xml = "{{ kiwix_library_xml }}.tmp" iiab_base_path = "{{ iiab_base }}" kiwix_manage = iiab_base_path + "/kiwix/bin/kiwix-manage" From e4078f114e7d04f6187c5eb51ff85ec101a3b8aa Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sat, 21 Jul 2018 10:47:57 -0400 Subject: [PATCH 290/374] #942 "mongod --repair" blocks on "dirty journal files" --- roles/mongodb/templates/mongodb.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/templates/mongodb.service.j2 b/roles/mongodb/templates/mongodb.service.j2 index 4407efddc..2ebeb5a75 100644 --- a/roles/mongodb/templates/mongodb.service.j2 +++ b/roles/mongodb/templates/mongodb.service.j2 @@ -6,7 +6,7 @@ After=syslog.target network.target Type=simple User=mongodb Group=mongodb -ExecStartPre=/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} +#ExecStartPre=/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} ExecStart=/usr/bin/mongod -f {{ mongodb_conf }} ExecStop=/usr/bin/killall mongod From 296057e1b23b52d6a34d2fb8aa82f8cf1bffce04 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 10:42:20 -0400 Subject: [PATCH 291/374] Revert "Comment out "mongod --repair" as interim workaround to #942 [MongoDB/Sugarizer]" --- roles/mongodb/templates/mongodb.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/templates/mongodb.service.j2 b/roles/mongodb/templates/mongodb.service.j2 index 2ebeb5a75..4407efddc 100644 --- a/roles/mongodb/templates/mongodb.service.j2 +++ b/roles/mongodb/templates/mongodb.service.j2 @@ -6,7 +6,7 @@ After=syslog.target network.target Type=simple User=mongodb Group=mongodb -#ExecStartPre=/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} +ExecStartPre=/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} ExecStart=/usr/bin/mongod -f {{ mongodb_conf }} ExecStop=/usr/bin/killall mongod From aad50e0c4e665b458ae6cff4523f5bdd3ed28216 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 11:01:31 -0400 Subject: [PATCH 292/374] Cleaner for systemd, to diagnose #942 ? --- roles/mongodb/tasks/main.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 0bd2fa5a6..ae842d393 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -16,10 +16,10 @@ owner: mongodb with_items: - { path: '/var/run/mongodb' } - - { path: "{{ mongodb_db_path }}" } + - { path: "{{ mongodb_db_path }}" } # == /library/dbdata/mongodb/ - { path: '/var/log/mongodb' } -- name: Populate & position /etc/mongod.conf, /etc/systemd/system/mongodb.service +- name: Populate & position /etc/mongod.conf, mongodb.service template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -27,25 +27,26 @@ group: root mode: 0644 with_items: - - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' } - { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" } + - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' } + +- name: "systemctl daemon-reload" in case mongodb.service changed + systemd: + state: restarted + daemon_reload: yes - name: Restart service if enabled service: - name: "{{ item.name }}" + name: mongodb enabled: yes state: restarted - with_items: - - { name: mongodb } when: mongodb_enabled - name: Stop service if not enabled service: - name: "{{ item.name }}" + name: mongodb enabled: no state: stopped - with_items: - - { name: mongodb } when: not mongodb_enabled - name: Add 'mongodb' to list of services at /etc/iiab/iiab.ini From 88253db8cab9b87f503039b887c9758e0f90b904 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 11:06:38 -0400 Subject: [PATCH 293/374] Update main.yml --- roles/mongodb/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index ae842d393..ebf0abc73 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -30,7 +30,7 @@ - { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" } - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' } -- name: "systemctl daemon-reload" in case mongodb.service changed +- name: systemctl daemon-reload (in case mongodb.service changed?) systemd: state: restarted daemon_reload: yes From e01057fa662a1ef4801277e5149fce97e537b0f0 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 11:13:55 -0400 Subject: [PATCH 294/374] Ansible's systemd: may be cleaner than service: --- roles/mongodb/tasks/main.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index ebf0abc73..9fb26a37d 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -30,25 +30,35 @@ - { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" } - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' } -- name: systemctl daemon-reload (in case mongodb.service changed?) +- name: Restart service if enabled, with "systemctl daemon-reload" (in case mongodb.service changed?) systemd: - state: restarted - daemon_reload: yes - -- name: Restart service if enabled - service: name: mongodb enabled: yes state: restarted + daemon_reload: yes when: mongodb_enabled - name: Stop service if not enabled - service: + systemd: name: mongodb enabled: no state: stopped when: not mongodb_enabled +#- name: Restart service if enabled +# service: +# name: mongodb +# enabled: yes +# state: restarted +# when: mongodb_enabled + +#- name: Stop service if not enabled +# service: +# name: mongodb +# enabled: no +# state: stopped +# when: not mongodb_enabled + - name: Add 'mongodb' to list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ service_filelist }}" From 2e6fe83c9ed0466dd82e680d076a90af763feb91 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 11:22:30 -0400 Subject: [PATCH 295/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 0b33f1f1a..82634df2f 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -182,23 +182,38 @@ # 6. RESTART/STOP SYSTEMD SERVICE -- name: Enable services (all OS's) - service: - name: "{{ item.name }}" +- name: Enable service if enabled, with "systemctl daemon-reload" (in case sugarizer.service changed?) + systemd: + name: sugarizer enabled: yes state: restarted - with_items: -# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot usually does! (Is a "systemctl daemon-reload" or some such nec?) - - { name: sugarizer } + daemon_reload: yes when: sugarizer_enabled -- name: Disable service (all OS's) - service: +- name: Disable service if not enabled + systemd: name: sugarizer enabled: no state: stopped when: not sugarizer_enabled +#- name: Enable services (all OS's) +# service: +# name: "{{ item.name }}" +# enabled: yes +# state: restarted +# with_items: +## - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot usually does! (Is a "systemctl daemon-reload" or some such nec?) +# - { name: sugarizer } +# when: sugarizer_enabled + +#- name: Disable service (all OS's) +# service: +# name: sugarizer +# enabled: no +# state: stopped +# when: not sugarizer_enabled + - name: Add 'sugarizer' to list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ service_filelist }}" From d3fed1ab2cb0b00391a89bffa9eb813ff000de08 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 11:30:31 -0400 Subject: [PATCH 296/374] Update main.yml --- roles/mongodb/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 9fb26a37d..2c565558a 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -30,7 +30,7 @@ - { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" } - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' } -- name: Restart service if enabled, with "systemctl daemon-reload" (in case mongodb.service changed?) +- name: Enable+restart systemd service if mongodb_enabled, with "systemctl daemon-reload" (in case mongodb.service changed?) systemd: name: mongodb enabled: yes @@ -38,7 +38,7 @@ daemon_reload: yes when: mongodb_enabled -- name: Stop service if not enabled +- name: Disable+stop systemd service if mongodb_enabled: False systemd: name: mongodb enabled: no From 87297973d6a89f1992db25e24dbe763a9286cf80 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 11:31:56 -0400 Subject: [PATCH 297/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 82634df2f..7ce9a694b 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -182,7 +182,7 @@ # 6. RESTART/STOP SYSTEMD SERVICE -- name: Enable service if enabled, with "systemctl daemon-reload" (in case sugarizer.service changed?) +- name: Enable+restart systemd service if sugarizer_enabled, with "systemctl daemon-reload" (in case mongodb.service changed?) systemd: name: sugarizer enabled: yes @@ -190,7 +190,7 @@ daemon_reload: yes when: sugarizer_enabled -- name: Disable service if not enabled +- name: Disable+stop systemd service if sugarizer_enabled: False systemd: name: sugarizer enabled: no From 8530beb864eae265291c268fe22b76225d5d5134 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 11:35:43 -0400 Subject: [PATCH 298/374] Update main.yml --- roles/mongodb/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 2c565558a..c4c5cafde 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -38,7 +38,7 @@ daemon_reload: yes when: mongodb_enabled -- name: Disable+stop systemd service if mongodb_enabled: False +- name: 'Disable+stop systemd service if mongodb_enabled: False' systemd: name: mongodb enabled: no From a0074aed4e720c48e099209380217048dfd58d36 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 11:36:10 -0400 Subject: [PATCH 299/374] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 7ce9a694b..43f506c2e 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -190,7 +190,7 @@ daemon_reload: yes when: sugarizer_enabled -- name: Disable+stop systemd service if sugarizer_enabled: False +- name: 'Disable+stop systemd service if sugarizer_enabled: False' systemd: name: sugarizer enabled: no From 65b0d5f1bfc6fb4714aa536e247f1285cec4ff15 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 14:36:14 -0400 Subject: [PATCH 300/374] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index b6be18fed..4c9ebb2c4 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -133,8 +133,8 @@ iiab_usb_lib_show_all: True # WARNING: CALIBRE REQUIRES X WINDOWS / OPENGL LIBRARIES. Consider installing # an OS that includes a GUI (desktop) environment if you need Calibre E-Books. -calibre_install: True -calibre_enabled: True +calibre_install: False +calibre_enabled: False # Try .deb upgrade of Calibre (like vars/raspbian-9.yml already does) # calibre_via_debs: True calibre_unstable_debs: False From 053d802105d0b1082c14c4418e0d0ca142a31ce6 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 14:36:45 -0400 Subject: [PATCH 301/374] Update local_vars_medium_vpn.yml --- vars/local_vars_medium_vpn.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/local_vars_medium_vpn.yml b/vars/local_vars_medium_vpn.yml index 11d2af017..b68b23f20 100644 --- a/vars/local_vars_medium_vpn.yml +++ b/vars/local_vars_medium_vpn.yml @@ -133,8 +133,8 @@ iiab_usb_lib_show_all: True # WARNING: CALIBRE REQUIRES X WINDOWS / OPENGL LIBRARIES. Consider installing # an OS that includes a GUI (desktop) environment if you need Calibre E-Books. -calibre_install: True -calibre_enabled: True +calibre_install: False +calibre_enabled: False # Try .deb upgrade of Calibre (like vars/raspbian-9.yml already does) # calibre_via_debs: True calibre_unstable_debs: False From 1a836c21196248d920c02059776552e6de770629 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 16:53:46 -0400 Subject: [PATCH 302/374] Update calibre-install-latest.sh --- scripts/calibre-install-latest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/calibre-install-latest.sh b/scripts/calibre-install-latest.sh index 75142a5c2..bf748f158 100755 --- a/scripts/calibre-install-latest.sh +++ b/scripts/calibre-install-latest.sh @@ -8,7 +8,7 @@ export DEBIAN_FRONTEND=noninteractive # Drags in stock desktop dependencies without too much from testing below apt -y install dirmngr -# Prepares to update to latest from testing +# Prepares to update to latest from debian testing apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010 echo "deb http://deb.debian.org/debian testing main" >> /etc/apt/sources.list.d/debian-testing.list apt update From 72e234ef198bc8b90e17bb94a621c89e2cc0ccf1 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 16:54:24 -0400 Subject: [PATCH 303/374] Update calibre-install-latest-rpi.sh --- scripts/calibre-install-latest-rpi.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/calibre-install-latest-rpi.sh b/scripts/calibre-install-latest-rpi.sh index 092cbb00c..869a4b64f 100755 --- a/scripts/calibre-install-latest-rpi.sh +++ b/scripts/calibre-install-latest-rpi.sh @@ -6,11 +6,12 @@ # SEE COMMENTS AT THE TOP OF scripts/calibre-install-packages.sh export DEBIAN_FRONTEND=noninteractive -# Prepares to update to latest from testing +# Prepares to update to latest from raspbian testing echo "deb http://raspbian.raspberrypi.org/raspbian/ testing main" > /etc/apt/sources.list.d/rpi-testing.list apt update apt -y install calibre calibre-bin -# Removes last line, safer than: rm /etc/apt/sources.list.d/rpi-testing.list -sed -i '$ d' /etc/apt/sources.list.d/rpi-testing.list +## Removes last line, safer than: rm /etc/apt/sources.list.d/rpi-testing.list +#sed -i '$ d' /etc/apt/sources.list.d/rpi-testing.list +rm /etc/apt/sources.list.d/rpi-testing.list # Clears the cache of testing apt update From 5d4fdbf5e28f862b9579024b3ecb3a7862e70c51 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 16:54:41 -0400 Subject: [PATCH 304/374] Update calibre-install-latest.sh --- scripts/calibre-install-latest.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/calibre-install-latest.sh b/scripts/calibre-install-latest.sh index bf748f158..c8bf11ebd 100755 --- a/scripts/calibre-install-latest.sh +++ b/scripts/calibre-install-latest.sh @@ -13,7 +13,8 @@ apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010 echo "deb http://deb.debian.org/debian testing main" >> /etc/apt/sources.list.d/debian-testing.list apt update apt -y install libqt5core5a python-lxml calibre calibre-bin -# Removes last line, safer than: rm /etc/apt/sources.list.d/debian-testing.list -sed -i '$ d' /etc/apt/sources.list.d/debian-testing.list +## Removes last line, safer than: rm /etc/apt/sources.list.d/debian-testing.list +#sed -i '$ d' /etc/apt/sources.list.d/debian-testing.list +rm /etc/apt/sources.list.d/debian-testing.list # Clears the cache of testing apt update From 8eece31a6556d0fbcf73f9542981bee819af619c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 17:03:04 -0400 Subject: [PATCH 305/374] Create calibre-install-latest-rpi-plus.sh --- scripts/calibre-install-latest-rpi-plus.sh | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 scripts/calibre-install-latest-rpi-plus.sh diff --git a/scripts/calibre-install-latest-rpi-plus.sh b/scripts/calibre-install-latest-rpi-plus.sh new file mode 100644 index 000000000..0e4d89f4e --- /dev/null +++ b/scripts/calibre-install-latest-rpi-plus.sh @@ -0,0 +1,33 @@ + +#!/bin/bash + +# Calibre 3.27.1 .deb's were released for Raspbian 2018-07-22 but requires +# python-pyqt5 from debian testing, to overcome error: +# +# The following packages have unmet dependencies: +# calibre : Depends: python-pyqt5 (>= 5.11.2+dfsg-1) but 5.10.1+dfsg-2+rpi1 is to be installed +# +# More details @ https://github.com/iiab/iiab/issues/948 and +# https://www.mobileread.com/forums/showthread.php?p=3729117#post3729117 + +# Thanks to Jerry Vonau (https://github.com/jvonau) who made this critical +# breakthrough possible! +# +# SEE COMMENTS AT THE TOP OF scripts/calibre-install-packages.sh + +export DEBIAN_FRONTEND=noninteractive + +# Prepares to update from debian testing +apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010 +echo "deb http://deb.debian.org/debian testing main" >> /etc/apt/sources.list.d/debian-testing.list +apt update +apt -y install python-pyqt5 +rm /etc/apt/sources.list.d/debian-testing.list + +# Prepares to update from raspbian testing +echo "deb http://raspbian.raspberrypi.org/raspbian/ testing main" > /etc/apt/sources.list.d/rpi-testing.list +apt update +apt -y install calibre calibre-bin +rm /etc/apt/sources.list.d/rpi-testing.list +# Clears the cache of testing +apt update From c450a46f49fa2bd6ccdd2c6d87245b27848d3525 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 17:06:00 -0400 Subject: [PATCH 306/374] Update debs.yml --- roles/calibre/tasks/debs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/calibre/tasks/debs.yml b/roles/calibre/tasks/debs.yml index 0d13d9b9d..ea19185f7 100644 --- a/roles/calibre/tasks/debs.yml +++ b/roles/calibre/tasks/debs.yml @@ -28,7 +28,8 @@ # when: is_rpi and internet_available - name: Upgrade to latest Calibre using .deb's from testing (rpi) - command: scripts/calibre-install-latest-rpi.sh # SEEMS TO ONCE AGAIN WORK since Calibre 3.26.0 (Calibre 3.24-3.25 required above prereq calibre-install-packages.sh then Debian's own calibre-install-latest.sh to be bootable in Zero W) + command: scripts/calibre-install-latest-rpi-plus.sh # for Calibre 3.27.1+ starting 2018-07-22 -- PLEASE TEST IF BOOTABLE IN Zero W? + #command: scripts/calibre-install-latest-rpi.sh # SEEMS TO ONCE AGAIN WORK since Calibre 3.26.0 (Calibre 3.24-3.25 required above prereq calibre-install-packages.sh then Debian's own calibre-install-latest.sh to be bootable in Zero W) when: is_rpi and internet_available - name: Upgrade to Calibre testing .deb's - target Ubuntu 16.04 (not rpi and not ubuntu_18) From e756b27d23aa00c5aa032ef67bf534fc5fecd34a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 17:10:14 -0400 Subject: [PATCH 307/374] Update debs.yml --- roles/calibre/tasks/debs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/calibre/tasks/debs.yml b/roles/calibre/tasks/debs.yml index ea19185f7..8fb0b04a8 100644 --- a/roles/calibre/tasks/debs.yml +++ b/roles/calibre/tasks/debs.yml @@ -28,8 +28,8 @@ # when: is_rpi and internet_available - name: Upgrade to latest Calibre using .deb's from testing (rpi) - command: scripts/calibre-install-latest-rpi-plus.sh # for Calibre 3.27.1+ starting 2018-07-22 -- PLEASE TEST IF BOOTABLE IN Zero W? - #command: scripts/calibre-install-latest-rpi.sh # SEEMS TO ONCE AGAIN WORK since Calibre 3.26.0 (Calibre 3.24-3.25 required above prereq calibre-install-packages.sh then Debian's own calibre-install-latest.sh to be bootable in Zero W) + command: scripts/calibre-install-latest-rpi-plus.sh # HOPE IT WORKS FOR Calibre 3.27.1+ starting 2018-07-22 -- PLEASE TEST IF BOOTABLE IN Zero W? + #command: scripts/calibre-install-latest-rpi.sh # WORKED FOR Calibre 3.26.0 (Calibre 3.24.x & 3.25 required above prereq calibre-install-packages.sh then Debian's own calibre-install-latest.sh to be bootable in Zero W) when: is_rpi and internet_available - name: Upgrade to Calibre testing .deb's - target Ubuntu 16.04 (not rpi and not ubuntu_18) From 5cd441353cce39bd90282e4bcb7cccb6db832e43 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 17:11:00 -0400 Subject: [PATCH 308/374] Update debs.yml --- roles/calibre/tasks/debs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/calibre/tasks/debs.yml b/roles/calibre/tasks/debs.yml index 8fb0b04a8..43566b8fb 100644 --- a/roles/calibre/tasks/debs.yml +++ b/roles/calibre/tasks/debs.yml @@ -29,7 +29,7 @@ - name: Upgrade to latest Calibre using .deb's from testing (rpi) command: scripts/calibre-install-latest-rpi-plus.sh # HOPE IT WORKS FOR Calibre 3.27.1+ starting 2018-07-22 -- PLEASE TEST IF BOOTABLE IN Zero W? - #command: scripts/calibre-install-latest-rpi.sh # WORKED FOR Calibre 3.26.0 (Calibre 3.24.x & 3.25 required above prereq calibre-install-packages.sh then Debian's own calibre-install-latest.sh to be bootable in Zero W) + #command: scripts/calibre-install-latest-rpi.sh # WORKED FOR Calibre 3.26.x (Calibre 3.24.x & 3.25 required above prereq calibre-install-packages.sh then Debian's own calibre-install-latest.sh to be bootable in Zero W) when: is_rpi and internet_available - name: Upgrade to Calibre testing .deb's - target Ubuntu 16.04 (not rpi and not ubuntu_18) From 2a854c1bb9af98fa914275015af0cc396e5e576b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 17:11:32 -0400 Subject: [PATCH 309/374] Update calibre-install-latest-rpi-plus.sh --- scripts/calibre-install-latest-rpi-plus.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/calibre-install-latest-rpi-plus.sh b/scripts/calibre-install-latest-rpi-plus.sh index 0e4d89f4e..cf9d5114c 100644 --- a/scripts/calibre-install-latest-rpi-plus.sh +++ b/scripts/calibre-install-latest-rpi-plus.sh @@ -1,4 +1,3 @@ - #!/bin/bash # Calibre 3.27.1 .deb's were released for Raspbian 2018-07-22 but requires From 11e0003705d76e6e02e2417552ca57e023e72182 Mon Sep 17 00:00:00 2001 From: root <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 17:30:33 -0400 Subject: [PATCH 310/374] chmod +x scripts/calibre-install-latest-rpi-plus.sh --- scripts/calibre-install-latest-rpi-plus.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/calibre-install-latest-rpi-plus.sh diff --git a/scripts/calibre-install-latest-rpi-plus.sh b/scripts/calibre-install-latest-rpi-plus.sh old mode 100644 new mode 100755 From e3fda6ad2011268e2072c4d4d2e3619c2403723d Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 17:52:47 -0400 Subject: [PATCH 311/374] Revert "Calibre 3.27.1 glitch so remove from MEDIUM-sized local_vars.yml" --- vars/local_vars_medium.yml | 4 ++-- vars/local_vars_medium_vpn.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index 4c9ebb2c4..b6be18fed 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -133,8 +133,8 @@ iiab_usb_lib_show_all: True # WARNING: CALIBRE REQUIRES X WINDOWS / OPENGL LIBRARIES. Consider installing # an OS that includes a GUI (desktop) environment if you need Calibre E-Books. -calibre_install: False -calibre_enabled: False +calibre_install: True +calibre_enabled: True # Try .deb upgrade of Calibre (like vars/raspbian-9.yml already does) # calibre_via_debs: True calibre_unstable_debs: False diff --git a/vars/local_vars_medium_vpn.yml b/vars/local_vars_medium_vpn.yml index b68b23f20..11d2af017 100644 --- a/vars/local_vars_medium_vpn.yml +++ b/vars/local_vars_medium_vpn.yml @@ -133,8 +133,8 @@ iiab_usb_lib_show_all: True # WARNING: CALIBRE REQUIRES X WINDOWS / OPENGL LIBRARIES. Consider installing # an OS that includes a GUI (desktop) environment if you need Calibre E-Books. -calibre_install: False -calibre_enabled: False +calibre_install: True +calibre_enabled: True # Try .deb upgrade of Calibre (like vars/raspbian-9.yml already does) # calibre_via_debs: True calibre_unstable_debs: False From 772a200a5ccd3a91eec54fe17ab86086d60269cb Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 18:49:32 -0400 Subject: [PATCH 312/374] Update main.yml --- roles/0-init/tasks/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index 9673811a2..749910ef3 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -10,7 +10,7 @@ first_run: True when: not NewInstall.stat.exists -# we need to inialize the ini file and only write the location and version sections once and only +# We need to inialize the ini file and only write the location and version sections once and only # once to preserve the install date and git hash. - name: Write iiab_ini.yml for the first time include_tasks: first_run.yml @@ -131,15 +131,15 @@ python_path: /usr/local/lib/python2.7/dist-packages/ when: is_debuntu -# for various reasons the mysql service can not be enabled on fedora 20, -# but 'mariadb', which is its real name can -# on fedora 18 we need to use 'mysqld' +# For various reasons the mysql service can not be enabled on fedora 20, +# but 'mariadb', which is its real name can. +# On Fedora 18 we need to use 'mysqld' -- name: Set mysqld_service to mariadb by default +- name: Set mysql_service to mariadb by default set_fact: mysql_service: mariadb -- name: Set mysqld_service to mysqld etc (Fedora 18) +- name: Set mysql_service to mysqld etc (Fedora 18) set_fact: mysql_service: mysqld no_NM_reload: True @@ -165,7 +165,7 @@ include_tasks: hostname.yml when: FQDN_changed -- name: Add version section +- name: Add 'runtime' to list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ iiab_config_file }}" section: runtime From 881783dee2bad2dc82aded0089c3eb34a1f65902 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 19:44:34 -0400 Subject: [PATCH 313/374] Update main.yml --- roles/nextcloud/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index 3252efa43..136bfea1a 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -18,6 +18,7 @@ url: "{{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }}" dest: "{{ downloads_dir }}/{{ nextcloud_src_file }}" force: yes + validate_certs: False # TEMPORARY ON/AFTER 2018-07-22 AS download.nextcloud.com CERT EXPIRED: https://github.com/iiab/iiab/issues/954 timeout: "{{ download_timeout }}" when: internet_available and nextcloud_force_install async: 900 From be8c28da9a7a980851f68fe6e1c36c8ebf4182ef Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 19:54:17 -0400 Subject: [PATCH 314/374] Revert "TEMP Fixes #954 [download.nextcloud.com's SSL/TLS cert expired 2018-07-22 preventing MEDIUM+BIG IIAB installs]" --- roles/nextcloud/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index 136bfea1a..3252efa43 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -18,7 +18,6 @@ url: "{{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }}" dest: "{{ downloads_dir }}/{{ nextcloud_src_file }}" force: yes - validate_certs: False # TEMPORARY ON/AFTER 2018-07-22 AS download.nextcloud.com CERT EXPIRED: https://github.com/iiab/iiab/issues/954 timeout: "{{ download_timeout }}" when: internet_available and nextcloud_force_install async: 900 From 8ba83149dc4ee1cf0a4b7eeb3a6b71e18294dc1a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 22 Jul 2018 19:56:18 -0400 Subject: [PATCH 315/374] Update main.yml --- roles/nextcloud/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index 3252efa43..05ebee138 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -18,6 +18,7 @@ url: "{{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }}" dest: "{{ downloads_dir }}/{{ nextcloud_src_file }}" force: yes + #validate_certs: False # TEMPORARY ON/AFTER 2018-07-22 AS download.nextcloud.com CERT EXPIRED: https://github.com/iiab/iiab/issues/954 timeout: "{{ download_timeout }}" when: internet_available and nextcloud_force_install async: 900 From 449fd3fafdc4b03386a7a17a7e1fb8c52a5d1c2f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 08:05:13 -0400 Subject: [PATCH 316/374] Update main.yml --- roles/0-init/tasks/main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index 749910ef3..b0223aa1e 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -10,8 +10,8 @@ first_run: True when: not NewInstall.stat.exists -# We need to inialize the ini file and only write the location and version sections once and only -# once to preserve the install date and git hash. +# We need to inialize the ini file and only write the location and version +# sections once and only once to preserve the install date and git hash. - name: Write iiab_ini.yml for the first time include_tasks: first_run.yml when: first_run @@ -41,7 +41,8 @@ exFAT_enabled: True when: xo_model != "none" -# Discover do we have a gateway? -- if ansible detects gateway, becomes WAN candidate +# Discover: do we have a gateway? +# If Ansible detects gateway, becomes WAN candidate. - name: Finding gateway set_fact: discovered_wan_iface: "{{ ansible_default_ipv4.alias }}" @@ -79,7 +80,7 @@ path: /tmp/heart-beat.txt state: absent -# Put all computed vars here so derive properly from any prior var file +# Put all computed vars here so derive properly from any prior var file. - name: If the TZ is not set in env, set it to UTC include_tasks: tz.yml @@ -98,10 +99,10 @@ mysql_install: True mysql_enabled: True -# we decided to enable mysql unconditionally +# We decided to enable mysql unconditionally. # when: elgg_enabled or rachel_enabled or owncloud_enabled or phpmyadmin_enabled or wordpress_enabled or iiab_menu_install -# Commenting out MongoDB on a trial basis, for a more basic/lightweight Sugarizer, per https://github.com/iiab/iiab/pull/427 +# Late 2017: Had commented out MongoDB on a trial basis, for a more basic/lightweight Sugarizer, per https://github.com/iiab/iiab/pull/427 - name: Turn on mongodb if sugarizer enabled set_fact: mongodb_install: True @@ -131,9 +132,8 @@ python_path: /usr/local/lib/python2.7/dist-packages/ when: is_debuntu -# For various reasons the mysql service can not be enabled on fedora 20, -# but 'mariadb', which is its real name can. -# On Fedora 18 we need to use 'mysqld' +# For various reasons the mysql service cannot be enabled on Fedora 20, but +# 'mariadb', which is its real name can. On Fedora 18 we need to use 'mysqld'. - name: Set mysql_service to mariadb by default set_fact: @@ -165,7 +165,7 @@ include_tasks: hostname.yml when: FQDN_changed -- name: Add 'runtime' to list of services at /etc/iiab/iiab.ini +- name: Add 'runtime' section alongside list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ iiab_config_file }}" section: runtime From 4ddc7c4461f00a7c1dd0a3170f71b306cae264f8 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 09:44:17 -0400 Subject: [PATCH 317/374] Update mongodb.service.j2 --- roles/mongodb/templates/mongodb.service.j2 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/roles/mongodb/templates/mongodb.service.j2 b/roles/mongodb/templates/mongodb.service.j2 index 4407efddc..1ae050ae8 100644 --- a/roles/mongodb/templates/mongodb.service.j2 +++ b/roles/mongodb/templates/mongodb.service.j2 @@ -1,14 +1,20 @@ [Unit] Description=High-performance, schema-free document-oriented database After=syslog.target network.target - + [Service] Type=simple User=mongodb Group=mongodb -ExecStartPre=/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} +# FAILS (after power failures, etc) as --repair cannot run when lock file exists: (https://github.com/iiab/iiab/issues/942) +#ExecStartPre=/usr/bin/mongod --repair --dbpath /library/dbdata/mongodb +# FAILS as systemd cannot run bash here: +#ExecStartPre=if [ ! -f /library/dbdata/mongodb/mongod.lock ]; then /usr/bin/mongod --repair --dbpath {{ mongodb_db_path }}; fi +ExecStartPre=/usr/bin/iiab-mongodb-repair-if-no-lock ExecStart=/usr/bin/mongod -f {{ mongodb_conf }} ExecStop=/usr/bin/killall mongod - +# killall's SIGTERM (15) seems fine, to induce a graceful stop. This would work too: +#ExecStop=mongod --dbpath {{ mongodb_db_path }} --shutdown + [Install] WantedBy=multi-user.target From 3ab57666c20aefe4e90d86ee38c7684977025a45 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 09:51:11 -0400 Subject: [PATCH 318/374] Update main.yml --- roles/mongodb/defaults/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/mongodb/defaults/main.yml b/roles/mongodb/defaults/main.yml index 6aed9834a..61d1d951f 100644 --- a/roles/mongodb/defaults/main.yml +++ b/roles/mongodb/defaults/main.yml @@ -1,5 +1,6 @@ mongodb_install: False mongodb_enabled: False -mongodb_db_path: "{{ content_base }}/dbdata/mongodb" # == /library/dbdata/mongodb/ mongodb_conf: /etc/mongod.conf +mongodb_db_path: "{{ content_base }}/dbdata/mongodb" # == /library/dbdata/mongodb/ +mongodb_db_lock_file: "{{ mongodb_db_path }}/mongod.lock" From 08992f47be472cd3b95149f4cc8aa0e5cfc9b10f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 09:52:26 -0400 Subject: [PATCH 319/374] Create iiab-mongodb-repair-if-no-lock.j2 --- roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 diff --git a/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 b/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 new file mode 100644 index 000000000..4cde26331 --- /dev/null +++ b/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ ! -f {{ mongodb_db_lock_file }} ]; then + /usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} +else + echo '"mongod --repair" cannot run when {{ mongodb_db_lock_file }} present.' +fi From b08e12fba3fd14e7329353e3471d94ca6583ec36 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 09:57:45 -0400 Subject: [PATCH 320/374] Update iiab-mongodb-repair-if-no-lock.j2 --- roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 b/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 index 4cde26331..f10b05c30 100644 --- a/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 +++ b/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 @@ -3,5 +3,5 @@ if [ ! -f {{ mongodb_db_lock_file }} ]; then /usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} else - echo '"mongod --repair" cannot run when {{ mongodb_db_lock_file }} present.' + echo '"mongod --repair" cannot run when {{ mongodb_db_lock_file }} present.' >&2 # Output to STDERR but keep going, so /etc/systems/system/mongodb.service continues fi From 5c55e16b06f2965c0af670618ffe46171cc0d01e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 10:01:21 -0400 Subject: [PATCH 321/374] Update main.yml --- roles/mongodb/tasks/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index c4c5cafde..e52e10360 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -25,10 +25,11 @@ dest: "{{ item.dest }}" owner: root group: root - mode: 0644 + mode: "{{ item.mode }}" with_items: - - { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" } - - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' } + - { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}", mode: '0644' } + - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service', mode: '0644' } + - { src: 'iiab-mongodb-repair-if-no-lock.j2', dest: '/usr/bin/iiab-mongodb-repair-if-no-lock', mode: '0755' } - name: Enable+restart systemd service if mongodb_enabled, with "systemctl daemon-reload" (in case mongodb.service changed?) systemd: From 37591a612ccf6bf6e585828c2d519339fb932a44 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 10:07:04 -0400 Subject: [PATCH 322/374] Update iiab-mongodb-repair-if-no-lock.j2 --- roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 b/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 index f10b05c30..790748103 100644 --- a/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 +++ b/roles/mongodb/templates/iiab-mongodb-repair-if-no-lock.j2 @@ -1,7 +1,7 @@ #!/bin/bash -if [ ! -f {{ mongodb_db_lock_file }} ]; then - /usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} -else +if [ -f {{ mongodb_db_lock_file }} ]; then echo '"mongod --repair" cannot run when {{ mongodb_db_lock_file }} present.' >&2 # Output to STDERR but keep going, so /etc/systems/system/mongodb.service continues +else + /usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} fi From 8dadcd0483b29326c357ed204f741876f40e75a8 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 10:41:03 -0400 Subject: [PATCH 323/374] Update local_vars_min.yml --- vars/local_vars_min.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index c8ce902db..8f5ee2ba1 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -190,11 +190,9 @@ pathagar_install: False pathagar_enabled: False # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 +# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 sugarizer_install: False sugarizer_enabled: False -# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal! -# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail -# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues # 8-MGMT-TOOLS From 6661c839dd1c32b65a65ce452afe6c663e207486 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 10:41:51 -0400 Subject: [PATCH 324/374] Update local_vars_min_vpn.yml --- vars/local_vars_min_vpn.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vars/local_vars_min_vpn.yml b/vars/local_vars_min_vpn.yml index 31725c58f..015bc0ee0 100644 --- a/vars/local_vars_min_vpn.yml +++ b/vars/local_vars_min_vpn.yml @@ -190,11 +190,9 @@ pathagar_install: False pathagar_enabled: False # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 +# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 sugarizer_install: False sugarizer_enabled: False -# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal! -# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail -# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues # 8-MGMT-TOOLS From 1b56268fcc9aed3767a5a91a33a906c3f455895c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 10:42:19 -0400 Subject: [PATCH 325/374] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index b6be18fed..fd109e255 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -190,11 +190,9 @@ pathagar_install: False pathagar_enabled: False # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 +# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 sugarizer_install: True sugarizer_enabled: True -# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal! -# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail -# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues # 8-MGMT-TOOLS From a131a8b540472633311351d2874a20638c3d3205 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 10:42:42 -0400 Subject: [PATCH 326/374] Update local_vars_medium_vpn.yml --- vars/local_vars_medium_vpn.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vars/local_vars_medium_vpn.yml b/vars/local_vars_medium_vpn.yml index 11d2af017..b82c44260 100644 --- a/vars/local_vars_medium_vpn.yml +++ b/vars/local_vars_medium_vpn.yml @@ -190,11 +190,9 @@ pathagar_install: False pathagar_enabled: False # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 +# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 sugarizer_install: True sugarizer_enabled: True -# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal! -# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail -# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues # 8-MGMT-TOOLS From be28c217c9db7f8db899a54b0457fedc6abd046b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 10:43:07 -0400 Subject: [PATCH 327/374] Update local_vars_big.yml --- vars/local_vars_big.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index 56a81d9e8..7e693f6c3 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -190,11 +190,9 @@ pathagar_install: False pathagar_enabled: False # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 +# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 sugarizer_install: True sugarizer_enabled: True -# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal! -# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail -# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues # 8-MGMT-TOOLS From cb0eac169d469e3cabf6bbe43e73a54d47269e42 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 10:43:31 -0400 Subject: [PATCH 328/374] Update local_vars_big_vpn.yml --- vars/local_vars_big_vpn.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vars/local_vars_big_vpn.yml b/vars/local_vars_big_vpn.yml index 6911b7c38..33e5aa6e8 100644 --- a/vars/local_vars_big_vpn.yml +++ b/vars/local_vars_big_vpn.yml @@ -190,11 +190,9 @@ pathagar_install: False pathagar_enabled: False # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 +# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 sugarizer_install: True sugarizer_enabled: True -# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal! -# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail -# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues # 8-MGMT-TOOLS From 373ca4066d5cdedcefe94d02aecdee5a3c161259 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 10:45:29 -0400 Subject: [PATCH 329/374] Update default_vars.yml --- vars/default_vars.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 015e9ce46..8f097e95a 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -342,6 +342,8 @@ pathagar_install: False pathagar_enabled: False # Sugarizer +# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 +# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 sugarizer_install: True sugarizer_enabled: False sugarizer_port: 8089 From 6c88827fe65276c239e7d2c3e769fe46e9c31714 Mon Sep 17 00:00:00 2001 From: tim-moody <tim@timmoody.com> Date: Mon, 23 Jul 2018 15:18:31 -0400 Subject: [PATCH 330/374] fixes after testing --- roles/kiwix/templates/iiab-make-kiwix-lib | 55 +++++++++++--------- roles/kiwix/templates/iiab-make-kiwix-lib.py | 9 ++-- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/roles/kiwix/templates/iiab-make-kiwix-lib b/roles/kiwix/templates/iiab-make-kiwix-lib index a7d2b7818..5680470f3 100644 --- a/roles/kiwix/templates/iiab-make-kiwix-lib +++ b/roles/kiwix/templates/iiab-make-kiwix-lib @@ -1,25 +1,30 @@ -#!/bin/bash - -LOCK_PATH=/run/lock/kiwix -WAITLOCK="$LOCK_PATH/make-kiwix-lib-wait.LCK"; -RUNLOCK=WAITLOCK="$LOCK_PATH/make-kiwix-lib-run.LCK"; -exec 200>$WAITLOCK; -exec 201>$RUNLOCK; - -if flock -n -e 200; then : - echo 'Waiting to run iiab-make-kiwix-lib.py' - # wait for up to 5 min - flock -x -w 300 201 - echo "Now running iiab-make-kiwix-lib.py" - # write to {{ kiwix_library_xml }}.tmp to minimize kiwix down - # zim map could be out of sync for a few seconds - /usr/bin/iiab-make-kiwix-lib.py - {{ systemctl_program }} stop kiwix-serve - rm {{ kiwix_library_xml }} - mv {{ kiwix_library_xml }}.tmp {{ kiwix_library_xml }} - {{ systemctl_program }} start kiwix-serve -else - echo "Can't get wait lock for iiab-make-kiwix-lib.py"; - exit 1; -fi -exit 0 +#!/bin/bash + +LOCK_PATH=/run/lock/kiwix +mkdir -p $LOCK_PATH + +WAITLOCK="$LOCK_PATH/make-kiwix-lib-wait.LCK"; +RUNLOCK="$LOCK_PATH/kiwix-lib-access.LCK"; +KIWIXLIB={{ kiwix_library_xml }} + +exec 200>$WAITLOCK; +exec 201>$RUNLOCK; + +if flock -n -e 200; then : + echo 'Waiting to run iiab-make-kiwix-lib.py' + # wait for up to 5 min + flock -x -w 300 201 + flock -u 200 # unlock queue + echo "Now running iiab-make-kiwix-lib.py" + # write to {{ kiwix_library_xml }}.tmp to minimize kiwix down + # zim map could be out of sync for a few seconds + /usr/bin/iiab-make-kiwix-lib.py + {{ systemctl_program }} stop kiwix-serve + rm $KIWIXLIB + mv $KIWIXLIB.tmp $KIWIXLIB + {{ systemctl_program }} start kiwix-serve +else + echo "Can't get wait lock for iiab-make-kiwix-lib.py"; + exit 1; +fi +exit 0 diff --git a/roles/kiwix/templates/iiab-make-kiwix-lib.py b/roles/kiwix/templates/iiab-make-kiwix-lib.py index 6a06728dc..d331f194d 100644 --- a/roles/kiwix/templates/iiab-make-kiwix-lib.py +++ b/roles/kiwix/templates/iiab-make-kiwix-lib.py @@ -2,7 +2,7 @@ """ - Creates library.xml file for kiwix from contents of /zims/content and index + Creates temp library.xml file for kiwix from contents of /zims/content and index Author: Tim Moody <tim(at)timmoody(dot)com> Contributors: Jerry Vonau <jvonau3(at)gmail.com> @@ -30,7 +30,9 @@ iiab_config_file = "{{ iiab_config_file }}" # Variables that should be read from config file # All of these variables will be read from config files and recomputed in init() iiab_zim_path = "{{ iiab_zim_path }}" -kiwix_library_xml = "{{ kiwix_library_xml }}.tmp" + +# Later we will append .tmp to file name +kiwix_library_xml = "{{ kiwix_library_xml }}" iiab_base_path = "{{ iiab_base }}" kiwix_manage = iiab_base_path + "/kiwix/bin/kiwix-manage" @@ -41,8 +43,9 @@ old_zim_map = {"bad.zim" : "unparseable name"} def main(): """Server routine""" - + global kiwix_library_xml init() + kiwix_library_xml += '.tmp' # write to temp file # remove existing file try: From 59e53938a017ea3e143f234fd44fe4b812223c35 Mon Sep 17 00:00:00 2001 From: Tim Moody <tim@timmoody.com> Date: Mon, 23 Jul 2018 15:51:14 -0400 Subject: [PATCH 331/374] add flock package --- roles/2-common/tasks/packages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index f64c25936..43b1edffe 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -71,6 +71,7 @@ - pandoc - lynx - ntfs-3g + - flock #- name: Install pip as a commonly required package management system # command: curl https://bootstrap.pypa.io/get-pip.py -o {{ downloads_dir }}/get-pip.py From fa157c22a7cf2022ac0d92eb393bf6cfea86c09a Mon Sep 17 00:00:00 2001 From: Tim Moody <tim@timmoody.com> Date: Mon, 23 Jul 2018 16:54:09 -0400 Subject: [PATCH 332/374] put flock in kiwix --- roles/2-common/tasks/packages.yml | 1 - roles/kiwix/tasks/kiwix_install.yml | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index 43b1edffe..f64c25936 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -71,7 +71,6 @@ - pandoc - lynx - ntfs-3g - - flock #- name: Install pip as a commonly required package management system # command: curl https://bootstrap.pypa.io/get-pip.py -o {{ downloads_dir }}/get-pip.py diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 0cb5193b5..d8d75f985 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -85,6 +85,13 @@ # 4. CREATE/ENABLE/DISABLE KIWIX SERVICE & ITS CRON JOB +- name: Install packages + package: + name: "{{ item }}" + state: present + with_items: + - flock + - name: Create 'kiwix-serve' service and related files template: backup: no From 8b5e77be1702c899768f29989427e6d05036b1f8 Mon Sep 17 00:00:00 2001 From: Tim Moody <tim@timmoody.com> Date: Mon, 23 Jul 2018 17:14:48 -0400 Subject: [PATCH 333/374] flock is already installed --- roles/kiwix/tasks/kiwix_install.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index d8d75f985..0cb5193b5 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -85,13 +85,6 @@ # 4. CREATE/ENABLE/DISABLE KIWIX SERVICE & ITS CRON JOB -- name: Install packages - package: - name: "{{ item }}" - state: present - with_items: - - flock - - name: Create 'kiwix-serve' service and related files template: backup: no From bb1c0448e7eca506cc1171aa47723cb95d2a9979 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 17:49:34 -0400 Subject: [PATCH 334/374] Update iiab-install --- iiab-install | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/iiab-install b/iiab-install index d3dcb4df9..a303d63f0 100755 --- a/iiab-install +++ b/iiab-install @@ -12,10 +12,28 @@ OS=${OS//\"/} MIN_RPI_KERN=4.9.59-v7+ MIN_ANSIBLE_VER=2.5.6 -export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" - echo -e "\n\n./iiab-install $* BEGUN IN $CWD\n" +if [ ! -f /etc/iiab/local_vars.yml ]; then + echo -e "EXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 + echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more." >&2 + echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 + echo -e "(3) NEED 4 SPEED? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 + echo -e " http://download.iiab.io\n" >&2 + #case $OS in + # OLPC | fedora) + # echo -e "Please examine /opt/iiab/iiab/vars/local_vars_olpc.yml for XO laptops.\n" >&2 + # ;; + # centos | debian | ubuntu | raspbian) + # echo -e "Please consider /opt/iiab/iiab/vars/local_vars_medium.yml or similar.\n" >&2 + # ;; + # *) + # echo -e "EXITING: IIAB requires Raspbian, Debian, Ubuntu, CentOS or OLPC/Fedora.\n" >&2 + # ;; + #esac + exit 1 +fi + if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then mkdir -p /etc/ansible/facts.d fi @@ -120,28 +138,11 @@ if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then echo -e "\n'--debug' *ignored* as STAGE (counter) < 2." fi -# If /etc/iiab/local_vars.yml is missing, put a default file in place. -if [ ! -f /etc/iiab/local_vars.yml ]; then - case $OS in - OLPC | fedora) - cp ./vars/local_vars_olpc.yml /etc/iiab/local_vars.yml - echo -e "\n/etc/iiab/local_vars.yml created from /opt/iiab/iiab/vars/local_vars_olpc.yml defaults." - ;; - centos | debian | ubuntu | raspbian) - cp ./vars/local_vars_medium.yml /etc/iiab/local_vars.yml - echo -e "\n/etc/iiab/local_vars.yml created from /opt/iiab/iiab/vars/local_vars_medium.yml defaults." - echo "See MIN/MEDIUM/BIG options @ http://wiki.iiab.io/local_vars.yml" - ;; - *) - echo -e "\nEXITING: IIAB requires Raspbian, Debian, Ubuntu, CentOS or OLPC/Fedora." - exit 1 - ;; - esac -fi - echo -e "\nTRY TO RERUN './iiab-install' IF IT FAILS DUE TO CONNECTIVITY ISSUES ETC!" echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages $(($STAGE + 1))-9" +export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" + ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local From dff125753642005a7dca19c74929c0fcada6e3f6 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 17:51:55 -0400 Subject: [PATCH 335/374] Update iiab-install --- iiab-install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iiab-install b/iiab-install index a303d63f0..b12c9609f 100755 --- a/iiab-install +++ b/iiab-install @@ -12,10 +12,8 @@ OS=${OS//\"/} MIN_RPI_KERN=4.9.59-v7+ MIN_ANSIBLE_VER=2.5.6 -echo -e "\n\n./iiab-install $* BEGUN IN $CWD\n" - if [ ! -f /etc/iiab/local_vars.yml ]; then - echo -e "EXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 + echo -e "\n\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more." >&2 echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 echo -e "(3) NEED 4 SPEED? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 @@ -34,6 +32,8 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then exit 1 fi +echo -e "\n\n./iiab-install $* BEGUN IN $CWD\n" + if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then mkdir -p /etc/ansible/facts.d fi From cc1beb6d72366114b1071d701f797afb2da6f384 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 17:59:17 -0400 Subject: [PATCH 336/374] Update iiab-install --- iiab-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iiab-install b/iiab-install index b12c9609f..66c7b8cdb 100755 --- a/iiab-install +++ b/iiab-install @@ -16,8 +16,8 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then echo -e "\n\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more." >&2 echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 - echo -e "(3) NEED 4 SPEED? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 - echo -e " http://download.iiab.io\n" >&2 + echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 + echo -e " http://download.iiab.io (click on a recent version number!)\n" >&2 #case $OS in # OLPC | fedora) # echo -e "Please examine /opt/iiab/iiab/vars/local_vars_olpc.yml for XO laptops.\n" >&2 From b21cf72d9fa01e11a37901131ee5b60fdc708687 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 18:01:50 -0400 Subject: [PATCH 337/374] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 66c7b8cdb..1f22f8689 100755 --- a/iiab-install +++ b/iiab-install @@ -13,7 +13,7 @@ MIN_RPI_KERN=4.9.59-v7+ MIN_ANSIBLE_VER=2.5.6 if [ ! -f /etc/iiab/local_vars.yml ]; then - echo -e "\n\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 + echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more." >&2 echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 From 07bd4e590e3f9fb82c9bcc89f7aaf1498729f45f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 18:04:30 -0400 Subject: [PATCH 338/374] Update iiab-install --- iiab-install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iiab-install b/iiab-install index 1f22f8689..633546111 100755 --- a/iiab-install +++ b/iiab-install @@ -13,11 +13,11 @@ MIN_RPI_KERN=4.9.59-v7+ MIN_ANSIBLE_VER=2.5.6 if [ ! -f /etc/iiab/local_vars.yml ]; then - echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 - echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more." >&2 - echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 - echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 - echo -e " http://download.iiab.io (click on a recent version number!)\n" >&2 + echo -e '\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n' >&2 + echo -e '(1) Please read http://wiki.iiab.io/local_vars.yml to learn more.' >&2 + echo -e '(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars' >&2 + echo -e '(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n' >&2 + echo -e ' http://download.iiab.io (click on "6.6" on a more recent version number!)\n' >&2 #case $OS in # OLPC | fedora) # echo -e "Please examine /opt/iiab/iiab/vars/local_vars_olpc.yml for XO laptops.\n" >&2 From d5fd168c2ca727b044f814d1852142cbdc0375d7 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 18:14:15 -0400 Subject: [PATCH 339/374] Update iiab-install --- iiab-install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iiab-install b/iiab-install index 633546111..8eb050b7a 100755 --- a/iiab-install +++ b/iiab-install @@ -13,11 +13,11 @@ MIN_RPI_KERN=4.9.59-v7+ MIN_ANSIBLE_VER=2.5.6 if [ ! -f /etc/iiab/local_vars.yml ]; then - echo -e '\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n' >&2 - echo -e '(1) Please read http://wiki.iiab.io/local_vars.yml to learn more.' >&2 - echo -e '(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars' >&2 - echo -e '(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n' >&2 - echo -e ' http://download.iiab.io (click on "6.6" on a more recent version number!)\n' >&2 + echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 + echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more." >&2 + echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 + echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 + echo -e ' http://download.iiab.io (click on "6.6" or a more recent version!)\n' >&2 #case $OS in # OLPC | fedora) # echo -e "Please examine /opt/iiab/iiab/vars/local_vars_olpc.yml for XO laptops.\n" >&2 From e0cedc3ee93e203448609e035ede9c86f8d4acdc Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 18:21:08 -0400 Subject: [PATCH 340/374] Update iiab-install --- iiab-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iiab-install b/iiab-install index 8eb050b7a..ec6a128c9 100755 --- a/iiab-install +++ b/iiab-install @@ -14,10 +14,10 @@ MIN_ANSIBLE_VER=2.5.6 if [ ! -f /etc/iiab/local_vars.yml ]; then echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 - echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more." >&2 + echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more" >&2 echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 - echo -e ' http://download.iiab.io (click on "6.6" or a more recent version!)\n' >&2 + echo -e ' http://download.iiab.io (click on "6.6" or a more recent version!)\n' >&2 #case $OS in # OLPC | fedora) # echo -e "Please examine /opt/iiab/iiab/vars/local_vars_olpc.yml for XO laptops.\n" >&2 From 7f56f75c2ea5f7431a883b14bcbf95365474c7b5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 21:36:05 -0400 Subject: [PATCH 341/374] Rename runansible to runansible.deprecated --- runansible => runansible.deprecated | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename runansible => runansible.deprecated (100%) diff --git a/runansible b/runansible.deprecated similarity index 100% rename from runansible rename to runansible.deprecated From 1eee4efc64d82e6a7a5c3d9b73282b6ff1c4fda7 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 23 Jul 2018 21:36:23 -0400 Subject: [PATCH 342/374] Rename runtags to runtags.deprecated --- runtags => runtags.deprecated | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename runtags => runtags.deprecated (100%) diff --git a/runtags b/runtags.deprecated similarity index 100% rename from runtags rename to runtags.deprecated From 1152e8c71bc22531594b6cdf57d1606300c956b5 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 24 Jul 2018 15:20:34 -0400 Subject: [PATCH 343/374] Update iiab-install --- iiab-install | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iiab-install b/iiab-install index ec6a128c9..7704c0873 100755 --- a/iiab-install +++ b/iiab-install @@ -18,6 +18,13 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 echo -e ' http://download.iiab.io (click on "6.6" or a more recent version!)\n' >&2 + + if [ -f /opt/iiab/iiab/vars/local_vars.yml ]; then + echo -e "\nACTION REQUIRED: /opt/iiab/iiab/vars/local_vars.yml IS NO LONGER SUPPORTED.\n" >&2 + echo -e "To move it to the correct location, run:\n" >&2 + echo -e " mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml" >&2 + fi + #case $OS in # OLPC | fedora) # echo -e "Please examine /opt/iiab/iiab/vars/local_vars_olpc.yml for XO laptops.\n" >&2 From b27063afbc25b1f2fc8ed8af72be2585da6fbb83 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 24 Jul 2018 15:28:34 -0400 Subject: [PATCH 344/374] Update iiab-install --- iiab-install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 7704c0873..2399b4bbc 100755 --- a/iiab-install +++ b/iiab-install @@ -13,6 +13,7 @@ MIN_RPI_KERN=4.9.59-v7+ MIN_ANSIBLE_VER=2.5.6 if [ ! -f /etc/iiab/local_vars.yml ]; then + echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more" >&2 echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 @@ -20,7 +21,7 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then echo -e ' http://download.iiab.io (click on "6.6" or a more recent version!)\n' >&2 if [ -f /opt/iiab/iiab/vars/local_vars.yml ]; then - echo -e "\nACTION REQUIRED: /opt/iiab/iiab/vars/local_vars.yml IS NO LONGER SUPPORTED.\n" >&2 + echo -e "\nACTION NEEDED: YOUR /opt/iiab/iiab/vars/local_vars.yml IS NO LONGER SUPPORTED.\n" >&2 echo -e "To move it to the correct location, run:\n" >&2 echo -e " mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml" >&2 fi @@ -39,6 +40,8 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then exit 1 fi +# FUTURE: Test if their local_vars.yml is sufficiently version-compatible ! + echo -e "\n\n./iiab-install $* BEGUN IN $CWD\n" if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then From 9469cf836d3213ea784d814d7e10ab238bdd5c32 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 24 Jul 2018 15:34:10 -0400 Subject: [PATCH 345/374] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 2399b4bbc..50f6b53e0 100755 --- a/iiab-install +++ b/iiab-install @@ -23,7 +23,7 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then if [ -f /opt/iiab/iiab/vars/local_vars.yml ]; then echo -e "\nACTION NEEDED: YOUR /opt/iiab/iiab/vars/local_vars.yml IS NO LONGER SUPPORTED.\n" >&2 echo -e "To move it to the correct location, run:\n" >&2 - echo -e " mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml" >&2 + echo -e " mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml\n" >&2 fi #case $OS in From 1457b1bfc2c7076cf0e9333dca8ec03f9bfb933a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 24 Jul 2018 15:43:38 -0400 Subject: [PATCH 346/374] Update iiab-install --- iiab-install | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iiab-install b/iiab-install index 50f6b53e0..01a408293 100755 --- a/iiab-install +++ b/iiab-install @@ -14,18 +14,18 @@ MIN_ANSIBLE_VER=2.5.6 if [ ! -f /etc/iiab/local_vars.yml ]; then - echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 - echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more" >&2 - echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 - echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 - echo -e ' http://download.iiab.io (click on "6.6" or a more recent version!)\n' >&2 - if [ -f /opt/iiab/iiab/vars/local_vars.yml ]; then echo -e "\nACTION NEEDED: YOUR /opt/iiab/iiab/vars/local_vars.yml IS NO LONGER SUPPORTED.\n" >&2 echo -e "To move it to the correct location, run:\n" >&2 echo -e " mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml\n" >&2 fi + echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 + echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more" >&2 + echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2 + echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2 + echo -e ' http://download.iiab.io (click on "6.6" or a more recent version!)\n' >&2 + #case $OS in # OLPC | fedora) # echo -e "Please examine /opt/iiab/iiab/vars/local_vars_olpc.yml for XO laptops.\n" >&2 From 993b7690e244050e41f4bf00a20ef08ab182d17b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 24 Jul 2018 16:09:40 -0400 Subject: [PATCH 347/374] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 01a408293..f2d1d0b86 100755 --- a/iiab-install +++ b/iiab-install @@ -16,7 +16,7 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then if [ -f /opt/iiab/iiab/vars/local_vars.yml ]; then echo -e "\nACTION NEEDED: YOUR /opt/iiab/iiab/vars/local_vars.yml IS NO LONGER SUPPORTED.\n" >&2 - echo -e "To move it to the correct location, run:\n" >&2 + echo -e "TO MOVE IT TO THE CORRECT LOCATION, RUN:\n" >&2 echo -e " mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml\n" >&2 fi From c848aa550cbf873e4e37a545c2cb5198df07a9ae Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 24 Jul 2018 16:16:08 -0400 Subject: [PATCH 348/374] Update iiab-install --- iiab-install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iiab-install b/iiab-install index f2d1d0b86..9d5b2003e 100755 --- a/iiab-install +++ b/iiab-install @@ -16,8 +16,9 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then if [ -f /opt/iiab/iiab/vars/local_vars.yml ]; then echo -e "\nACTION NEEDED: YOUR /opt/iiab/iiab/vars/local_vars.yml IS NO LONGER SUPPORTED.\n" >&2 - echo -e "TO MOVE IT TO THE CORRECT LOCATION, RUN:\n" >&2 - echo -e " mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml\n" >&2 + echo -e "███████████████████ TO MOVE IT TO THE CORRECT LOCATION, RUN: ███████████████████" >&2 + echo -e "██ mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml ██" >&2 + echo -e "████████████████████████████████████████████████████████████████████████████████\n" >&2 fi echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2 From b6d68456001d4903aecb793af2c66098a857eb7b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Tue, 24 Jul 2018 16:17:29 -0400 Subject: [PATCH 349/374] Update iiab-install --- iiab-install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iiab-install b/iiab-install index 9d5b2003e..81680e0aa 100755 --- a/iiab-install +++ b/iiab-install @@ -17,7 +17,9 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then if [ -f /opt/iiab/iiab/vars/local_vars.yml ]; then echo -e "\nACTION NEEDED: YOUR /opt/iiab/iiab/vars/local_vars.yml IS NO LONGER SUPPORTED.\n" >&2 echo -e "███████████████████ TO MOVE IT TO THE CORRECT LOCATION, RUN: ███████████████████" >&2 + echo -e "██ ██" >&2 echo -e "██ mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml ██" >&2 + echo -e "██ ██" >&2 echo -e "████████████████████████████████████████████████████████████████████████████████\n" >&2 fi From f1c498e639880213361073448a8bf811094bea69 Mon Sep 17 00:00:00 2001 From: George Hunt <georgejhunt@gmail.com> Date: Wed, 25 Jul 2018 20:57:35 +0000 Subject: [PATCH 350/374] add vpn to apache config for vpn --- roles/nextcloud/templates/nextcloud.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/nextcloud/templates/nextcloud.conf.j2 b/roles/nextcloud/templates/nextcloud.conf.j2 index 965973ad4..33ec8e2fa 100644 --- a/roles/nextcloud/templates/nextcloud.conf.j2 +++ b/roles/nextcloud/templates/nextcloud.conf.j2 @@ -6,7 +6,7 @@ Alias {{ nextcloud_url }} {{ nextcloud_prefix }}/nextcloud <IfModule mod_authz_core.c> # Apache 2.4 Require host localhost - Require ip 127.0.0.1 {{ lan_ip }}/{{ lan_netmask }} {{ nextcloud_required_ip }} + Require ip 127.0.0.1 {{ lan_ip }}/{{ lan_netmask }} {{ nextcloud_required_ip }} {{ openvpn_server_virtual_ip }}/255/255/255/0 </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 From 230a0c29325e384decd9a62933668ae3fb52a5a7 Mon Sep 17 00:00:00 2001 From: George Hunt <georgejhunt@gmail.com> Date: Wed, 25 Jul 2018 21:08:00 +0000 Subject: [PATCH 351/374] put vpn server addr in default_vars --- roles/nextcloud/templates/nextcloud.conf.j2 | 2 +- vars/default_vars.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/nextcloud/templates/nextcloud.conf.j2 b/roles/nextcloud/templates/nextcloud.conf.j2 index 33ec8e2fa..7a24d512f 100644 --- a/roles/nextcloud/templates/nextcloud.conf.j2 +++ b/roles/nextcloud/templates/nextcloud.conf.j2 @@ -6,7 +6,7 @@ Alias {{ nextcloud_url }} {{ nextcloud_prefix }}/nextcloud <IfModule mod_authz_core.c> # Apache 2.4 Require host localhost - Require ip 127.0.0.1 {{ lan_ip }}/{{ lan_netmask }} {{ nextcloud_required_ip }} {{ openvpn_server_virtual_ip }}/255/255/255/0 + Require ip 127.0.0.1 {{ lan_ip }}/{{ lan_netmask }} {{ nextcloud_required_ip }} {{ openvpn_server_virtual_ip }}/255.255.255.0 </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 8f097e95a..76df8d252 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -188,6 +188,7 @@ sshd_enabled: True # OpenVPN vpn_presence: xscenet.net openvpn_server_port: 1194 +openvpn_server_virtual_ip: 10.8.0.1 openvpn_cron_enabled: False openvpn_install: True openvpn_enabled: False From 26e283dc94d158a138391f78e74151a2ff1457cb Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 27 Jul 2018 12:19:27 -0400 Subject: [PATCH 352/374] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 81680e0aa..4e022309d 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.6 +MIN_ANSIBLE_VER=2.5.7 if [ ! -f /etc/iiab/local_vars.yml ]; then From dc9cc8f91cbf8ee1427b62b4ab6ab1c007a247ee Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 27 Jul 2018 12:38:09 -0400 Subject: [PATCH 353/374] Update debs.yml --- roles/calibre/tasks/debs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/calibre/tasks/debs.yml b/roles/calibre/tasks/debs.yml index 43566b8fb..016f1ddc1 100644 --- a/roles/calibre/tasks/debs.yml +++ b/roles/calibre/tasks/debs.yml @@ -28,8 +28,8 @@ # when: is_rpi and internet_available - name: Upgrade to latest Calibre using .deb's from testing (rpi) - command: scripts/calibre-install-latest-rpi-plus.sh # HOPE IT WORKS FOR Calibre 3.27.1+ starting 2018-07-22 -- PLEASE TEST IF BOOTABLE IN Zero W? - #command: scripts/calibre-install-latest-rpi.sh # WORKED FOR Calibre 3.26.x (Calibre 3.24.x & 3.25 required above prereq calibre-install-packages.sh then Debian's own calibre-install-latest.sh to be bootable in Zero W) + #command: scripts/calibre-install-latest-rpi-plus.sh # NEC FOR Calibre 3.27.1+ on 2018-07-22 (#948 -> PR #950) THO NOT BOOTABLE IN Zero W. Similar to Calibre 3.24.x & 3.25 in June 2018, which had used calibre-install-packages.sh then Debian's own calibre-install-latest.sh + command: scripts/calibre-install-latest-rpi.sh # WORKS for Calibre 3.28 on 2018-07-26 (PR #971). Likewise for Calibre 3.26.x when: is_rpi and internet_available - name: Upgrade to Calibre testing .deb's - target Ubuntu 16.04 (not rpi and not ubuntu_18) From 6e812caf8c608a2d1036d96a41c0d867e78219a4 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 27 Jul 2018 12:46:32 -0400 Subject: [PATCH 354/374] Update debs.yml --- roles/calibre/tasks/debs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/calibre/tasks/debs.yml b/roles/calibre/tasks/debs.yml index 016f1ddc1..797b2bb57 100644 --- a/roles/calibre/tasks/debs.yml +++ b/roles/calibre/tasks/debs.yml @@ -28,7 +28,7 @@ # when: is_rpi and internet_available - name: Upgrade to latest Calibre using .deb's from testing (rpi) - #command: scripts/calibre-install-latest-rpi-plus.sh # NEC FOR Calibre 3.27.1+ on 2018-07-22 (#948 -> PR #950) THO NOT BOOTABLE IN Zero W. Similar to Calibre 3.24.x & 3.25 in June 2018, which had used calibre-install-packages.sh then Debian's own calibre-install-latest.sh + #command: scripts/calibre-install-latest-rpi-plus.sh # NEC FOR Calibre 3.27.1 on 2018-07-22 (#948 -> PR #950) THO NOT BOOTABLE IN Zero W (#952). Similar to Calibre 3.24.x & 3.25 in June 2018, which had used calibre-install-packages.sh then Debian's own calibre-install-latest.sh command: scripts/calibre-install-latest-rpi.sh # WORKS for Calibre 3.28 on 2018-07-26 (PR #971). Likewise for Calibre 3.26.x when: is_rpi and internet_available From 0d1621dcb650a5bf6872614ab90d9d20f5131062 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 27 Jul 2018 16:03:34 -0400 Subject: [PATCH 355/374] Update main.yml --- roles/0-init/tasks/main.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index b0223aa1e..1094d63ee 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -22,13 +22,13 @@ setup: filter: ansible_local -- name: Set top level variables from local facts for convenience +- name: Set top-level variables from local_facts for convenience set_fact: xo_model: "{{ ansible_local.local_facts.xo_model }}" phplib_dir: "{{ ansible_local.local_facts.phplib_dir }}" iiab_stage: "{{ ansible_local.local_facts.stage }}" -- name: Discover if this is running Raspbian -- if so assume it is a RPi +- name: Discover if this is running Raspbian -- if so assume it is an RPi set_fact: rpi_model: "rpi" is_rpi: True @@ -59,7 +59,7 @@ gw_active: True when: discovered_wan_iface != "none" and gw_active_test.stdout == "1" -- name: Test for internet access +- name: Test for Internet access get_url: url: "{{ iiab_download_url }}/heart-beat.txt" dest: /tmp/heart-beat.txt @@ -75,7 +75,7 @@ internet_available: True when: not internet_access_test|failed and not disregard_network -- name: Cleanup internet test file +- name: Cleanup Internet test file file: path: /tmp/heart-beat.txt state: absent @@ -103,20 +103,20 @@ # when: elgg_enabled or rachel_enabled or owncloud_enabled or phpmyadmin_enabled or wordpress_enabled or iiab_menu_install # Late 2017: Had commented out MongoDB on a trial basis, for a more basic/lightweight Sugarizer, per https://github.com/iiab/iiab/pull/427 -- name: Turn on mongodb if sugarizer enabled +- name: Turn on vars for MongoDB if Sugarizer enabled set_fact: mongodb_install: True mongodb_enabled: True when: sugarizer_enabled # There might be other db's -- name: Turn on PostgreSQL if Moodle or Pathagar enabled +- name: Turn on vars for PostgreSQL if Moodle or Pathagar enabled set_fact: postgresql_install: True postgresql_enabled: True when: moodle_enabled or pathagar_enabled -- name: Turn on Docker if SchoolTool is to be installed +- name: Turn on vars for Docker if SchoolTool is to be installed set_fact: docker_install: True docker_enabled: True @@ -161,7 +161,7 @@ FQDN_changed: True when: iiab_fqdn != ansible_fqdn -- name: Setting hostname +- name: Set hostname if FQDN_changed include_tasks: hostname.yml when: FQDN_changed @@ -209,9 +209,9 @@ - option: FQDN_changed value: "{{ FQDN_changed }}" -- name: Now changing FQDN - include_tasks: hostname.yml - when: FQDN_changed +#- name: Now changing FQDN +# include_tasks: hostname.yml +# when: FQDN_changed - name: STAGE 0 HAS COMPLETED ====================================== ini_file: From 54d654ccf3553cc5bdb0d30dd0adf858b390a895 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 27 Jul 2018 16:08:20 -0400 Subject: [PATCH 356/374] Update main.yml --- roles/0-init/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index 1094d63ee..014f21393 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -75,7 +75,7 @@ internet_available: True when: not internet_access_test|failed and not disregard_network -- name: Cleanup Internet test file +- name: Remove Internet test file file: path: /tmp/heart-beat.txt state: absent From 1a90057dbd84e0bfbb25ce6a0b817e78a628cd7a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Fri, 27 Jul 2018 16:41:00 -0400 Subject: [PATCH 357/374] Update main.yml --- roles/0-init/defaults/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/0-init/defaults/main.yml b/roles/0-init/defaults/main.yml index 6adb8394a..2d522f1fe 100644 --- a/roles/0-init/defaults/main.yml +++ b/roles/0-init/defaults/main.yml @@ -12,7 +12,7 @@ gw_active: none internet_available: False discovered_wan_iface: none -# old defs +# Old defs gui_port: 80 exFAT_enabled: False is_F18: False @@ -21,12 +21,12 @@ is_F18: False rtc_id: ds3231 NUC6_firmware_needed: False -# used in 2-common/tasks/xo.yml +# Used in 2-common/tasks/xo.yml wifi_id: none -# used in 2-common, 3-base-server and roles/network +# Used in 2-common, 3-base-server and roles/network installing: False -# network +# Network no_net_restart: False no_NM_reload: False From f84bb734650b96c6d29166dedb0a2ad1631b78f3 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 29 Jul 2018 12:47:07 -0400 Subject: [PATCH 358/374] Update ansible --- scripts/ansible | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 91f74eeb7..a4467c4b4 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -12,8 +12,8 @@ echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/an echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated or scripts/ansible-2.6.x\n\n' -GOOD_VER="2.6.1" # Ansible version for OLPC XO laptops (pip install). - # On other OS's we install/upgrade to THE latest (released version of) Ansible. +GOOD_VER="2.6.2" # Ansible version for OLPC XO laptops (pip install). + # NOTE: on other OS's we install/upgrade from PPA, which might provide an even more recent version of Ansible... CURR_VER="undefined" # below are unused for future use # URL="NA" @@ -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.5.5-1.el7.ans.noarch.rpm + yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.6.2-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 22ad6f51fba240227abdee06a5d2aff36558f832 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 29 Jul 2018 12:49:05 -0400 Subject: [PATCH 359/374] 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 b051ff203..e3340b444 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -12,8 +12,8 @@ echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/an echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated "slow food", or scripts/ansible for the latest.\n\n' -GOOD_VER="2.6.1" # Ansible version for OLPC XO laptops (pip install). - # On other OS's we attempt to install/upgrade/pin to the latest Ansible 2.6.x +GOOD_VER="2.6.2" # Ansible version for OLPC XO laptops (pip install). + # On other OS's we install/upgrade the latest Ansible 2.6.x from PPA, which might provide an even more recent version of Ansible. CURR_VER="undefined" # below are unused for future use # URL="NA" @@ -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.5.5-1.el7.ans.noarch.rpm + yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.6.2-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 b0bb0de0a2166234dd448e6c914dea3758f7324f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 29 Jul 2018 12:50:25 -0400 Subject: [PATCH 360/374] Update ansible --- scripts/ansible | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index a4467c4b4..314e53ba6 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -12,8 +12,8 @@ echo -e 'Ensure you'"'"'re online before running this (/opt/iiab/iiab/scripts/an echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated or scripts/ansible-2.6.x\n\n' -GOOD_VER="2.6.2" # Ansible version for OLPC XO laptops (pip install). - # NOTE: on other OS's we install/upgrade from PPA, which might provide an even more recent version of Ansible... +GOOD_VER="2.6.2" # Ansible version for OLPC XO laptops (pip install). + # On other OS's we 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" From c08ebe2d191b976412a1f09f580ae363c751938b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 29 Jul 2018 12:50:52 -0400 Subject: [PATCH 361/374] 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 e3340b444..0f5eab19d 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -13,7 +13,7 @@ echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated "slow food", or scri GOOD_VER="2.6.2" # Ansible version for OLPC XO laptops (pip install). - # On other OS's we install/upgrade the latest Ansible 2.6.x from PPA, which might provide an even more recent version of Ansible. + # On other OS's we install/upgrade the latest 2.6.x from PPA, which might provide an even more recent version of Ansible. CURR_VER="undefined" # below are unused for future use # URL="NA" From abe26e9ffc4e04b6f0afe2ec6fd578a1c933255b Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 29 Jul 2018 12:54:49 -0400 Subject: [PATCH 362/374] 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 0f5eab19d..66335dc9c 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -13,7 +13,7 @@ echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated "slow food", or scri GOOD_VER="2.6.2" # Ansible version for OLPC XO laptops (pip install). - # On other OS's we install/upgrade the latest 2.6.x from PPA, which might provide an even more recent version of Ansible. + # On other OS's we attempt to install/upgrade the latest 2.6.x from PPA, which might provide an even more recent version of Ansible. CURR_VER="undefined" # below are unused for future use # URL="NA" From 9a408fdc93071dcea4b2a831da7c2622a4a9a284 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 29 Jul 2018 12:55:06 -0400 Subject: [PATCH 363/374] Update ansible --- scripts/ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible b/scripts/ansible index 314e53ba6..6f2d474ad 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -13,7 +13,7 @@ echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated or scripts/ansible-2 GOOD_VER="2.6.2" # Ansible version for OLPC XO laptops (pip install). - # On other OS's we install/upgrade THE latest from PPA, which might provide an even more recent version of Ansible. + # 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" From 0258e469607ad428fa29ca81568baf088aff9f71 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Sun, 29 Jul 2018 12:56:23 -0400 Subject: [PATCH 364/374] 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 66335dc9c..5a035f722 100755 --- a/scripts/ansible-2.6.x +++ b/scripts/ansible-2.6.x @@ -13,7 +13,7 @@ echo -e 'ALTERNATIVES: Run scripts/ansible-2.5.x-deprecated "slow food", or scri GOOD_VER="2.6.2" # Ansible version for OLPC XO laptops (pip install). - # On other OS's we attempt to install/upgrade the latest 2.6.x from PPA, which might provide an even more recent version of Ansible. + # 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 version of Ansible. CURR_VER="undefined" # below are unused for future use # URL="NA" From c05585e745e2f95116532b1cb0fe5c0e19978676 Mon Sep 17 00:00:00 2001 From: Arky <hitmanarky@gmail.com> Date: Mon, 6 Aug 2018 20:47:22 +0700 Subject: [PATCH 365/374] Use Kiwix default URI box.lan/kiwix Enhances Kiwix proxypass settings, updates kiwix readme file. Modifies one variable kiwix_url from /kiwix/ to /kiwix Fixes https://github.com/iiab/iiab/issues/979 --- roles/kiwix/README.rst | 4 ++-- roles/kiwix/defaults/main.yml | 2 +- roles/kiwix/templates/kiwix.conf.j2 | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/roles/kiwix/README.rst b/roles/kiwix/README.rst index e208742c7..308de46d5 100644 --- a/roles/kiwix/README.rst +++ b/roles/kiwix/README.rst @@ -13,7 +13,7 @@ Locations - Your ZIM files are expected to be in /library/zims/content - Your ZIM index files are expected to be in directories under /library/zims/index -- The URL is http://box:3000 +- The URL is http://box.lan/kiwix Your local ZIM catalog (at /library/zims/library.xml) can be -regenerated by running: iiab-make-kiwix-lib +regenerated by running: /usr/bin/iiab-make-kiwix-lib diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index a1425982b..d11d8207d 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -16,7 +16,7 @@ kiwix_src_file_i686: "{{ kiwix_version_i686 }}.tar.gz" kiwix_port: 3000 # Used for Kiwix proxy http://box/kiwix/ -kiwix_url: /kiwix/ +kiwix_url: /kiwix kiwix_path: "{{ iiab_base }}/kiwix" # /library/zims contains 3 important things: diff --git a/roles/kiwix/templates/kiwix.conf.j2 b/roles/kiwix/templates/kiwix.conf.j2 index a191cdb81..3919b59fb 100644 --- a/roles/kiwix/templates/kiwix.conf.j2 +++ b/roles/kiwix/templates/kiwix.conf.j2 @@ -1 +1,6 @@ -ProxyPass {{ kiwix_url }} http://127.0.0.1:{{ kiwix_port }}{{ kiwix_url }} \ No newline at end of file +ProxyPreserveHost On +ProxyPass {{ kiwix_url }} http://127.0.0.1:{{ kiwix_port}}{{ kiwix_url }} +ProxyPassReverse {{ kiwix_url }} http://127.0.0.1:{{ kiwix_port}}{{ kiwix_url }} + +RewriteEngine on +RewriteRule ^/kiwix$ /kiwix/ [R] From 43747fb1a83843f2ffda1c16d12cea2e43cee26e Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 6 Aug 2018 10:42:04 -0400 Subject: [PATCH 366/374] Update kiwix.conf.j2 --- roles/kiwix/templates/kiwix.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/templates/kiwix.conf.j2 b/roles/kiwix/templates/kiwix.conf.j2 index 3919b59fb..59cd3cb7c 100644 --- a/roles/kiwix/templates/kiwix.conf.j2 +++ b/roles/kiwix/templates/kiwix.conf.j2 @@ -1,5 +1,5 @@ ProxyPreserveHost On -ProxyPass {{ kiwix_url }} http://127.0.0.1:{{ kiwix_port}}{{ kiwix_url }} +ProxyPass {{ kiwix_url }} http://127.0.0.1:{{ kiwix_port}}{{ kiwix_url }} ProxyPassReverse {{ kiwix_url }} http://127.0.0.1:{{ kiwix_port}}{{ kiwix_url }} RewriteEngine on From 7e5ef15b45a6eb314e232a6932f8415b09da6d18 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 6 Aug 2018 10:54:03 -0400 Subject: [PATCH 367/374] Update README.rst --- roles/kiwix/README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/kiwix/README.rst b/roles/kiwix/README.rst index 308de46d5..839d4c832 100644 --- a/roles/kiwix/README.rst +++ b/roles/kiwix/README.rst @@ -13,7 +13,8 @@ Locations - Your ZIM files are expected to be in /library/zims/content - Your ZIM index files are expected to be in directories under /library/zims/index -- The URL is http://box.lan/kiwix +- The URL is http://box/kiwix or http://box.lan/kiwix (both proxied for AWStats) +- Use URL http://box:3000/kiwix if you want to avoid the proxy Your local ZIM catalog (at /library/zims/library.xml) can be regenerated by running: /usr/bin/iiab-make-kiwix-lib From ab3c9250d19ef7c81df28cf98a4dabc6a03aa9f9 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 6 Aug 2018 20:16:20 -0400 Subject: [PATCH 368/374] Update main.yml --- roles/elgg/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/elgg/defaults/main.yml b/roles/elgg/defaults/main.yml index a3c91ab2f..16764c15a 100644 --- a/roles/elgg/defaults/main.yml +++ b/roles/elgg/defaults/main.yml @@ -7,7 +7,7 @@ elgg_upload_path: /library/elgg elgg_install: True elgg_enabled: False -# following variables used in elgg engine/settings.php template +# Variables by template to create /opt/elgg/elgg-config/settings.php dbuser: Admin dbpassword: changeme dbname: elggdb From ccc6346267a733f7d4fdc3d9f838c4b34823c69c Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 6 Aug 2018 20:18:33 -0400 Subject: [PATCH 369/374] Update main.yml --- roles/elgg/tasks/main.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/roles/elgg/tasks/main.yml b/roles/elgg/tasks/main.yml index 54a257f4b..555850615 100644 --- a/roles/elgg/tasks/main.yml +++ b/roles/elgg/tasks/main.yml @@ -29,10 +29,9 @@ state: link force: true -# use template to fix up settings in engine/settings.php with our variables substituted -# into engine/settings.example.php -# note this will overwrite any manual settings -- name: Substitute our parameters in engine/settings.example.php +# Use template to fix up settings in elgg-config/settings.php with our variables substituted. +# Note this will overwrite any manual settings. +- name: Substitute our parameters in /opt/elgg/elgg-config/settings.php template: src: "settings.php.j2" dest: "/opt/{{ elgg_xx }}/elgg-config/settings.php" @@ -90,9 +89,9 @@ password: "{{ dbpassword }}" priv: "{{ dbname }}.*:ALL" with_items: - - 127.0.0.1 - - ::1 - - localhost + - 127.0.0.1 + - ::1 + - localhost - name: Create file to load database template: From 9828f5b6f621fc43be0d9ad9e41b1c101f36a4ee Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 6 Aug 2018 20:23:21 -0400 Subject: [PATCH 370/374] Update README.rst --- roles/elgg/README.rst | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/roles/elgg/README.rst b/roles/elgg/README.rst index 1dadfb4b5..6d908d3e2 100644 --- a/roles/elgg/README.rst +++ b/roles/elgg/README.rst @@ -6,24 +6,25 @@ Elgg is an award-winning social networking engine, delivering the building block that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications. -http://elgg.org/ +https://elgg.org After Installation ------------------ -Go to http://box.lan/elgg and log on as Admin with password changeme. +Go to http://box/elgg or http://box.lan/elgg and log on as Admin with password changeme. Change the following: * Administrator password -* Title to appear on elgg screens and any other settings as desired. +* Title to appear on Elgg screens and any other settings as desired. Locations --------- - The uploaded files are expected to be in /library/elgg -- The URL is /elgg +- The software is in /opt/elgg -> /opt/elgg-x.y.z +- The URL is http://box/elgg Parameters ---------- @@ -34,16 +35,16 @@ some constraints. Users and Passwords ------------------- -There are a number of seemilingly similar user names and passwords in this installation: +There are a number of seemingly similar user names and passwords in this installation: -* dbuser - the mysql user that elgg uses to access the database. This is a local variable - the name of which corresponds to that in the elgg settings.php file. +* dbuser - the MySQL user that Elgg uses to access the database. This is a local variable + the name of which corresponds to that in /opt/elgg/elgg-config/settings.php -* dbpassword - password for dbuser. This is also a local variable - the name of which corresponds to that in the elgg settings.php file. +* dbpassword - password for dbuser. This is also a local variable, the name of + which corresponds to that in /opt/elgg/elgg-config/settings.php -* elgg_mysql_password - this is the global name for dbpassword in default_vars.yml. +* elgg_mysql_password - this is the global name for dbpassword in default_vars.yml -* elgg_admin_user - the elgg (not mysql) user that is the administrator. +* elgg_admin_user - the Elgg (not MySQL) user that is the administrator -* elgg_admin_password - the password for elgg_admin_user. +* elgg_admin_password - the password for elgg_admin_user From 9c3b0ffc52d37888f0e430f2c90680c2a87f224a Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 6 Aug 2018 20:26:34 -0400 Subject: [PATCH 371/374] Update README.rst --- roles/elgg/README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/elgg/README.rst b/roles/elgg/README.rst index 6d908d3e2..94a96219f 100644 --- a/roles/elgg/README.rst +++ b/roles/elgg/README.rst @@ -37,11 +37,11 @@ Users and Passwords There are a number of seemingly similar user names and passwords in this installation: -* dbuser - the MySQL user that Elgg uses to access the database. This is a local variable - the name of which corresponds to that in /opt/elgg/elgg-config/settings.php +* dbuser - the MySQL user that Elgg uses to access the database + This is a local variable, the name of which corresponds to that in /opt/elgg/elgg-config/settings.php -* dbpassword - password for dbuser. This is also a local variable, the name of - which corresponds to that in /opt/elgg/elgg-config/settings.php +* dbpassword - password for dbuser + This is also a local variable, the name of which corresponds to that in /opt/elgg/elgg-config/settings.php * elgg_mysql_password - this is the global name for dbpassword in default_vars.yml From 8c2ece8c6a598b1bc40774caa803ed3ffc6fede4 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 6 Aug 2018 20:27:57 -0400 Subject: [PATCH 372/374] Update README.rst --- roles/elgg/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/elgg/README.rst b/roles/elgg/README.rst index 94a96219f..85258c2a8 100644 --- a/roles/elgg/README.rst +++ b/roles/elgg/README.rst @@ -23,7 +23,7 @@ Locations --------- - The uploaded files are expected to be in /library/elgg -- The software is in /opt/elgg -> /opt/elgg-x.y.z +- The software is in /opt/elgg -> /opt/elgg-x.y.z (i.e. actual version number) - The URL is http://box/elgg Parameters From 6eae14504c4491958f912ee4df767adf68d34e81 Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 6 Aug 2018 20:29:23 -0400 Subject: [PATCH 373/374] Update README.rst --- roles/elgg/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/elgg/README.rst b/roles/elgg/README.rst index 85258c2a8..c0b756242 100644 --- a/roles/elgg/README.rst +++ b/roles/elgg/README.rst @@ -35,7 +35,7 @@ some constraints. Users and Passwords ------------------- -There are a number of seemingly similar user names and passwords in this installation: +There are a number of seemingly similar usernames and passwords in this installation: * dbuser - the MySQL user that Elgg uses to access the database This is a local variable, the name of which corresponds to that in /opt/elgg/elgg-config/settings.php From 20d266575eb1ef68ebd7a345367d493093a0e49f Mon Sep 17 00:00:00 2001 From: A Holt <holta@users.noreply.github.com> Date: Mon, 6 Aug 2018 20:31:46 -0400 Subject: [PATCH 374/374] Update main.yml --- roles/elgg/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/elgg/defaults/main.yml b/roles/elgg/defaults/main.yml index 16764c15a..2607f3ad7 100644 --- a/roles/elgg/defaults/main.yml +++ b/roles/elgg/defaults/main.yml @@ -7,7 +7,7 @@ elgg_upload_path: /library/elgg elgg_install: True elgg_enabled: False -# Variables by template to create /opt/elgg/elgg-config/settings.php +# Variables used by template to create /opt/elgg/elgg-config/settings.php dbuser: Admin dbpassword: changeme dbname: elggdb