From e39f5069a2f55ad9e44af1e93bd129da2034fd81 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 17:36:31 -0400 Subject: [PATCH 01/24] Update kalite/tasks/main.yml --- roles/kalite/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index 7335cafbe..18f46dc65 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -30,7 +30,7 @@ name: kalite-serve enabled: yes state: restarted - when: kalite_enabled + when: kalite_enabled | bool - name: Disable & Stop 'kalite-serve' service, if not kalite_enabled systemd: From ad3df8ac653d698f8c77aa0262881e7eae6cc81f Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 17:47:08 -0400 Subject: [PATCH 02/24] Update calibre/tasks/main.yml --- roles/calibre/tasks/main.yml | 86 ++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 4 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 6b0a77d70..e5c9d11c1 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -1,5 +1,83 @@ -- include_tasks: install.yml - when: calibre_install and not calibre_installed is defined +# "How do i fail a task in Ansible if the variable contains a boolean value? +# I want to perform input validation for Ansible playbooks" +# https://stackoverflow.com/questions/46664127/how-do-i-fail-a-task-in-ansible-if-the-variable-contains-a-boolean-value-i-want/46667499#46667499 -- include_tasks: enable.yml - when: calibre_install or calibre_installed is defined +# We assume 0-init/tasks/validate_vars.yml has DEFINITELY been run, so no need +# to re-check whether vars are defined here. As Ansible vars cannot be unset: +# https://serverfault.com/questions/856729/how-to-destroy-delete-unset-a-variable-value-in-ansible + +- name: Assert that "calibre_install is sameas true" (boolean not string etc) + assert: + that: calibre_install is sameas true + fail_msg: "PLEASE SET 'calibre_install: True' e.g. IN: /etc/iiab/local_vars.yml" + quiet: yes + +- name: Assert that "calibre_enabled | type_debug == 'bool'" (boolean not string etc) + assert: + that: calibre_enabled | type_debug == 'bool' + fail_msg: "PLEASE GIVE VARIABLE 'calibre_enabled' A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml" + quiet: yes + + +- name: Install Calibre if 'calibre_installed' not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml + include_tasks: install.yml + when: calibre_installed is undefined + +# http://box:8080 & http://box:8080/mobile WORK BUT OTHER URL'S LIKE http://box/calibre ARE A MESS (BOOKS RARELY DISPLAY) +# +# 2018-08-27 POSSIBLE FIX...CONSIDER THIS ProxyPass / ProxyPassReverse TECHNIQUE: +# https://github.com/iiab/iiab/tree/master/roles/calibre-web/templates/calibre-web.conf.j2 +# (anyway this works great for calibre-web, allowing http://box/books +# to work even better than http://box:8083 when box == 192.168.0.x !) +# +#- name: Attempt to enable http://box/calibre via Apache (UNTESTED) +# command: a2ensite calibre.conf +# when: apache_installed and calibre_enabled +# +#- name: Attempt to disable http://box/calibre via Apache (UNTESTED) +# command: a2dissite calibre.conf +# when: apache_installed and not calibre_enabled + +- name: Enable & (Re)Start 'calibre-serve' service, if calibre_enabled + systemd: + daemon_reload: yes + name: calibre-serve + enabled: yes + state: restarted + when: calibre_enabled | bool + +- name: Disable & Stop 'calibre-serve' service, if not calibre_enabled + systemd: + name: calibre-serve + enabled: no + state: stopped + when: not calibre_enabled + +#- name: Enable/Disable/Restart Apache if primary +# include_tasks: apache.yml +# when: not nginx_enabled +# +#- name: Enable/Disable/Restart NGINX if primary +# include_tasks: nginx.yml +# when: nginx_enabled | bool + + +- name: Add 'calibre' variable values to {{ iiab_ini_file }} + ini_file: + path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini + section: calibre + option: "{{ item.option }}" + value: "{{ item.value | string }}" + with_items: + - option: name + value: Calibre + - option: description + value: '"Calibre is an extremely popular personal library system for e-books."' + - option: calibre_src_url + value: "{{ calibre_src_url }}" + - option: calibre_dbpath + value: "{{ calibre_dbpath }}" + - option: calibre_port + value: "{{ calibre_port }}" + - option: calibre_enabled + value: "{{ calibre_enabled }}" From 81ad70277e385bdbc8a0e4b7b7b418465736000a Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 17:47:52 -0400 Subject: [PATCH 03/24] Delete calibre/tasks/enable.yml --- roles/calibre/tasks/enable.yml | 49 ---------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 roles/calibre/tasks/enable.yml diff --git a/roles/calibre/tasks/enable.yml b/roles/calibre/tasks/enable.yml deleted file mode 100644 index 21bde746b..000000000 --- a/roles/calibre/tasks/enable.yml +++ /dev/null @@ -1,49 +0,0 @@ -# 5. WRAP UP: ENABLE CALIBRE SERVICE, http://box/books ETC - -# http://box:8080 & http://box:8080/mobile WORK BUT OTHER URL'S LIKE http://box/calibre ARE A MESS (BOOKS RARELY DISPLAY) -# -# 2018-08-27 POSSIBLE FIX...CONSIDER THIS ProxyPass / ProxyPassReverse TECHNIQUE: -# https://github.com/iiab/iiab/tree/master/roles/calibre-web/templates/calibre-web.conf.j2 -# (anyway this works great for calibre-web, allowing http://box/books -# to work even better than http://box:8083 when box == 192.168.0.x !) -- name: Attempt to enable http://box/calibre via Apache (UNTESTED) - command: a2ensite calibre.conf - when: apache_installed and calibre_enabled - -- name: Attempt to disable http://box/calibre via Apache (UNTESTED) - command: a2dissite calibre.conf - when: apache_installed and not calibre_enabled - -- name: Enable & Start service 'calibre-serve' (/usr/bin/calibre-server by Kovid Goyal) - service: - name: calibre-serve - enabled: yes - state: started - when: calibre_enabled | bool - #async: 900 - #poll: 5 - -- name: Reload Apache service ({{ apache_service }}) - systemd: - name: "{{ apache_service }}" - state: reloaded - -- name: Add 'calibre' variable values to {{ iiab_ini_file }} - ini_file: - path: "{{ iiab_ini_file }}" - section: calibre - option: "{{ item.option }}" - value: "{{ item.value | string }}" - with_items: - - option: name - value: Calibre - - option: description - value: '"Calibre is an extremely popular personal library system for e-books."' - - option: url - value: "{{ calibre_src_url }}" - - option: database - value: "{{ calibre_dbpath }}" - - option: port - value: "{{ calibre_port }}" - - option: calibre_enabled - value: "{{ calibre_enabled }}" From 719d680d4cf704d9153847cf44fac8c4de8b665b Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:41:15 -0400 Subject: [PATCH 04/24] Update calibre/tasks/install.yml --- roles/calibre/tasks/install.yml | 58 +++++++++++++-------------------- 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/roles/calibre/tasks/install.yml b/roles/calibre/tasks/install.yml index 1424a81b5..2a48c1127 100644 --- a/roles/calibre/tasks/install.yml +++ b/roles/calibre/tasks/install.yml @@ -1,25 +1,22 @@ -# 1. INSTALL THE LATEST CALIBRE 3.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S +# 1. INSTALL CALIBRE 4.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S -- name: Does /usr/bin/calibre exist? - stat: - path: "/usr/bin/calibre" - register: calib_executable +#- name: "Install OS's latest packages: calibre, calibre-bin" +# package: +# name: +# - calibre +# - calibre-bin +# state: latest -- name: "Install OS's latest packages: calibre, calibre-bin (IF not rpi AND /usr/bin/calibre MISSING)" - package: - name: - - calibre - - calibre-bin - state: latest - when: internet_available and not is_raspbian and (not calib_executable.stat.exists) +# May require above 2 pkgs first? +- name: Install Calibre via .debs (raspbian) + command: scripts/calibre-install-latest-rpi.sh # WORKED for Calibre 3.33.1 on 2018-10-23. And Calibre 3.28 on 2018-07-26 (PR #971). Likewise for Calibre 3.26.x. FAILED with Calibre 3.24+ ("calibre : Depends: python-pyqt5 (>= 5.10.1+dfsg-2) but 5.10.1+dfsg-1+rpi1 is to be installed") since June 2018. + #include_tasks: debs.yml + when: is_raspbian | bool -- name: Install Calibre .debs IF calibre_via_debs (AND /usr/bin/calibre WAS MISSING) - include_tasks: debs.yml - when: calibre_via_debs and (not calib_executable.stat.exists) - -- name: Install Calibre via calibre-installer.py IF calibre_via_python (AND /usr/bin/calibre WAS MISSING) +# May require above 2 pkgs first? +- name: Install Calibre via py-installer.yml -> calibre-installer.py (not raspbian) include_tasks: py-installer.yml - when: calibre_via_python and (not calib_executable.stat.exists) + when: not is_raspbian # SEE calibre_via_python's value vars/default_vars.yml, vars/ubuntu-18.yml & # vars/raspbian-9.yml: try to AVOID Python installer on Raspbian since its @@ -34,19 +31,13 @@ # 2. SYSTEMD SERVICES -- name: Create calibre-serve.service and calibre.conf (IF /usr/bin/calibre WAS MISSING) +- name: Create /etc/systemd/system/calibre-serve.service and /etc/calibre.conf template: src: "{{ item.src }}" dest: "{{ item.dest }}" - owner: root - group: root - mode: "{{ item.mode }}" - backup: no - #register: calibre_config with_items: - - { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'} - - { src: 'calibre.conf', dest: '/etc/{{ apache_conf_dir }}', mode: '0644'} - when: (not calib_executable.stat.exists) + - { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service'} + - { src: 'calibre.conf', dest: '/etc/{{ apache_conf_dir }}'} - name: Stop service 'calibre-serve' (/usr/bin/calibre-server by Kovid Goyal) systemd: @@ -57,20 +48,15 @@ # 3. CREATE USER DATABASE -- name: Create /library/calibre (mandatory since Calibre 3.x) +- name: Create {{ calibre_dbpath }} (mandatory since Calibre 3.x) file: - path: "{{ calibre_dbpath }}" + path: "{{ calibre_dbpath }}" # /library/calibre state: directory - #mode: 0755 -- name: Copy template userdb to /library/calibre/users.sqlite (IF /usr/bin/calibre WAS MISSING) +- name: Copy template userdb to {{ calibre_userdb }} copy: src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite - dest: "{{ calibre_userdb }}" - owner: root - group: root - mode: 0644 - when: (not calib_executable.stat.exists) + dest: "{{ calibre_userdb }}" # /library/calibre/users.sqlite # 4. CREATE CONTENT DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x) From bad864d995617c18bcc4f47b50a01ebe4105f88f Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:43:22 -0400 Subject: [PATCH 05/24] Update raspbian-10.yml --- vars/raspbian-10.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vars/raspbian-10.yml b/vars/raspbian-10.yml index 1f156a007..3c73327bc 100644 --- a/vars/raspbian-10.yml +++ b/vars/raspbian-10.yml @@ -27,11 +27,6 @@ sshd_service: ssh php_version: 7.3 postgresql_version: 11 systemd_location: /lib/systemd/system -# Upgrade Raspbian Buster's Calibre 3.x: (via role/calibre/tasks/debs.yml, -# with .deb's released about 5-10 days after Calibre's quasi-monthly releases) -calibre_via_debs: True -# roles/calibre/tasks/py-installer.yml FAILS on ARM as of 2018-05-10: -calibre_via_python: False # minetest for rpi minetest_server_bin: /library/games/minetest/bin/minetestserver From 9cd5b7414868253268cb8aa9a68fb4e338e8b2a3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:43:34 -0400 Subject: [PATCH 06/24] Update ubuntu-20.yml --- vars/ubuntu-20.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/ubuntu-20.yml b/vars/ubuntu-20.yml index de8990863..f58ba79ed 100644 --- a/vars/ubuntu-20.yml +++ b/vars/ubuntu-20.yml @@ -27,6 +27,3 @@ php_version: 7.4 # "postgresql_version: 11.2" failed (too detailed for /etc/systemd/system/postgresql-iiab.service on Ubuntu 19.04) postgresql_version: 12 systemd_location: /lib/systemd/system -# Upgrade Ubuntu 20.04's Calibre 4.x to very latest...for now? -calibre_via_debs: False -calibre_via_python: True From 317ccda90cfa09eac9ada397d4b3993d96c7bdea Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:43:42 -0400 Subject: [PATCH 07/24] Update debian-10.yml --- vars/debian-10.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/debian-10.yml b/vars/debian-10.yml index 9780612da..3dc80fa27 100644 --- a/vars/debian-10.yml +++ b/vars/debian-10.yml @@ -25,6 +25,3 @@ sshd_service: ssh php_version: 7.3 postgresql_version: 11 systemd_location: /lib/systemd/system -# Upgrade OS's own Calibre to very latest: -calibre_via_debs: False -calibre_via_python: True From f826395e4483c197e630d89391d32635c7e2d3ec Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:44:56 -0400 Subject: [PATCH 08/24] Update ubuntu-19.yml --- vars/ubuntu-19.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/ubuntu-19.yml b/vars/ubuntu-19.yml index 348146c67..ac6ccda75 100644 --- a/vars/ubuntu-19.yml +++ b/vars/ubuntu-19.yml @@ -27,6 +27,3 @@ php_version: 7.3 # "postgresql_version: 11.2" fails (too detailed for /etc/systemd/system/postgresql-iiab.service on Ubuntu 19.04) postgresql_version: 11 systemd_location: /lib/systemd/system -# Upgrade Ubuntu 19.x's Calibre 3.39.1+ to very latest -calibre_via_debs: False -calibre_via_python: True From 9a8aba76e486bb7130b1391890f4e7571098f901 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:45:25 -0400 Subject: [PATCH 09/24] Update ubuntu-18.yml --- vars/ubuntu-18.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/ubuntu-18.yml b/vars/ubuntu-18.yml index 1b5579da8..32b0923b6 100644 --- a/vars/ubuntu-18.yml +++ b/vars/ubuntu-18.yml @@ -27,6 +27,3 @@ php_version: 7.2 # "postgresql_version: 10.3" fails (too detailed for /etc/systemd/system/postgresql-iiab.service on Ubuntu 18.04) postgresql_version: 10 systemd_location: /lib/systemd/system -# Upgrade Ubuntu 18.04's Calibre 3.21.0 to very latest: -calibre_via_debs: False -calibre_via_python: True From 518431397292c5277adb59c9d4a926caa81e1d98 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:46:20 -0400 Subject: [PATCH 10/24] Update ubuntu-17.yml --- vars/ubuntu-17.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/ubuntu-17.yml b/vars/ubuntu-17.yml index 751b16706..ff03515e0 100644 --- a/vars/ubuntu-17.yml +++ b/vars/ubuntu-17.yml @@ -26,6 +26,3 @@ sshd_service: ssh php_version: 7.1 postgresql_version: 9.6 systemd_location: /lib/systemd/system -# Upgrade Ubuntu 17.10's Calibre 3.7.0 to very latest: -calibre_via_debs: False -calibre_via_python: True From 8456d7b91e75095519ed89dcd492d53550cb8ce6 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:46:35 -0400 Subject: [PATCH 11/24] Update ubuntu-16.yml --- vars/ubuntu-16.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/ubuntu-16.yml b/vars/ubuntu-16.yml index 96312974a..5c1cdeb7e 100644 --- a/vars/ubuntu-16.yml +++ b/vars/ubuntu-16.yml @@ -25,6 +25,3 @@ sshd_service: ssh php_version: 7.0 postgresql_version: 9.5 systemd_location: /lib/systemd/system -# Upgrade Ubuntu 16.04's Calibre 2.55.0 to very latest: -calibre_via_debs: False -calibre_via_python: True From 652d5a8a4b5adab8fffec34470136e437351b9ac Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:47:01 -0400 Subject: [PATCH 12/24] Update raspbian-9.yml --- vars/raspbian-9.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vars/raspbian-9.yml b/vars/raspbian-9.yml index 069afaac9..d25755700 100644 --- a/vars/raspbian-9.yml +++ b/vars/raspbian-9.yml @@ -27,11 +27,6 @@ sshd_service: ssh php_version: 7.0 postgresql_version: 9.6 systemd_location: /lib/systemd/system -# Upgrade Raspbian Stretch's Calibre 2.75.1: (via role/calibre/tasks/debs.yml, -# with .deb's released about 5-10 days after Calibre's quasi-monthly releases) -calibre_via_debs: True -# roles/calibre/tasks/py-installer.yml FAILS on ARM as of 2018-05-10: -calibre_via_python: False # minetest for rpi minetest_server_bin: /library/games/minetest/bin/minetestserver From 703b5149f9b35cfff6e6ac27467895b4ad31911f Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:47:20 -0400 Subject: [PATCH 13/24] Update raspbian-8.yml --- vars/raspbian-8.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vars/raspbian-8.yml b/vars/raspbian-8.yml index 1d5e190e3..94d628895 100644 --- a/vars/raspbian-8.yml +++ b/vars/raspbian-8.yml @@ -26,8 +26,3 @@ sshd_service: ssh php_version: 5 postgresql_version: 9.4 systemd_location: /lib/systemd/system -# Upgrade Raspbian Jessie's Calibre 2.5.0: (via role/calibre/tasks/debs.yml, -# with .deb's released about 5-10 days after Calibre's quasi-monthly releases) -calibre_via_debs: True -# roles/calibre/tasks/py-installer.yml FAILS on ARM as of 2018-05-10: -calibre_via_python: False From b5293845ba5a2ed7bc178b3280fd22f8cd263241 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:47:36 -0400 Subject: [PATCH 14/24] Update fedora-22.yml --- vars/fedora-22.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/fedora-22.yml b/vars/fedora-22.yml index 2c8ec05b6..6dcfa4337 100644 --- a/vars/fedora-22.yml +++ b/vars/fedora-22.yml @@ -22,6 +22,3 @@ apache_log: /var/log/httpd/access_log sshd_package: openssh-server sshd_service: sshd systemd_location: /usr/lib/systemd/system -# Upgrade OS's own Calibre to very latest: -calibre_via_debs: False -calibre_via_python: True From 7ecd3afddf1213a3cd78fceab24ecbca23dc773c Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:47:51 -0400 Subject: [PATCH 15/24] Update fedora-18.yml --- vars/fedora-18.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/fedora-18.yml b/vars/fedora-18.yml index ca863a016..f35a81364 100644 --- a/vars/fedora-18.yml +++ b/vars/fedora-18.yml @@ -26,6 +26,3 @@ sshd_service: sshd nextcloud_install: False nextcloud_enabled: False systemd_location: /usr/lib/systemd/system -# Upgrade OS's own Calibre to very latest: -calibre_via_debs: False -calibre_via_python: True From 6586726e705066dce1e31329fb2854484e8d555a Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:48:14 -0400 Subject: [PATCH 16/24] Update debian-9.yml --- vars/debian-9.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/debian-9.yml b/vars/debian-9.yml index 19ef67bb3..ac1fc1b73 100644 --- a/vars/debian-9.yml +++ b/vars/debian-9.yml @@ -25,6 +25,3 @@ sshd_service: ssh php_version: 7.0 postgresql_version: 9.6 systemd_location: /lib/systemd/system -# Upgrade OS's own Calibre to very latest: -calibre_via_debs: False -calibre_via_python: True From 879244d379c10809a327f19f7265660d3045dd40 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:48:29 -0400 Subject: [PATCH 17/24] Update debian-8.yml --- vars/debian-8.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/debian-8.yml b/vars/debian-8.yml index bb23c04b0..e1713a1df 100644 --- a/vars/debian-8.yml +++ b/vars/debian-8.yml @@ -24,6 +24,3 @@ sshd_service: ssh php_version: 5 postgresql_version: 9.4 systemd_location: /lib/systemd/system -# Upgrade OS's own Calibre to very latest: -calibre_via_debs: False -calibre_via_python: True From 9301e4d4851a16891c56e3788b58a4030e048bca Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 18:48:46 -0400 Subject: [PATCH 18/24] Update centos-7.yml --- vars/centos-7.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/vars/centos-7.yml b/vars/centos-7.yml index c57ab58f7..18e99ac54 100644 --- a/vars/centos-7.yml +++ b/vars/centos-7.yml @@ -25,6 +25,3 @@ sshd_service: sshd php_version: 7.0 postgresql_version: 9.5 systemd_location: /usr/lib/systemd/system -# Upgrade OS's own Calibre to very latest: -calibre_via_debs: False -calibre_via_python: True From 2899a73bbcb4eb7356a94ac03ff391c4843d5233 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 Apr 2020 23:52:22 +0000 Subject: [PATCH 19/24] Update calibre/tasks/install.yml --- roles/calibre/tasks/install.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/roles/calibre/tasks/install.yml b/roles/calibre/tasks/install.yml index 2a48c1127..2982fe60e 100644 --- a/roles/calibre/tasks/install.yml +++ b/roles/calibre/tasks/install.yml @@ -1,22 +1,23 @@ # 1. INSTALL CALIBRE 4.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S -#- name: "Install OS's latest packages: calibre, calibre-bin" -# package: -# name: -# - calibre -# - calibre-bin -# state: latest +- name: "Install OS's latest packages: calibre, calibre-bin" + package: + name: + - calibre + - calibre-bin + state: latest -# May require above 2 pkgs first? -- name: Install Calibre via .debs (raspbian) +- name: Install Calibre via .debs (if Raspbian) command: scripts/calibre-install-latest-rpi.sh # WORKED for Calibre 3.33.1 on 2018-10-23. And Calibre 3.28 on 2018-07-26 (PR #971). Likewise for Calibre 3.26.x. FAILED with Calibre 3.24+ ("calibre : Depends: python-pyqt5 (>= 5.10.1+dfsg-2) but 5.10.1+dfsg-1+rpi1 is to be installed") since June 2018. - #include_tasks: debs.yml when: is_raspbian | bool -# May require above 2 pkgs first? -- name: Install Calibre via py-installer.yml -> calibre-installer.py (not raspbian) - include_tasks: py-installer.yml - when: not is_raspbian +# 2020-04-29: Can work *IF* you do 'apt install python2' and change top line +# of /opt/iiab/downloads/calibre-installer.py from '#!/usr/bin/env python2' +# to '#!/usr/bin/python2' +# +#- name: Install Calibre via py-installer.yml -> calibre-installer.py (if not Raspbian) +# include_tasks: py-installer.yml +# when: not is_raspbian # SEE calibre_via_python's value vars/default_vars.yml, vars/ubuntu-18.yml & # vars/raspbian-9.yml: try to AVOID Python installer on Raspbian since its From 483ab973f0458d9fbe13881fc0e023d7add651a7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 20:06:33 -0400 Subject: [PATCH 20/24] Update calibre/tasks/install.yml --- roles/calibre/tasks/install.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/roles/calibre/tasks/install.yml b/roles/calibre/tasks/install.yml index 2982fe60e..ad72beade 100644 --- a/roles/calibre/tasks/install.yml +++ b/roles/calibre/tasks/install.yml @@ -7,9 +7,14 @@ - calibre-bin state: latest -- name: Install Calibre via .debs (if Raspbian) - command: scripts/calibre-install-latest-rpi.sh # WORKED for Calibre 3.33.1 on 2018-10-23. And Calibre 3.28 on 2018-07-26 (PR #971). Likewise for Calibre 3.26.x. FAILED with Calibre 3.24+ ("calibre : Depends: python-pyqt5 (>= 5.10.1+dfsg-2) but 5.10.1+dfsg-1+rpi1 is to be installed") since June 2018. - when: is_raspbian | bool +# 2020-04-29: AT YOUR OWN RISK, this *sometimes* works, e.g. to upgrade from +# Raspbian 10's Calibre 3.39.1 to "4.99.4+dfsg+really4.12.0-1" or higher, from: +# http://raspbian.raspberrypi.org/raspbian/pool/main/c/calibre/ +# http://archive.raspbian.org/raspbian/pool/main/c/calibre/ +# +#- name: Install Calibre via .debs (if Raspbian) +# command: scripts/calibre-install-latest-rpi.sh # WORKED for Calibre 3.33.1 on 2018-10-23. And Calibre 3.28 on 2018-07-26 (PR #971). Likewise for Calibre 3.26.x. FAILED with Calibre 3.24+ ("calibre : Depends: python-pyqt5 (>= 5.10.1+dfsg-2) but 5.10.1+dfsg-1+rpi1 is to be installed") since June 2018. +# when: is_raspbian | bool # 2020-04-29: Can work *IF* you do 'apt install python2' and change top line # of /opt/iiab/downloads/calibre-installer.py from '#!/usr/bin/env python2' @@ -17,7 +22,7 @@ # #- name: Install Calibre via py-installer.yml -> calibre-installer.py (if not Raspbian) # include_tasks: py-installer.yml -# when: not is_raspbian +# when: not is_raspbian # True Debian or any Ubuntu? # SEE calibre_via_python's value vars/default_vars.yml, vars/ubuntu-18.yml & # vars/raspbian-9.yml: try to AVOID Python installer on Raspbian since its From 02ac99e03fadb0d893d22fc827a1a7f4278c0258 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 20:10:52 -0400 Subject: [PATCH 21/24] Update calibre/tasks/install.yml --- roles/calibre/tasks/install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/calibre/tasks/install.yml b/roles/calibre/tasks/install.yml index ad72beade..ca2eddf39 100644 --- a/roles/calibre/tasks/install.yml +++ b/roles/calibre/tasks/install.yml @@ -1,4 +1,4 @@ -# 1. INSTALL CALIBRE 4.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S +# 1. INSTALL CALIBRE 3.39.1+ or 4.12+ (calibre, calibredb, calibre-server etc) ON ALL OS'S - name: "Install OS's latest packages: calibre, calibre-bin" package: @@ -18,7 +18,7 @@ # 2020-04-29: Can work *IF* you do 'apt install python2' and change top line # of /opt/iiab/downloads/calibre-installer.py from '#!/usr/bin/env python2' -# to '#!/usr/bin/python2' +# to '#!/usr/bin/python2' e.g. to upgrade Calibre 4.12 on Ubuntu 20.04 LTS. # #- name: Install Calibre via py-installer.yml -> calibre-installer.py (if not Raspbian) # include_tasks: py-installer.yml From 9272926630acd00c0211eea60e8c392a9585a48e Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 29 Apr 2020 20:15:50 -0400 Subject: [PATCH 22/24] Update roles/nginx/README.md --- roles/nginx/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/nginx/README.md b/roles/nginx/README.md index 261d0ac74..6b8edd323 100644 --- a/roles/nginx/README.md +++ b/roles/nginx/README.md @@ -10,7 +10,7 @@ 2. Without PHP available via FastCGI, any function at all for PHP-based applications validates NGINX. -3. Current state of IIAB App/Service migrations as of 2020-04-24: +3. Current state of IIAB App/Service migrations as of 2020-04-29: 1. These support "Native" NGINX but ***NOT*** Apache * Admin Console @@ -39,7 +39,7 @@ * nodered 4. These each run their own web server or non-web / backend services, e.g. off of their own [unique port(s)](https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services) (IIAB home pages link directly to these destinations). In future we'd like mnemonic URL's for all of these: (e.g. http://box/calibre, http://box/archive, http://box/kalite) - * calibre (menu goes directly to port 8080) [*] + * calibre (menu goes directly to port 8080) * internetarchive (menu goes directly to port 4244, [PR #2120](https://github.com/iiab/iiab/pull/2120)) [*] * kalite (menu goes directly to ports 8006-8008) * minetest [*] @@ -47,4 +47,4 @@ * pbx [*] * transmission [*] -[*] The 5 above starred roles could use improvement, as of 2020-04-24. +[*] The 4 above starred roles could use improvement, as of 2020-04-29. From 50a5cc0d8559043e0dd1821707948313c424aeed Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Apr 2020 01:53:14 +0000 Subject: [PATCH 23/24] Mark 5 of 6 as .unused: scripts/calibre-install-* --- ...test-rpi-plus.sh => calibre-install-latest-rpi-plus.sh.unused} | 0 ...calibre-install-latest.sh => calibre-install-latest.sh.unused} | 0 ...re-install-packages.sh => calibre-install-packages.sh.unusued} | 0 ...install-pinned-rpi.sh => calibre-install-pinned-rpi.sh.unused} | 0 ...bre-install-unstable.sh => calibre-install-unstable.sh.unused} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename scripts/{calibre-install-latest-rpi-plus.sh => calibre-install-latest-rpi-plus.sh.unused} (100%) rename scripts/{calibre-install-latest.sh => calibre-install-latest.sh.unused} (100%) rename scripts/{calibre-install-packages.sh => calibre-install-packages.sh.unusued} (100%) rename scripts/{calibre-install-pinned-rpi.sh => calibre-install-pinned-rpi.sh.unused} (100%) rename scripts/{calibre-install-unstable.sh => calibre-install-unstable.sh.unused} (100%) diff --git a/scripts/calibre-install-latest-rpi-plus.sh b/scripts/calibre-install-latest-rpi-plus.sh.unused similarity index 100% rename from scripts/calibre-install-latest-rpi-plus.sh rename to scripts/calibre-install-latest-rpi-plus.sh.unused diff --git a/scripts/calibre-install-latest.sh b/scripts/calibre-install-latest.sh.unused similarity index 100% rename from scripts/calibre-install-latest.sh rename to scripts/calibre-install-latest.sh.unused diff --git a/scripts/calibre-install-packages.sh b/scripts/calibre-install-packages.sh.unusued similarity index 100% rename from scripts/calibre-install-packages.sh rename to scripts/calibre-install-packages.sh.unusued diff --git a/scripts/calibre-install-pinned-rpi.sh b/scripts/calibre-install-pinned-rpi.sh.unused similarity index 100% rename from scripts/calibre-install-pinned-rpi.sh rename to scripts/calibre-install-pinned-rpi.sh.unused diff --git a/scripts/calibre-install-unstable.sh b/scripts/calibre-install-unstable.sh.unused similarity index 100% rename from scripts/calibre-install-unstable.sh rename to scripts/calibre-install-unstable.sh.unused From 85854a2d976476308c02d6ff52389798815ee845 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Apr 2020 01:55:36 +0000 Subject: [PATCH 24/24] rm roles/kalite/tasks/*.unused --- roles/kalite/tasks/enable.yml.unused | 59 -------------- roles/kalite/tasks/install-f18.yml.unused | 76 ------------------ roles/kalite/tasks/install-old.yml.unused | 95 ----------------------- roles/kalite/tasks/setup-f18.yml.unused | 14 ---- roles/kalite/tasks/setup.yml.unused | 32 -------- 5 files changed, 276 deletions(-) delete mode 100644 roles/kalite/tasks/enable.yml.unused delete mode 100644 roles/kalite/tasks/install-f18.yml.unused delete mode 100644 roles/kalite/tasks/install-old.yml.unused delete mode 100644 roles/kalite/tasks/setup-f18.yml.unused delete mode 100644 roles/kalite/tasks/setup.yml.unused diff --git a/roles/kalite/tasks/enable.yml.unused b/roles/kalite/tasks/enable.yml.unused deleted file mode 100644 index 529cf86e8..000000000 --- a/roles/kalite/tasks/enable.yml.unused +++ /dev/null @@ -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 }}" diff --git a/roles/kalite/tasks/install-f18.yml.unused b/roles/kalite/tasks/install-f18.yml.unused deleted file mode 100644 index 28cd4cb1c..000000000 --- a/roles/kalite/tasks/install-f18.yml.unused +++ /dev/null @@ -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'} diff --git a/roles/kalite/tasks/install-old.yml.unused b/roles/kalite/tasks/install-old.yml.unused deleted file mode 100644 index 1e0879c58..000000000 --- a/roles/kalite/tasks/install-old.yml.unused +++ /dev/null @@ -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!) diff --git a/roles/kalite/tasks/setup-f18.yml.unused b/roles/kalite/tasks/setup-f18.yml.unused deleted file mode 100644 index 23037d260..000000000 --- a/roles/kalite/tasks/setup-f18.yml.unused +++ /dev/null @@ -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'" diff --git a/roles/kalite/tasks/setup.yml.unused b/roles/kalite/tasks/setup.yml.unused deleted file mode 100644 index 7884e6be2..000000000 --- a/roles/kalite/tasks/setup.yml.unused +++ /dev/null @@ -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'