From 2c77593654456de3297478a3ed334ca81e463355 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 7 Mar 2021 15:34:04 -0500 Subject: [PATCH 1/4] kalite/tasks/install.yml: basic cleanup of code & comments --- roles/kalite/tasks/install.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index 6960f73fd..9e6d7ceb9 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -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,7 +51,9 @@ - { 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 @@ -73,7 +74,7 @@ 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 11+ too? - name: Create dir {{ kalite_root }} file: From 7ddd6736fefeb9240f3c8ce9260840b639d50b70 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 7 Mar 2021 15:45:25 -0500 Subject: [PATCH 2/4] kalite/tasks/install.yml: a bit more explanatory --- roles/kalite/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index 9e6d7ceb9..da5601376 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -81,7 +81,7 @@ 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 From a26f5a6e2abced7cd6f8914e630986617910872a Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 7 Mar 2021 15:47:46 -0500 Subject: [PATCH 3/4] kalite/tasks/install.yml: clarify in-line comment --- roles/kalite/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index da5601376..a81f3e032 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -74,7 +74,7 @@ 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? AH: to make this work on Ubuntu 21+ and ideally Debian 11+ too? + # 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: From 0cfbe799fddf3f271def7a822c06e13f8fd975f4 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 7 Mar 2021 16:00:28 -0500 Subject: [PATCH 4/4] kalite/tasks/install.yml: Clarifs in Ansible output --- roles/kalite/tasks/install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index a81f3e032..0ba4a0941 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -59,7 +59,7 @@ 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' @@ -67,7 +67,7 @@ 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'