mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 11:12:06 +00:00
rm roles/kalite/tasks/*.unused
This commit is contained in:
parent
50a5cc0d85
commit
85854a2d97
5 changed files with 0 additions and 276 deletions
|
@ -1,59 +0,0 @@
|
|||
# By the time we get here we should have ka-lite of some version
|
||||
# And the systemd unit files should be defined
|
||||
|
||||
- name: Enable & (re)start 'kalite-serve' service
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: kalite-serve
|
||||
enabled: yes
|
||||
state: restarted
|
||||
when: kalite_enabled
|
||||
|
||||
- name: Disable & stop 'kalite-serve' service
|
||||
systemd:
|
||||
name: kalite-serve
|
||||
enabled: no
|
||||
state: stopped
|
||||
when: not kalite_enabled
|
||||
|
||||
# 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: 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: Add 'kalite' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
path: "{{ iiab_ini_file }}"
|
||||
section: kalite
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value | string }}"
|
||||
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 }}"
|
|
@ -1,76 +0,0 @@
|
|||
# This is for Fedora 18, assumed to be an XO
|
||||
|
||||
- name: Install dependent packages (Fedora 18)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- python-psutil
|
||||
- expect
|
||||
when: is_F18 | bool
|
||||
|
||||
- name: Install dependent pip packages (Fedora 18)
|
||||
pip:
|
||||
name: selenium
|
||||
when: internet_available and is_F18
|
||||
|
||||
- name: Determine if KA Lite is already downloaded
|
||||
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
|
||||
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
|
||||
|
||||
- name: Create kalite_root directory (Fedora 18)
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
- 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 }}"
|
||||
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'}
|
||||
- { src: 'f18/iiab_cronservectl.sh.j2', dest: '{{ kalite_root }}/scripts/iiab_cronservectl.sh', mode: '0755'}
|
|
@ -1,95 +0,0 @@
|
|||
# For OS's other than Fedora 18
|
||||
- name: Download {{ kalite_requirements }} to {{ pip_packages_dir }}/kalite.txt
|
||||
get_url:
|
||||
url: "{{ kalite_requirements }}"
|
||||
dest: "{{ pip_packages_dir }}/kalite.txt" # /opt/iiab/pip-packages/kalite.txt
|
||||
timeout: "{{ download_timeout }}"
|
||||
when: internet_available | bool
|
||||
|
||||
# 2020-01-19: https://github.com/piwheels/packages/issues/74 says the following is not longer needed...
|
||||
#- name: Run 'mv /etc/pip.conf /etc/pip.conf.see-iiab-issue-2139' as "TEMPORARY" workaround (2020-01-17) for piwheels.org's setuptools Python 2/3 brokenness on RPi (https://github.com/iiab/iiab/issues/2139)
|
||||
# command: mv /etc/pip.conf /etc/pip.conf.see-iiab-issue-2139
|
||||
# ignore_errors: yes
|
||||
# when: is_raspbian | bool
|
||||
|
||||
#- name: Install KA Lite non-static + reqs file with pip - (debuntu)
|
||||
# pip: requirements={{ pip_packages_dir }}/kalite.txt
|
||||
# virtualenv={{ kalite_venv }}
|
||||
# virtualenv_site_packages=no
|
||||
# extra_args="--no-cache-dir"
|
||||
# extra_args="--disable-pip-version-check"
|
||||
# when: internet_available and is_debuntu
|
||||
|
||||
- name: Install KA Lite static to {{ kalite_venv }}, using pip (debuntu)
|
||||
pip:
|
||||
name: ka-lite-static
|
||||
version: "{{ kalite_version }}"
|
||||
virtualenv: "{{ kalite_venv }}"
|
||||
virtualenv_site_packages: no
|
||||
virtualenv_command: /usr/bin/virtualenv
|
||||
virtualenv_python: python2.7
|
||||
extra_args: "--no-cache-dir"
|
||||
# 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)
|
||||
# pip: requirements={{ pip_packages_dir }}/kalite.txt
|
||||
# virtualenv={{ kalite_venv }}
|
||||
# virtualenv_site_packages=no
|
||||
# extra_args="--no-cache-dir"
|
||||
# extra_args="--disable-pip-version-check"
|
||||
# when: internet_available and not is_debuntu
|
||||
|
||||
- name: Install KA Lite static to {{ kalite_venv }}, using pip (OS's other than debuntu)
|
||||
pip:
|
||||
name: ka-lite-static
|
||||
version: "{{ kalite_version }}"
|
||||
virtualenv: "{{ kalite_venv }}"
|
||||
virtualenv_site_packages: no
|
||||
virtualenv_command: /usr/bin/virtualenv
|
||||
virtualenv_python: python2.7
|
||||
# extra_args="--no-cache-dir"
|
||||
# extra_args="--disable-pip-version-check"
|
||||
when: internet_available and not is_debuntu
|
||||
|
||||
# This effectively does nothing at all on Ubuntu & Raspbian, where libgeos-*
|
||||
# pkgs are not installed FWIW. But it's included to safeguard us across all
|
||||
# OS's, in case others OS's like Ubermix later appear. See #1382 for details.
|
||||
# Removing pkgs libgeos-3.6.2 & libgeos-c1v5 fixed the situation on Ubermix!
|
||||
- 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: ""
|
||||
|
||||
- name: Add --skip-job-scheduler to start if cronserve not enabled
|
||||
set_fact:
|
||||
job_scheduler_stanza: "--skip-job-scheduler "
|
||||
when: not kalite_cron_enabled
|
||||
|
||||
- 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 }}"
|
||||
dest: "{{ item.dest }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "{{ item.mode }}"
|
||||
with_items:
|
||||
- { 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_conf_dir }}', mode: '0644'}
|
||||
|
||||
- name: Fix KA Lite bug in regex parsing ifconfig output, for @m-anish's network names that contain dashes
|
||||
replace:
|
||||
path: /usr/local/kalite/venv/local/lib/python2.7/site-packages/kalite/packages/dist/ifcfg/parser.py
|
||||
regexp: 'a-zA-Z0-9'
|
||||
replace: 'a-zA-Z0-9\-'
|
||||
|
||||
|
||||
# RECORD KA Lite AS INSTALLED
|
||||
|
||||
# TO DO: move the last 2 stanzas from setup.yml so they live right here,
|
||||
# as any action named "install.yml" should do exactly what it says (install!)
|
|
@ -1,14 +0,0 @@
|
|||
# This is for Fedora 18, assumed to be an XO
|
||||
|
||||
- name: Run the setup using 'kalite manage' (Fedora 18)
|
||||
command: "/usr/bin/su {{ kalite_user }} -c '{{ kalite_root }}/bin/kalite manage setup --username={{ kalite_user }} --password={{ kalite_password }} --noinput'"
|
||||
async: 900
|
||||
poll: 10
|
||||
|
||||
- name: Finish setup by running 'kalite start' (Fedora 18)
|
||||
command: "/usr/bin/su {{ kalite_user }} -c '{{ kalite_root }}/bin/kalite start'"
|
||||
async: 900
|
||||
poll: 10
|
||||
|
||||
- name: Stop kalite server started in previous step because we use systemd
|
||||
command: "/usr/bin/su {{ kalite_user }} -c '{{ kalite_root }}/bin/kalite stop'"
|
|
@ -1,32 +0,0 @@
|
|||
# For OS's other than Fedora 18
|
||||
|
||||
- name: Create {{ kalite_root }} directory
|
||||
file:
|
||||
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" # Runs /usr/local/kalite/venv/bin/kalite
|
||||
environment:
|
||||
KALITE_HOME: "{{ kalite_root }}" # /library/ka-lite
|
||||
async: 1800
|
||||
poll: 10
|
||||
|
||||
|
||||
# RECORD KA Lite AS INSTALLED
|
||||
|
||||
# TO DO: move these last 2 stanzas to install.yml,
|
||||
# as any action named "install.yml" should do exactly what it says (install!)
|
||||
|
||||
- name: "Set 'kalite_installed: True'"
|
||||
set_fact:
|
||||
kalite_installed: True
|
||||
|
||||
- name: "Add 'kalite_installed: True' to {{ iiab_state_file }}"
|
||||
lineinfile:
|
||||
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
||||
regexp: '^kalite_installed'
|
||||
line: 'kalite_installed: True'
|
Loading…
Reference in a new issue