mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge 1bec10f874
into 423e21c52c
This commit is contained in:
commit
08b9255528
4 changed files with 129 additions and 19 deletions
|
@ -61,3 +61,5 @@ kolibri_admin_password: changeme
|
||||||
|
|
||||||
# Kolibri Preset type: formal, nonformal, informal
|
# Kolibri Preset type: formal, nonformal, informal
|
||||||
kolibri_preset: formal
|
kolibri_preset: formal
|
||||||
|
|
||||||
|
kolibri_venv_path: /usr/local/kolibri
|
||||||
|
|
|
@ -61,6 +61,35 @@
|
||||||
content: 'KOLIBRI_HOME="{{ kolibri_home }}"'
|
content: 'KOLIBRI_HOME="{{ kolibri_home }}"'
|
||||||
dest: /etc/kolibri/daemon.conf
|
dest: /etc/kolibri/daemon.conf
|
||||||
|
|
||||||
|
- name: Using PIP method
|
||||||
|
include_tasks: pip-install.yml
|
||||||
|
when: kolibri_version_pip is defined
|
||||||
|
|
||||||
|
- block:
|
||||||
|
# handles going from pip to deb installs during --reinstall
|
||||||
|
- name: Test for {{ kolibri_exec_path }}
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ kolibri_exec_path }}"
|
||||||
|
register: sym
|
||||||
|
|
||||||
|
- name: Remove if {{ kolibri_exec_path }} is a symlink
|
||||||
|
file:
|
||||||
|
state: absent
|
||||||
|
path: "{{ kolibri_exec_path }}"
|
||||||
|
when: sym.stat.islnk is defined and sym.stat.islnk
|
||||||
|
|
||||||
|
# should not get here if the deb was uninstalled in pip-install.yml
|
||||||
|
- name: Remove kolibre deb if installed
|
||||||
|
apt:
|
||||||
|
name: kolibri
|
||||||
|
state: "absent"
|
||||||
|
when: sym.stat.islnk is defined and sym.stat.islnk
|
||||||
|
# end test
|
||||||
|
|
||||||
|
- name: Remove virtual environment {{ kolibri_venv_path }} if present
|
||||||
|
file:
|
||||||
|
path: "{{ kolibri_venv_path }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
# https://kolibri.readthedocs.io/en/latest/install/ubuntu-debian.html claims:
|
# https://kolibri.readthedocs.io/en/latest/install/ubuntu-debian.html claims:
|
||||||
# "When you use the PPA installation method, upgrades to newer versions
|
# "When you use the PPA installation method, upgrades to newer versions
|
||||||
|
@ -124,6 +153,12 @@
|
||||||
# codename: focal # UPDATE THIS TO 'jammy' AFTER "RasPiOS Bookworm" (based on Debian 12) IS RELEASED! (ETA Q3 2023)
|
# codename: focal # UPDATE THIS TO 'jammy' AFTER "RasPiOS Bookworm" (based on Debian 12) IS RELEASED! (ETA Q3 2023)
|
||||||
# when: is_debian or is_linuxmint_20
|
# when: is_debian or is_linuxmint_20
|
||||||
|
|
||||||
|
# Needs discussiion
|
||||||
|
# --reinstalls should work uninstall then install
|
||||||
|
# - name: Remove kolibre deb if installed
|
||||||
|
# apt:
|
||||||
|
# name: kolibri
|
||||||
|
# state: "absent"
|
||||||
|
|
||||||
# 2024-08-07: Hack no longer needed! As Kolibri 0.17.0 now installs via "kolibri" PPA (https://launchpad.net/~learningequality/+archive/ubuntu/kolibri).
|
# 2024-08-07: Hack no longer needed! As Kolibri 0.17.0 now installs via "kolibri" PPA (https://launchpad.net/~learningequality/+archive/ubuntu/kolibri).
|
||||||
# Hopefully "kolibri-proposed" PPA will install 0.18 pre-releases soon, on Python 3.13 too! https://github.com/learningequality/kolibri/issues/11892
|
# Hopefully "kolibri-proposed" PPA will install 0.18 pre-releases soon, on Python 3.13 too! https://github.com/learningequality/kolibri/issues/11892
|
||||||
|
@ -154,6 +189,8 @@
|
||||||
file:
|
file:
|
||||||
state: absent
|
state: absent
|
||||||
path: /root/.kolibri
|
path: /root/.kolibri
|
||||||
|
# end block
|
||||||
|
when: kolibri_version_pip is undefined
|
||||||
|
|
||||||
- name: 'Install from template: /etc/systemd/system/kolibri.service'
|
- name: 'Install from template: /etc/systemd/system/kolibri.service'
|
||||||
template:
|
template:
|
||||||
|
|
|
@ -26,6 +26,11 @@
|
||||||
# kolibri_provision: False
|
# kolibri_provision: False
|
||||||
# when: ???
|
# when: ???
|
||||||
|
|
||||||
|
- name: Set kolibri_version_pip if
|
||||||
|
set_fact:
|
||||||
|
kolibri_version_pip: 0.17.5
|
||||||
|
when: (is_debian_13 or is_ubuntu_2504) and kolibri_version_pip is undefined
|
||||||
|
|
||||||
- name: Install Kolibri, if 'kolibri_installed' not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml
|
- name: Install Kolibri, if 'kolibri_installed' not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml
|
||||||
include_tasks: install.yml
|
include_tasks: install.yml
|
||||||
when: kolibri_installed is undefined
|
when: kolibri_installed is undefined
|
||||||
|
|
66
roles/kolibri/tasks/pip-install.yml
Normal file
66
roles/kolibri/tasks/pip-install.yml
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
- name: Remove kolibri deb if installed
|
||||||
|
apt:
|
||||||
|
name: kolibri
|
||||||
|
state: "absent"
|
||||||
|
|
||||||
|
- name: Remove repo if present
|
||||||
|
file:
|
||||||
|
path: /etc/apt/sources.list.d/ppa_launchpad_net_learningequality_kolibri_ubuntu.list
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Remove previous virtual environment {{ kolibri_venv_path }}
|
||||||
|
file:
|
||||||
|
path: "{{ kolibri_venv_path }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
# can't hurt but should be called in as a dependency
|
||||||
|
- name: Install prep for kolibri when NOT is_debian_13 or is_ubuntu_2504
|
||||||
|
pip:
|
||||||
|
name:
|
||||||
|
- pip
|
||||||
|
- wheel
|
||||||
|
- setuptools
|
||||||
|
- cgi
|
||||||
|
virtualenv: "{{ kolibri_venv_path }}"
|
||||||
|
virtualenv_command: python3 -m venv "{{ kolibri_venv_path }}"
|
||||||
|
extra_args: "--no-cache-dir --prefer-binary"
|
||||||
|
when: not (is_debian_13 or is_ubuntu_2504)
|
||||||
|
|
||||||
|
# package name change
|
||||||
|
- name: Install prep for kolibri when is_debian_13 or is_ubuntu_2504
|
||||||
|
pip:
|
||||||
|
name:
|
||||||
|
- pip
|
||||||
|
- wheel
|
||||||
|
- setuptools
|
||||||
|
- legacy-cgi
|
||||||
|
virtualenv: "{{ kolibri_venv_path }}"
|
||||||
|
virtualenv_command: python3 -m venv "{{ kolibri_venv_path }}"
|
||||||
|
extra_args: "--no-cache-dir --prefer-binary"
|
||||||
|
when: (is_debian_13 or is_ubuntu_2504)
|
||||||
|
|
||||||
|
- name: Install kolibri {{ kolibri_version_pip }} using pip
|
||||||
|
pip:
|
||||||
|
name: kolibri
|
||||||
|
version: "{{ kolibri_version_pip }}"
|
||||||
|
virtualenv: "{{ kolibri_venv_path }}"
|
||||||
|
virtualenv_command: python3 -m venv "{{ kolibri_venv_path }}"
|
||||||
|
extra_args: "--no-cache-dir --prefer-binary --ignore-requires-python"
|
||||||
|
when: kolibri_version_pip_web is undefined
|
||||||
|
|
||||||
|
# use kolibri_version_pip_web: https://github.com/learningequality/kolibri/releases/download/<release> and set kolibri_version_pip
|
||||||
|
# and not the full path note v0.18.0-alpha1/kolibri-0.18.0a1-py2.py3-none-any.whl
|
||||||
|
- name: Install kolibri using {{ kolibri_version_pip_web }}/{{ kolibri_version_pip }}-py2.py3-none-any.whl
|
||||||
|
pip:
|
||||||
|
name: "{{ kolibri_version_pip_web }}/kolibri-{{ kolibri_version_pip }}-py2.py3-none-any.whl"
|
||||||
|
virtualenv: "{{ kolibri_venv_path }}"
|
||||||
|
virtualenv_command: python3 -m venv "{{ kolibri_venv_path }}"
|
||||||
|
extra_args: "--no-cache-dir --prefer-binary --ignore-requires-python"
|
||||||
|
when: kolibri_version_pip_web is defined
|
||||||
|
|
||||||
|
- name: Create {{ kolibri_exec_path }} symlink to {{ kolibri_venv_path }}/bin/kolibri
|
||||||
|
file:
|
||||||
|
src: "{{ kolibri_venv_path }}/bin/kolibri"
|
||||||
|
dest: "{{ kolibri_exec_path }}"
|
||||||
|
state: link
|
||||||
|
force: true
|
Loading…
Add table
Add a link
Reference in a new issue