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

Merge pull request #2702 from holta/kalite-cleanup3

kalite/tasks/install.yml: basic cleanup of code & comments
This commit is contained in:
A Holt 2021-03-07 16:03:45 -05:00 committed by GitHub
commit f5c20a7373
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,16 +14,15 @@
- name: Install python2, if Raspbian/Debian > 10 or Ubuntu > 19
package:
name:
- python2
- python-setuptools # provides setuptools-44 last version compatible with python2
- python2
- python-setuptools # provides setuptools-44 last version compatible with python2
state: present
when: not (is_debian_9 or is_debian_10 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18 or is_ubuntu_19)
# 2020-03-31: Testing for {is_raspbian_9, is_raspbian_10} is not currently nec, as testing for {is_debian_9, is_debian_10} covers that already.
- name: Use pip to pin setuptools to 44 in {{ kalite_venv }} if Raspbian/Debian > 10 or Ubuntu > 19
pip:
name:
- setuptools==44
name: setuptools==44
virtualenv: "{{ kalite_venv }}" # /usr/local/kalite/venv
virtualenv_site_packages: no
virtualenv_command: /usr/bin/virtualenv
@ -43,7 +42,7 @@
extra_args: "--no-cache-dir"
when: internet_available
- name: "Install from templates: venv wrapper /usr/bin/kalite, systemd unit file kalite-serve.service"
- name: "Install from templates: venv wrapper /usr/bin/kalite, unit file /etc/systemd/system/kalite-serve.service"
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
@ -52,13 +51,15 @@
- { src: 'kalite.sh.j2', dest: '/usr/bin/kalite', mode: '0755' }
- { src: 'kalite-serve.service.j2', dest: '/etc/systemd/system/kalite-serve.service', mode: '0644' }
- name: "Install from template: /etc/{{ apache_conf_dir }}/kalite.conf"
# Useless stanza, for 2 reasons: (1) http://box/kalite was never made to work
# (2) /etc/apache2/sites-available does not exist on many IIAB's w/o Apache
- name: "Install from template: /etc/{{ apache_conf_dir }}/kalite.conf (useless, as http://box/kalite was never made to work)"
template:
src: kalite.conf
dest: "/etc/{{ apache_conf_dir }}" # apache2/sites-available on debuntu
when: apache_installed is defined
- name: Fix KA Lite bug in regex parsing ifconfig output, for @m-anish's network names that contain dashes, if Raspbian/Debian < 11 or Ubuntu < 20
- name: Fix KA Lite bug in regex parsing ifconfig output (ifcfg/parser.py) for @m-anish's network names that contain dashes, if Raspbian/Debian < 11 or Ubuntu < 20
replace:
path: /usr/local/kalite/venv/local/lib/python2.7/site-packages/kalite/packages/dist/ifcfg/parser.py
regexp: 'a-zA-Z0-9'
@ -66,21 +67,21 @@
when: is_debian_9 or is_debian_10 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18 or is_ubuntu_19
# 2020-03-31: Testing for {is_raspbian_9, is_raspbian_10} is not currently nec, as testing for {is_debian_9, is_debian_10} covers that already.
- name: Fix KA Lite bug in regex parsing ifconfig output, for @m-anish's network names that contain dashes, if Raspbian/Debian > 10 or Ubuntu > 19
- name: Fix KA Lite bug in regex parsing ifconfig output (ifcfg/parser.py) for @m-anish's network names that contain dashes, if Raspbian/Debian > 10 or Ubuntu > 19
replace:
path: /usr/local/kalite/venv/lib/python2.7/site-packages/kalite/packages/dist/ifcfg/parser.py
regexp: 'a-zA-Z0-9'
replace: 'a-zA-Z0-9\-'
when: not (is_debian_9 or is_debian_10 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18 or is_ubuntu_19)
# 2020-03-31: Testing for {is_raspbian_9, is_raspbian_10} is not currently nec, as testing for {is_debian_9, is_debian_10} covers that already.
# JV why not just is_ubuntu_20?
# JV: why not just is_ubuntu_20? AH: to make this work on Ubuntu 21+ and ideally Debian/RaspiOS 11+ too?
- name: Create dir {{ kalite_root }}
file:
state: directory
path: "{{ kalite_root }}/httpsrv/static" # /library/ka-lite
- name: Run 'kalite manage setup ...'
- name: Run '{{ kalite_program }} manage setup ...'
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