diff --git a/iiab-install b/iiab-install
index 47100285e..c9c66bbb5 100755
--- a/iiab-install
+++ b/iiab-install
@@ -16,6 +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: ███████████████████" >&2
echo -e "██ ██" >&2
echo -e "██ mv /opt/iiab/iiab/vars/local_vars.yml /etc/iiab/local_vars.yml ██" >&2
@@ -24,9 +25,11 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then
fi
echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2
+
echo -e "(1) Please read http://wiki.laptop.org/go/IIAB/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
@@ -79,8 +82,8 @@ CURR_KERN=`uname -r`
echo "Found Kernel "$CURR_KERN""
if [ "$OS" == "raspbian" ] && version_gt $MIN_RPI_KERN $CURR_KERN ; then
echo -e "\nEXITING: Kernel "$MIN_RPI_KERN" or higher required with Raspbian."
- echo "PLEASE RUN 'apt update' then 'apt install raspberrypi-kernel' then reboot."
- echo "IIAB INSTALL INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation"
+ echo -e "PLEASE RUN 'apt update' then 'apt install raspberrypi-kernel' then reboot."
+ echo -e "IIAB INSTALL INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation"
exit 1
fi
@@ -100,13 +103,13 @@ if [[ `command -v ansible` ]]; then # "command -v" is POSIX compliant; it
echo "Found Ansible "$CURR_ANSIBLE_VER""
fi
if version_gt $MIN_ANSIBLE_VER $CURR_ANSIBLE_VER ; then
- echo -e "\nEXITING: Ansible "$MIN_ANSIBLE_VER" or higher required."
- 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"
+ echo -e "\nEXITING: Ansible "$MIN_ANSIBLE_VER" or higher required.\n"
+
+ echo -e "REMOVE PRIOR VERSIONS using 'apt purge ansible' and/or 'pip uninstall ansible'."
+ echo -e "THEN RUN 'scripts/ansible' to install the latest Ansible from PPA or RPM."
+ echo -e "'ansible --version' and 'apt -a list ansible' can also be very useful.\n"
+
+ echo -e "IIAB INSTALL INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation"
exit 1
fi
@@ -140,19 +143,20 @@ if [ -f /etc/iiab/iiab.env ]; then
echo "Wrote STAGE=2 (counter) to /etc/iiab/iiab.env"
elif [ "$STAGE" -eq 9 ]; 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 './runrole' to run a single Stage or Role."
+ echo -e "Use './iiab-install --reinstall' to force running all Stages 0-9."
+ echo -e "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9."
+ echo -e "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://download.iiab.io/6.6/install.txt
+ exit 0 # allows rerunning http://download.iiab.io/6.7/install.txt
fi
fi
if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then
echo -e "\n'--debug' *ignored* as STAGE (counter) < 2."
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"
+echo -e "\nTRY TO RERUN './iiab-install' IF IT FAILS DUE TO CONNECTIVITY ISSUES ETC!\n"
+
+echo -e "Running local playbooks....Stage 0 will now run....followed by Stages $(($STAGE + 1))-9"
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
diff --git a/roles/kolibri/README.rst b/roles/kolibri/README.rst
index d3f5924fb..795386556 100644
--- a/roles/kolibri/README.rst
+++ b/roles/kolibri/README.rst
@@ -2,12 +2,12 @@
Kolibri README
==============
-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.
+This Ansible role installs `Kolibri `_ within `Internet-in-a-Box (IIAB) `_. 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.
Using It
--------
-If enabled and with the default settings Kolibri should be accessible at http://box:8009 (and in future at http://box/kolibri).
+If enabled and with the default settings Kolibri should be accessible at http://box:8009 (and in future at http://box/kolibri, work is ongoing in 2018 at `#913 `_).
To login to Kolibri enter::
@@ -17,23 +17,25 @@ To login to Kolibri enter::
Configuration Parameters
------------------------
-Please look in roles/kolibri/defaults/main.yml for the default values of the various install parameters. Everything in this README assumes the default values.
+Please look in `roles/kolibri/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::
+When kolibri_provision is enabled (e.g. in `/etc/iiab/local_vars.yml `_) the installation will set up the following defaults::
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 Preset type: formal # Options: formal, nonformal, informal
+ Kolibri default language: en # Options: 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 username: Admin
Kolibri Admin password: changeme
-Cloning content
+*Feel free to override any of the above, by copying the relevant line from /opt/iiab/iiab/roles/kolibri/defaults/main.yml to /etc/iiab/local_vars.yml (then run 'cd /opt/iiab/iiab' followed by './runrole kolibri' per IIAB's general guidelines at http://FAQ.IIAB.IO).*
+
+Cloning Content
---------------
-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.
+Kolibri 0.10 introduced ``kolibri manage deprovision`` which will remove user configurations, leaving content intact — i.e. if student and teacher privacy requires their records be deleted. You can then copy or clone /library/kolibri to a new location, or to a new school entirely.
Troubleshooting
----------------
@@ -53,6 +55,6 @@ To return to using the systemd unit::
Known Issues
-------------
-* Kolibri migrations can take a long time on a Raspberry Pi. These long running migrations could cause kolibri service timeouts. Try running migrations manually using 'kolibri manage migrate' command following the troubleshooting instructions above. Kolibri developers are trying to address this issue. (Refer https://github.com/learningequality/kolibri/issues/4310).
+* Kolibri migrations can take a long time on a Raspberry Pi. These long-running migrations could cause kolibri service timeouts. Try running migrations manually using command ``kolibri manage migrate`` after following the troubleshooting instructions above. Kolibri developers are trying to address this issue. (See `learningequality/kolibri#4310 `_)
-* Loading channels can take a long time on a Raspberry Pi. When generating channel contents for Khan Academy, the step indicated as “Generating channel listing. This could take a few minutes…” could mean ~30 minutes. The device’s computation power is the bottleneck. You might get logged out while waiting, but this is harmless and the process will continue. Sit tight!
+* Loading channels can take a long time on a Raspberry Pi. When generating channel contents for Khan Academy, the step indicated as “Generating channel listing. This could take a few minutes…” could mean ~30 minutes. The device’s computation power is the bottleneck. You might get logged out while waiting, but this is harmless and the process will continue. Sit tight!
diff --git a/scripts/ansible b/scripts/ansible
index cf9be0a68..cdae077a2 100755
--- a/scripts/ansible
+++ b/scripts/ansible
@@ -1,9 +1,9 @@
#!/bin/bash -e
CURR_VER="undefined" # Ansible version you currently have installed
-GOOD_VER="2.6.4" # For XO laptops (pip install) & CentOS (yum install rpm)
+GOOD_VER="2.6.5" # For XO laptops (pip install) & CentOS (yum install rpm)
# On other OS's we attempt the latest from PPA, which might be more recent
-
+
export DEBIAN_FRONTEND=noninteractive
echo -e "\n\nYOU ARE RUNNING: /opt/iiab/iiab/scripts/ansible (TO INSTALL ANSIBLE)"
diff --git a/scripts/ansible-2.6.x b/scripts/ansible-2.6.x
index a645b6e7d..b4396f14d 100755
--- a/scripts/ansible-2.6.x
+++ b/scripts/ansible-2.6.x
@@ -1,9 +1,9 @@
#!/bin/bash -e
CURR_VER="undefined" # Ansible version you currently have installed
-GOOD_VER="2.6.4" # For XO laptops (pip install) & CentOS (yum install rpm)
+GOOD_VER="2.6.5" # For XO laptops (pip install) & CentOS (yum install rpm)
# On other OS's we attempt the latest from PPA, which might be more recent
-
+
export DEBIAN_FRONTEND=noninteractive
echo -e "\n\nYOU ARE RUNNING: /opt/iiab/iiab/scripts/ansible-2.6.x (TO INSTALL ANSIBLE)"
diff --git a/scripts/ansible-2.7.x b/scripts/ansible-2.7.x
new file mode 100755
index 000000000..0b19f5f44
--- /dev/null
+++ b/scripts/ansible-2.7.x
@@ -0,0 +1,104 @@
+#!/bin/bash -e
+
+CURR_VER="undefined" # Ansible version you currently have installed
+GOOD_VER="2.7.0" # For XO laptops (pip install) & CentOS (yum install rpm)
+# On other OS's we attempt the latest from PPA, which might be more recent
+
+export DEBIAN_FRONTEND=noninteractive
+
+echo -e "\n\nYOU ARE RUNNING: /opt/iiab/iiab/scripts/ansible-2.7.x (TO INSTALL ANSIBLE)"
+echo -e 'Alternative: /opt/iiab/iiab/scripts/ansible ("for the very latest Ansible")\n'
+
+echo -e "RECOMMENDED PREREQUISITES:"
+echo -e "(1) Verify you're online"
+echo -e "(2) Remove all prior versions of Ansible using"
+echo -e " 'apt purge ansible' and/or 'pip uninstall ansible'"
+echo -e "(3) Remove all lines containing 'ansible' from"
+echo -e " /etc/apt/sources.list and /etc/apt/sources.list.d/*\n"
+
+echo -e "COMPLETE INSTALL INSTRUCTIONS:"
+echo -e "https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n"
+
+if [ $(command -v ansible-playbook) ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd"
+ CURR_VER=`ansible --version | head -1 | awk '{print $2}'` # To match iiab-install. Was: CURR_VER=`ansible --version | head -n 1 | cut -f 2 -d " "`
+ echo -e "CURRENTLY INSTALLED ANSIBLE: $CURR_VER -- LET'S TRY TO UPGRADE IT!"
+ echo -e "(Internet-in-a-Box requests Ansible $GOOD_VER or higher)\n"
+ if [ -f /etc/centos-release ] || [ -f /etc/fedora-release ]; then
+ echo "Please use your system's package manager (or pip if nec) to update Ansible.\n"
+ exit 0
+ elif [ -f /etc/olpc-release ]; then
+ echo "Please use pip package manager to update Ansible.\n"
+ exit 0
+ fi
+else
+ echo -e "ANSIBLE NOT FOUND ON THIS COMPUTER -- LET'S TRY TO INSTALL IT!"
+ echo -e "(Internet-in-a-Box requests Ansible $GOOD_VER or higher)\n"
+fi
+
+if [ -f /etc/olpc-release ]; then
+ yum -y install ca-certificates nss
+ yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
+ yum -y install python-pip python-setuptools python-wheel patch
+ # Can above 3 lines be merged into 1 line?
+ pip install --upgrade pip setuptools wheel #EOL just do it
+ pip install ansible==$GOOD_VER --disable-pip-version-check
+elif [ -f /etc/centos-release ]; then
+ yum -y install ansible
+# 2018-09-07: the next 4 lines aren't needed according to https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#latest-release-via-dnf-or-yum
+# yum -y install ca-certificates nss epel-release
+# yum -y install git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
+# yum -y install python-pip python-setuptools python-wheel patch
+# yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-$GOOD_VER-1.el7.ans.noarch.rpm
+#elif [ -f /etc/fedora-release ]; then
+# CURR_VER=`grep VERSION_ID /etc/*elease | cut -d= -f2`
+# URL=https://github.com/jvonau/iiab/blob/ansible/vars/fedora-$CURR_VER.yml
+# dnf -y install ansible git bzip2 file findutils gzip hg svn sudo tar which unzip xz zip libselinux-python
+# dnf -y install python-pip python-setuptools python-wheel patch
+## Parens are optional, but greatly clarify :)
+#elif (grep -qi ubuntu /etc/lsb-release 2> /dev/null) || (grep -qi ubuntu /etc/os-release); then
+# apt update
+# #apt -y install python-pip python-setuptools python-wheel patch # 2018-09-05: fails on @kananigit's Ubuntu 18.04/Server. Fix @ https://github.com/iiab/iiab/pull/1091
+# apt -y install software-properties-common # adds command "apt-add-repository"
+# apt-add-repository -y ppa:ansible/ansible # adds correct line to correct file e.g. adds line "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" to /etc/apt/sources.list.d/ansible-ubuntu-ansible-bionic.list
+## elif UBUNTU MUST REMAIN ABOVE (as Ubuntu ALSO contains /etc/debian_version, which would trigger the line just below)
+#elif [ -f /etc/debian_version ] || (grep -qi raspbian /etc/*elease) ; then
+#elif [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && [ ! -f /etc/olpc-release ]; then
+elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian
+
+ echo -e "\napt update; install dirmngr; PPA to /etc/apt/sources.list.d/iiab-ansible.list\n"
+ apt update
+ apt -y install dirmngr # Raspbian needs. Formerly: python-pip python-setuptools python-wheel patch
+ echo "deb http://ppa.launchpad.net/ansible/ansible-2.7/ubuntu xenial main" \
+ > /etc/apt/sources.list.d/iiab-ansible.list
+
+ echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367"\n'
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
+
+ echo -e "\napt update; apt install ansible\n"
+ apt update
+ apt -y --allow-downgrades install ansible
+ echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n"
+
+ # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible")
+ #pip install ansible==2.4.4
+
+ # TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. DETAILS @ https://github.com/iiab/iiab/issues/669
+ #echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb"
+ #cd /tmp
+ #wget http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb
+ #apt -y --allow-downgrades install ./ansible_2.4.2.0-1ppa~xenial_all.deb
+
+ echo -e 'PPA source "deb http://ppa.launchpad.net/ansible/ansible-2.7/ubuntu xenial main"'
+ echo -e "successfully saved to /etc/apt/sources.list.d/iiab-ansible.list\n"
+
+ echo -e "IF *OTHER* ANSIBLE SOURCES APPEAR BELOW, PLEASE MANUALLY REMOVE THEM TO"
+ echo -e "ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n"
+ grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -v '^/etc/apt/sources.list.d/iiab-ansible.list:' || true # Override bash -e (instead of aborting at 1st error)
+else
+ echo -e "\nEXITING: Could not detect your OS (unsupported?)\n"
+ exit 1
+fi
+
+# Needed?
+mkdir -p /etc/ansible
+echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts