1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #305 from iiab/master

sync from iiab/iiab
This commit is contained in:
A Holt 2019-10-24 14:10:00 -04:00 committed by GitHub
commit 9a0e05468e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 64 additions and 57 deletions

View file

@ -9,8 +9,8 @@ ARGS=""
CWD=`pwd`
OS=`grep ^ID= /etc/*release|cut -d= -f2`
OS=${OS//\"/}
MIN_RPI_KERN=4.9.59-v7+
MIN_ANSIBLE_VER=2.6.16
MIN_RPI_KERN=4.9.59-v7+ # UPDATE THIS SOON...when Raspbian's Oct 2019 kernels are finally fixed (https://github.com/iiab/iiab/issues/1993 etc)
MIN_ANSIBLE_VER=2.7.14
if [ ! -f /etc/iiab/local_vars.yml ]; then

View file

@ -22,7 +22,7 @@ After your Internet-in-a-Box (IIAB) is completely installed, log in to KA Lite t
Bulk Downloading Videos
-----------------------
Videos and their corresponding PNG thumbnail images can be copied into /library/ka-lite/content and will be recognized the next time KA Lite is started.
Videos and their corresponding PNG thumbnail images can be copied into /library/ka-lite/content — then log in to http://box.lan:8008 and click the "Videos" tab -> "Scan content folder for videos" (which might take a few minutes to complete!)
Please see http://FAQ.IIAB.IO ("KA Lite Administration: What tips & tricks exist?") to use BitTorrent to download compressed KA Lite videos, that are much smaller than the ones downloaded via KA Lite's administrative interface.
@ -36,7 +36,7 @@ Look at `role/kalite/defaults/main.yml <https://github.com/iiab/iiab/blob/master
Troubleshooting
---------------
Starting with KA Lite 0.15 (October 2015) you can run the server manually with the following commands:
Starting with KA Lite 0.15 (October 2015) you could run the server manually with the following commands:
* systemctl stop kalite-serve (make sure the systemd service is not running)
* export KALITE_HOME=/library/ka-lite (point kalite to the right environment)

View file

@ -1,31 +1,39 @@
# By the time we get here we should have ka-lite of some version
# And the systemd unit files should be defined
- name: Enable 'kalite-serve' service
service:
- name: Enable & (re)start 'kalite-serve' service
systemd:
daemon_reload: yes
name: kalite-serve
enabled: yes
state: started
state: restarted
when: kalite_enabled
- name: Disable 'kalite-serve' service
service:
- name: Disable & stop 'kalite-serve' service
systemd:
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
# 2019-10-20: Below is for Fedora 18 (XO laptops) only.
# Since F18 we don't have a separate unit file for kalite-cron.
#
# SEE --skip-job-scheduler @ https://ka-lite.readthedocs.io/en/latest/usermanual/cli.html
# ...as implemented in templates/kalite-serve.service.j2
# ...if not kalite_cron_enabled
# ...using {{ job_scheduler_stanza }} from kalite/tasks/install.yml
- name: Disable kalite cron server F18
- name: Enable & (re)start 'kalite-cron' service (F18)
service:
name: kalite-cron
enabled: yes
state: restarted
when: kalite_cron_enabled and is_F18
- name: Disable & stop 'kalite-cron' service (F18)
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
when: kalite_cron_enabled and is_F18

View file

@ -1,16 +1,14 @@
# This is for an OS other than Fedora 18
# For OS's other than Fedora 18
- name: Install missing packages required for KA Lite startup
- name: Install package python-virtualenv allowing KA Lite install into {{ kalite_venv }}
package:
name: "{{ item }}"
name: python-virtualenv
state: present
with_items:
- python-virtualenv
- name: Download KA Lite's requirements file
- name: Download {{ kalite_requirements }} to {{ pip_packages_dir }}/kalite.txt
get_url:
url: "{{ kalite_requirements }}"
dest: "{{ pip_packages_dir }}/kalite.txt"
dest: "{{ pip_packages_dir }}/kalite.txt" # /opt/iiab/pip-packages/kalite.txt
timeout: "{{ download_timeout }}"
when: internet_available | bool
@ -22,7 +20,7 @@
# extra_args="--disable-pip-version-check"
# when: internet_available and is_debuntu
- name: Install KA Lite static with pip (debuntu)
- name: Install KA Lite static to {{ kalite_venv }}, using pip (debuntu)
pip:
name: ka-lite-static
version: "{{ kalite_version }}"
@ -40,7 +38,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 to {{ kalite_venv }}, using pip (OS's other than debuntu)
pip:
name: ka-lite-static
version: "{{ kalite_version }}"
@ -57,6 +55,7 @@
- name: Remove libgeos-* pkgs, avoiding KA Lite Django failure on Ubermix
shell: apt -y remove "libgeos-*"
# 2019-10-20: For Fedora 18 legacy (XO laptops) specially
- name: Default is to have cronserve started with KA Lite
set_fact:
job_scheduler_stanza: ""
@ -66,7 +65,7 @@
job_scheduler_stanza: "--skip-job-scheduler "
when: not kalite_cron_enabled
- name: Create 'kalite-serve' service, kalite.sh and kalite.conf
- name: "Install from template: venv wrapper /usr/bin/kalite, systemd unit file kalite-serve.service, Apache's kalite.conf"
template:
backup: no
src: "{{ item.src }}"
@ -75,8 +74,8 @@
group: root
mode: "{{ item.mode }}"
with_items:
- { src: 'kalite-serve.service.j2', dest: '/etc/systemd/system/kalite-serve.service', mode: '0644'}
- { src: 'kalite.sh.j2', dest: '/usr/bin/kalite', mode: '0755'}
- { src: 'kalite-serve.service.j2', dest: '/etc/systemd/system/kalite-serve.service', mode: '0644'}
- { src: 'kalite.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'}
- name: Fix KA Lite bug in regex parsing ifconfig output, for @m-anish's network names that contain dashes

View file

@ -43,15 +43,15 @@
option: "{{ item.option }}"
value: "{{ item.value }}"
with_items:
- option: name
value: "KA Lite"
- option: description
value: '"KA Lite downloads Khan Academy videos for offline use, with exercises and accounts if students want to track their own progress."'
- option: path
value: "{{ kalite_root }}"
- option: port
value: "{{ kalite_server_port }}"
- option: kalite_enabled
value: "{{ kalite_enabled }}"
- option: cron_enabled
value: "{{ kalite_cron_enabled }}"
- option: name
value: "KA Lite"
- option: description
value: '"KA Lite downloads Khan Academy videos for offline use, with exercises and accounts if students want to track their own progress."'
- option: kalite_root
value: "{{ kalite_root }}"
- option: kalite_server_port
value: "{{ kalite_server_port }}"
- option: kalite_enabled
value: "{{ kalite_enabled }}"
- option: kalite_cron_enabled
value: "{{ kalite_cron_enabled }}"

View file

@ -1,16 +1,16 @@
# This is for an OS other than Fedora 18
# For OS's other than Fedora 18
- name: Create kalite_root directory
- name: Create {{ kalite_root }} directory
file:
path: "{{ kalite_root }}/httpsrv/static"
path: "{{ kalite_root }}/httpsrv/static" # /library/ka-lite
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"
command: "{{ kalite_program }} manage setup --username={{ kalite_admin_user }} --password={{ kalite_admin_password }} --noinput" # Runs /usr/local/kalite/venv/bin/kalite
environment:
KALITE_HOME: "{{ kalite_root }}"
KALITE_HOME: "{{ kalite_root }}" # /library/ka-lite
async: 1800
poll: 10

View file

@ -1,13 +1,13 @@
#!/bin/bash -e
CURR_VER="undefined" # Ansible version you currently have installed
GOOD_VER="2.8.5" # For XO laptops (pip install) & CentOS (yum install rpm)
GOOD_VER="2.9.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 (TO INSTALL ANSIBLE)"
echo -e 'Alternative: /opt/iiab/iiab/scripts/ansible-2.7.x ("Slow Food")\n'
echo -e 'Alternative: /opt/iiab/iiab/scripts/ansible-2.8.x ("Slow Food")\n'
echo -e "RECOMMENDED PREREQUISITES:"
echo -e "(1) Verify you're online"
@ -68,7 +68,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian
echo -e "\napt update; install dirmngr; PPA to /etc/apt/sources.list.d/iiab-ansible.list\n"
apt update
apt -y install dirmngr # Raspbian needs. Formerly: python-pip python-setuptools python-wheel patch
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic 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 "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367"\n'
@ -88,7 +88,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian
#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/ubuntu xenial main"'
echo -e 'PPA source "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic 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"

View file

@ -1,7 +1,7 @@
#!/bin/bash -e
CURR_VER="undefined" # Ansible version you currently have installed
GOOD_VER="2.8.5" # For XO laptops (pip install) & CentOS (yum install rpm)
GOOD_VER="2.8.7" # 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
@ -68,7 +68,7 @@ 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.8/ubuntu xenial main" \
echo "deb http://ppa.launchpad.net/ansible/ansible-2.8/ubuntu bionic 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 "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367"\n'
@ -88,7 +88,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian
#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.8/ubuntu xenial main"'
echo -e 'PPA source "deb http://ppa.launchpad.net/ansible/ansible-2.8/ubuntu bionic 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"

View file

@ -1,12 +1,12 @@
#!/bin/bash -e
CURR_VER="undefined" # Ansible version you currently have installed
GOOD_VER="2.7.13" # For XO laptops (pip install) & CentOS (yum install rpm)
GOOD_VER="2.9.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 "\n\nYOU ARE RUNNING: /opt/iiab/iiab/scripts/ansible-2.9.x (TO INSTALL ANSIBLE)"
echo -e 'Alternative: /opt/iiab/iiab/scripts/ansible ("for the very latest Ansible")\n'
echo -e "RECOMMENDED PREREQUISITES:"
@ -68,7 +68,7 @@ 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" \
echo "deb http://ppa.launchpad.net/ansible/ansible-2.9/ubuntu bionic 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 "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367"\n'
@ -88,7 +88,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian
#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 'PPA source "deb http://ppa.launchpad.net/ansible/ansible-2.9/ubuntu bionic 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"