mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 19:22:24 +00:00
Merge pull request #2014 from holta/ka-lite-cleaner
KA Lite playbook cleaner / readability
This commit is contained in:
commit
0c032fac5b
5 changed files with 51 additions and 44 deletions
|
@ -22,7 +22,7 @@ After your Internet-in-a-Box (IIAB) is completely installed, log in to KA Lite t
|
||||||
Bulk Downloading Videos
|
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.
|
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
|
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)
|
* systemctl stop kalite-serve (make sure the systemd service is not running)
|
||||||
* export KALITE_HOME=/library/ka-lite (point kalite to the right environment)
|
* export KALITE_HOME=/library/ka-lite (point kalite to the right environment)
|
||||||
|
|
|
@ -1,31 +1,39 @@
|
||||||
# By the time we get here we should have ka-lite of some version
|
# By the time we get here we should have ka-lite of some version
|
||||||
# And the systemd unit files should be defined
|
# And the systemd unit files should be defined
|
||||||
|
|
||||||
- name: Enable 'kalite-serve' service
|
- name: Enable & (re)start 'kalite-serve' service
|
||||||
service:
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
name: kalite-serve
|
name: kalite-serve
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: started
|
state: restarted
|
||||||
|
when: kalite_enabled
|
||||||
|
|
||||||
- name: Disable 'kalite-serve' service
|
- name: Disable & stop 'kalite-serve' service
|
||||||
service:
|
systemd:
|
||||||
name: kalite-serve
|
name: kalite-serve
|
||||||
enabled: no
|
enabled: no
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not kalite_enabled
|
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:
|
service:
|
||||||
name: kalite-cron
|
name: kalite-cron
|
||||||
enabled: no
|
enabled: no
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not kalite_cron_enabled and is_F18
|
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
|
|
||||||
|
|
|
@ -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 required for KA Lite startup
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: python-virtualenv
|
||||||
state: present
|
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:
|
get_url:
|
||||||
url: "{{ kalite_requirements }}"
|
url: "{{ kalite_requirements }}"
|
||||||
dest: "{{ pip_packages_dir }}/kalite.txt"
|
dest: "{{ pip_packages_dir }}/kalite.txt" # /opt/iiab/pip-packages/kalite.txt
|
||||||
timeout: "{{ download_timeout }}"
|
timeout: "{{ download_timeout }}"
|
||||||
when: internet_available | bool
|
when: internet_available | bool
|
||||||
|
|
||||||
|
@ -22,7 +20,7 @@
|
||||||
# extra_args="--disable-pip-version-check"
|
# extra_args="--disable-pip-version-check"
|
||||||
# when: internet_available and is_debuntu
|
# 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:
|
pip:
|
||||||
name: ka-lite-static
|
name: ka-lite-static
|
||||||
version: "{{ kalite_version }}"
|
version: "{{ kalite_version }}"
|
||||||
|
@ -40,7 +38,7 @@
|
||||||
# extra_args="--disable-pip-version-check"
|
# extra_args="--disable-pip-version-check"
|
||||||
# when: internet_available and not is_debuntu
|
# 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:
|
pip:
|
||||||
name: ka-lite-static
|
name: ka-lite-static
|
||||||
version: "{{ kalite_version }}"
|
version: "{{ kalite_version }}"
|
||||||
|
@ -57,6 +55,7 @@
|
||||||
- name: Remove libgeos-* pkgs, avoiding KA Lite Django failure on Ubermix
|
- name: Remove libgeos-* pkgs, avoiding KA Lite Django failure on Ubermix
|
||||||
shell: apt -y remove "libgeos-*"
|
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
|
- name: Default is to have cronserve started with KA Lite
|
||||||
set_fact:
|
set_fact:
|
||||||
job_scheduler_stanza: ""
|
job_scheduler_stanza: ""
|
||||||
|
@ -66,7 +65,7 @@
|
||||||
job_scheduler_stanza: "--skip-job-scheduler "
|
job_scheduler_stanza: "--skip-job-scheduler "
|
||||||
when: not kalite_cron_enabled
|
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:
|
template:
|
||||||
backup: no
|
backup: no
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
|
@ -75,8 +74,8 @@
|
||||||
group: root
|
group: root
|
||||||
mode: "{{ item.mode }}"
|
mode: "{{ item.mode }}"
|
||||||
with_items:
|
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.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'}
|
- { 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
|
- name: Fix KA Lite bug in regex parsing ifconfig output, for @m-anish's network names that contain dashes
|
||||||
|
|
|
@ -43,15 +43,15 @@
|
||||||
option: "{{ item.option }}"
|
option: "{{ item.option }}"
|
||||||
value: "{{ item.value }}"
|
value: "{{ item.value }}"
|
||||||
with_items:
|
with_items:
|
||||||
- option: name
|
- option: name
|
||||||
value: "KA Lite"
|
value: "KA Lite"
|
||||||
- option: description
|
- option: description
|
||||||
value: '"KA Lite downloads Khan Academy videos for offline use, with exercises and accounts if students want to track their own progress."'
|
value: '"KA Lite downloads Khan Academy videos for offline use, with exercises and accounts if students want to track their own progress."'
|
||||||
- option: path
|
- option: kalite_root
|
||||||
value: "{{ kalite_root }}"
|
value: "{{ kalite_root }}"
|
||||||
- option: port
|
- option: kalite_server_port
|
||||||
value: "{{ kalite_server_port }}"
|
value: "{{ kalite_server_port }}"
|
||||||
- option: kalite_enabled
|
- option: kalite_enabled
|
||||||
value: "{{ kalite_enabled }}"
|
value: "{{ kalite_enabled }}"
|
||||||
- option: cron_enabled
|
- option: kalite_cron_enabled
|
||||||
value: "{{ kalite_cron_enabled }}"
|
value: "{{ kalite_cron_enabled }}"
|
||||||
|
|
|
@ -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:
|
file:
|
||||||
path: "{{ kalite_root }}/httpsrv/static"
|
path: "{{ kalite_root }}/httpsrv/static" # /library/ka-lite
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0755
|
mode: 0755
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Run the setup using 'kalite manage'
|
- 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:
|
environment:
|
||||||
KALITE_HOME: "{{ kalite_root }}"
|
KALITE_HOME: "{{ kalite_root }}" # /library/ka-lite
|
||||||
async: 1800
|
async: 1800
|
||||||
poll: 10
|
poll: 10
|
||||||
|
|
Loading…
Reference in a new issue