From b4a086413c246877deadc60b99dda3f0a7e07fef Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 2 Mar 2020 18:12:13 +0000 Subject: [PATCH 01/10] enable aarch64 in kiwix, disable stem.php --- roles/kiwix/tasks/install.yml | 2 +- roles/nginx/tasks/install.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kiwix/tasks/install.yml b/roles/kiwix/tasks/install.yml index c2fb6fa6c..d8b5c59c8 100644 --- a/roles/kiwix/tasks/install.yml +++ b/roles/kiwix/tasks/install.yml @@ -7,7 +7,7 @@ - name: "Set fact 'kiwix_src_dir: {{ kiwix_version_armhf }}' (armv6l or armv71)" set_fact: kiwix_src_dir: "{{ kiwix_version_armhf }}" - when: ansible_machine == "armv7l" or ansible_machine == "armv6l" + when: ansible_machine == "armv7l" or ansible_machine == "armv6l" or ansible_machine == "aarch64" - name: "Set fact 'kiwix_src_dir: {{ kiwix_version_linux64 }}' (x86_64)" set_fact: diff --git a/roles/nginx/tasks/install.yml b/roles/nginx/tasks/install.yml index 3d6c23bfb..bdd0333b9 100644 --- a/roles/nginx/tasks/install.yml +++ b/roles/nginx/tasks/install.yml @@ -56,7 +56,7 @@ src: "/etc/php/{{ php_version }}/mods-available/stem.ini" path: "/etc/php/{{ php_version }}/fpm/conf.d/20-stem.ini" state: link - #when: nginx_enabled | bool + when: not is_ubuntu | bool - name: Restart php{{ php_version }}-fpm systemd service systemd: From 852cddf222e2c8656796d57bdd9d86fe6e248f20 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Tue, 3 Mar 2020 08:11:53 -0800 Subject: [PATCH 02/10] add in stem changes from Tim --- roles/www_base/tasks/php-stem.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/roles/www_base/tasks/php-stem.yml b/roles/www_base/tasks/php-stem.yml index bba0059c6..6417a2475 100644 --- a/roles/www_base/tasks/php-stem.yml +++ b/roles/www_base/tasks/php-stem.yml @@ -11,7 +11,17 @@ group: root #mode: ???? remote_src: yes - when: is_raspbian | bool + when: ansible_machine == "armv7l" + +- name: Unarchive http://download.iiab.io/packages/php{{ php_version }}-stem.aarch64.tar to / (rpi) + unarchive: + src: http://download.iiab.io/packages/php{{ php_version }}-stem.aarch64.tar + dest: / + owner: root + group: root + #mode: ???? + remote_src: yes + when: ansible_machine == "aarch64" - name: Unarchive http://download.iiab.io/packages/php{{ php_version }}-stem.x64.tar to / (x64) unarchive: From d17790836611ca840f7b984f2f30671e0cea1c1d Mon Sep 17 00:00:00 2001 From: George Hunt Date: Tue, 3 Mar 2020 08:16:15 -0800 Subject: [PATCH 03/10] enable stem link again --- roles/nginx/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/nginx/tasks/install.yml b/roles/nginx/tasks/install.yml index bdd0333b9..3d6c23bfb 100644 --- a/roles/nginx/tasks/install.yml +++ b/roles/nginx/tasks/install.yml @@ -56,7 +56,7 @@ src: "/etc/php/{{ php_version }}/mods-available/stem.ini" path: "/etc/php/{{ php_version }}/fpm/conf.d/20-stem.ini" state: link - when: not is_ubuntu | bool + #when: nginx_enabled | bool - name: Restart php{{ php_version }}-fpm systemd service systemd: From 04368ffbe9439af1fad27d5b15a26542aa8365dd Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 19 Mar 2020 05:42:00 -0500 Subject: [PATCH 04/10] move Ubermix workaround --- roles/1-prep/tasks/main.yml | 8 ++++++++ roles/kalite/tasks/install.yml | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index 97dd3fa26..4cdefaa66 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -62,6 +62,14 @@ when: grep_ubermix.rc == 0 # 1 if absent in file, 2 if file doesn't exist #when: ro_dir.stat.exists +# 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-*" + when: grep_ubermix.rc == 0 # 1 if absent in file, 2 if file doesn't exist + - name: SSHD include_role: name: sshd diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index 5c2bfa2af..24f5f354b 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -23,13 +23,6 @@ #extra_args="--disable-pip-version-check" when: internet_available | bool -# 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-*" - - name: "Install from template: venv wrapper /usr/bin/kalite, systemd unit file kalite-serve.service, Apache's kalite.conf" template: backup: no From 89c0bc9d8d8469f07d63404d05e27ea53ac4886b Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 19 Mar 2020 05:45:26 -0500 Subject: [PATCH 05/10] install python2 for kalite --- roles/kalite/tasks/install.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index 24f5f354b..e77432620 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -11,6 +11,11 @@ # ignore_errors: yes # when: is_raspbian | bool +- name: Install python2 + package: + name: python2 + state: present + - name: Use pip to install KA Lite static to {{ kalite_venv }} pip: name: ka-lite-static From 57ba7623451282d046786fcfbff1333b5e98fccf Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 19 Mar 2020 05:56:38 -0500 Subject: [PATCH 06/10] nextcloud - use {{ php_version }} --- roles/nextcloud/tasks/install.yml | 56 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/roles/nextcloud/tasks/install.yml b/roles/nextcloud/tasks/install.yml index 69916b0d4..7fa429d56 100644 --- a/roles/nextcloud/tasks/install.yml +++ b/roles/nextcloud/tasks/install.yml @@ -48,44 +48,42 @@ - ffmpeg # Optional (for preview generation) - libxml2 # php-libxml requires libxml2 >= 2.7.0 #- libapache2-mod-php # 2020-02-15: NO LONGER NEEDED? - - php-bz2 # Optional (for extraction of apps) - #- php-cli # NOT REQUESTED by Nextcloud - #- php-common # NOT REQUESTED by Nextcloud - - php-curl - - php-fpm # ALSO INSTALLED IN roles/www_options (Stage 4) for nginx_high_php_limits - - php-gd - - php-gmp # Optional (for SFTP storage) - - php-imagick # Optional (for preview generation) - - php-intl # Optional (increases language translation performance and fixes sorting of non-ASCII characters) - - php-json + - php{{ php_version }}-bz2 # Optional (for extraction of apps) + - php{{ php_version }}-cli + - php{{ php_version }}-curl + - php{{ php_version }}-gd + - php{{ php_version }}-gmp # Optional (for SFTP storage) + - php{{ php_version }}-imagick # Optional (for preview generation) + - php{{ php_version }}-intl # Optional (increases language translation performance and fixes sorting of non-ASCII characters) + - php{{ php_version }}-json #- php-libxml # NOT INSTALLABLE: ENABLED BY DEFAULT (https://www.php.net/manual/en/libxml.installation.php) - - php-mbstring - - php-mysql + - php{{ php_version }}-mbstring + - php{{ php_version }}-mysql #- php-openssl # NOT INSTALLABLE: ENABLED BY DEFAULT? #- php-pdo_mysql # NOT INSTALLABLE: php-mysql handles this on all OS's? #- php-redis # @m-anish future work? #- php-session # NOT INSTALLABLE: ENABLED BY DEFAULT? - - php-smbclient # Optional (SMB/CIFS integration - - php-xml # NOT FORMALLY REQUESTED by Nextcloud (BUT hopefully delivers php-simplexml if not {php-xmlreader, php-xmlwriter} on Raspbian?) - - php-zip +# - php-smbclient # Optional (SMB/CIFS integration + - php{{ php_version }}-xml # NOT FORMALLY REQUESTED by Nextcloud (BUT hopefully delivers php-simplexml if not {php-xmlreader, php-xmlwriter} on Raspbian?) + - php{{ php_version }}-zip #- php-zlib # NOT INSTALLABLE: ENABLED BY DEFAULT? state: present # https://docs.nextcloud.com/server/18/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation -- name: Install 9 additional php packages, if OS is not Raspbian (these are not available on Raspbian on RPi, as of Feb 2020) - package: - name: - - php-ctype - - php-dom - - php-exif # Optional (for image rotation in pictures app) - - php-fileinfo # Optional (enhances file analysis performance) - - php-iconv - - php-posix - - php-simplexml - - php-xmlreader - - php-xmlwriter - state: present - when: not is_raspbian +#- name: Install 9 additional php packages, if OS is not Raspbian (these are not available on Raspbian on RPi, as of Feb 2020) +# package: +# name: +# - php-ctype +# - php-dom +# - php-exif # Optional (for image rotation in pictures app) +# - php-fileinfo # Optional (enhances file analysis performance) +# - php-iconv +# - php-posix +# - php-simplexml +# - php-xmlreader +# - php-xmlwriter +# state: present +# when: not is_raspbian - name: Create dir {{ nextcloud_root_dir }} From 0ca3bac42790de31f3530c2369b83814c9a93388 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 19 Mar 2020 05:57:49 -0500 Subject: [PATCH 07/10] better feedback --- roles/0-init/tasks/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index 6e546a6f8..f768d3b3f 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -69,10 +69,9 @@ # Discover: do we have a gateway? # If Ansible detects gateway, becomes WAN candidate. -- name: "Do we have a gateway? If so set discovered_wan_iface: {{ ansible_default_ipv4.alias }}, iiab_wan_iface: {{ discovered_wan_iface }}" +- name: "Do we have a gateway? If so set discovered_wan_iface: {{ ansible_default_ipv4.alias }}" set_fact: discovered_wan_iface: "{{ ansible_default_ipv4.alias }}" - iiab_wan_iface: "{{ discovered_wan_iface }}" when: ansible_default_ipv4.gateway is defined - name: "Verify gateway active: ping -c4 {{ ansible_default_ipv4.gateway }}" @@ -80,12 +79,13 @@ when: discovered_wan_iface != "none" register: gw_active_test -- name: If so, set gw_active +- name: If so, set gw_active, iiab_wan_iface to {{ discovered_wan_iface }} set_fact: + iiab_wan_iface: "{{ discovered_wan_iface }}" gw_active: True when: discovered_wan_iface != "none" and gw_active_test.stdout == "1" -- name: Test for Internet access ({{ iiab_download_url }}/heart-beat.txt) +- name: Test with {{ iiab_wan_iface }} for Internet access ({{ iiab_download_url }}/heart-beat.txt) get_url: url: "{{ iiab_download_url }}/heart-beat.txt" dest: /tmp/heart-beat.txt From 17c69eca7400ea969e3f44b681d79717e8514c83 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 19 Mar 2020 05:59:21 -0500 Subject: [PATCH 08/10] network exclude ap0 --- roles/network/tasks/computed_network.yml | 18 +++++++++--------- roles/network/tasks/detected_network.yml | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/roles/network/tasks/computed_network.yml b/roles/network/tasks/computed_network.yml index e297986e8..fb27dc7b5 100644 --- a/roles/network/tasks/computed_network.yml +++ b/roles/network/tasks/computed_network.yml @@ -109,13 +109,13 @@ # make it so number 2 vars should use user_wan_iface but we can cover a single # wired if dhcp fails the interface should revert to LAN, static address should # stick around but testing gateway response is not performed. -- name: User wants single wired interface as static or dhcp gateway - set_fact: - user_wan_iface: "{{ discovered_wan_iface }}" # Jan 2018: Holt discovered_lan_iface was UNDEFINED on WiFi-installed - # RPi (when re-running ./iiab-network) so "discovered_wan_iface" is a - # workaround -- please see https://github.com/iiab/iiab/pull/649 - # This workaround can and should evolve as IIAB 6.5 matures! - when: num_lan_interfaces == "1" and user_lan_iface == "auto" and user_wan_iface == "auto" +#- name: User wants single wired interface as static or dhcp gateway +# set_fact: +# user_wan_iface: "{{ discovered_wan_iface }}" # Jan 2018: Holt discovered_lan_iface was UNDEFINED on WiFi-installed +# # RPi (when re-running ./iiab-network) so "discovered_wan_iface" is a +# # workaround -- please see https://github.com/iiab/iiab/pull/649 +# # This workaround can and should evolve as IIAB 6.5 matures! +# when: num_lan_interfaces == "1" and user_lan_iface == "auto" and user_wan_iface == "auto" - name: Use old gateway device info if not detected and using static ip set_fact: @@ -152,14 +152,14 @@ - name: We're hosed no work interfaces set_fact: iiab_network_mode: "No_network_found" - when: adapter_count.stdout|int == "0" + when: adapter_count.stdout|int == 0 # well if there ever was a point to tell the user things are FUBAR this is it. - name: I'm not guessing declare gateway please set_fact: iiab_network_mode: "Undetectable_use_local_vars" iiab_wan_iface: "none" - when: adapter_count.stdout|int >= "5" and device_gw == "none" and gui_wan_iface == "unset" and gui_static_wan is defined + when: adapter_count.stdout|int >= 5 and device_gw == "none" and gui_wan_iface == "unset" and gui_static_wan is defined - name: Record IIAB_WAN_DEVICE to {{ iiab_env_file }} lineinfile: diff --git a/roles/network/tasks/detected_network.yml b/roles/network/tasks/detected_network.yml index 66d4dcbb3..25f71d48d 100644 --- a/roles/network/tasks/detected_network.yml +++ b/roles/network/tasks/detected_network.yml @@ -75,7 +75,7 @@ set_fact: wifi2: "{{ item|trim }}" discovered_wireless_iface: "{{ item|trim }}" - when: wireless_list2.stdout is defined + when: wireless_list2.stdout is defined and not wireless_list2.stdout == "ap0" with_items: - "{{ wireless_list2.stdout_lines }}" #item|trim != discovered_wan_iface @@ -103,7 +103,7 @@ when: reserved_wifi is defined and discovered_wireless_iface != iiab_wan_iface and num_wifi_interfaces >= "2" - name: Count LAN ifaces - shell: ls /sys/class/net | grep -v -e wwlan -e ppp -e lo -e br0 -e tun -e br- -e docker -e bridge0 -e veth -e {{ device_gw }} -e {{ ap_device }} | wc -l + shell: ls /sys/class/net | grep -v -e ap0 -e wwlan -e ppp -e lo -e br0 -e tun -e br- -e docker -e bridge0 -e veth -e {{ device_gw }} -e {{ ap_device }} | wc -l register: num_lan_interfaces_result - name: Calculate number of LAN interfaces including WiFi @@ -112,7 +112,7 @@ # LAN - pick non WAN's - name: Create list of LAN (non WAN) ifaces - shell: ls /sys/class/net | grep -v -e wwlan -e ppp -e lo -e br0 -e tun -e br- -e docker -e bridge0 -e veth -e {{ device_gw }} -e {{ ap_device }} + shell: ls /sys/class/net | grep -v -e ap0 -e wwlan -e ppp -e lo -e br0 -e tun -e br- -e docker -e bridge0 -e veth -e {{ device_gw }} -e {{ ap_device }} when: num_lan_interfaces != "0" register: lan_list_result From c6939a495951f49a0f2c93c26e285a565d41ac23 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 19 Mar 2020 12:01:38 -0400 Subject: [PATCH 09/10] Clarify removal of libgeos-* pkgs for KA Lite on Ubermix --- roles/1-prep/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index 4cdefaa66..d540badca 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -62,6 +62,7 @@ when: grep_ubermix.rc == 0 # 1 if absent in file, 2 if file doesn't exist #when: ro_dir.stat.exists +# 2020-03-19: for KA Lite, but moved from roles/kalite/tasks/install.yml # 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. From ec8cd810f59b642e96b7b65bd1ed78f2856a0fd9 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 19 Mar 2020 12:12:17 -0400 Subject: [PATCH 10/10] Clarify PHP deps & options in nextcloud/tasks/install.yml --- roles/nextcloud/tasks/install.yml | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/roles/nextcloud/tasks/install.yml b/roles/nextcloud/tasks/install.yml index 7fa429d56..9f6fb0dd6 100644 --- a/roles/nextcloud/tasks/install.yml +++ b/roles/nextcloud/tasks/install.yml @@ -44,44 +44,44 @@ - name: Install ffmpeg + libxml2 + 13 php packages package: name: - #- dnsutils # NOT REQUESTED by Nextcloud - - ffmpeg # Optional (for preview generation) - - libxml2 # php-libxml requires libxml2 >= 2.7.0 + #- dnsutils # NOT REQUESTED by Nextcloud + - ffmpeg # Optional (for preview generation) + - libxml2 # php-libxml requires libxml2 >= 2.7.0 #- libapache2-mod-php # 2020-02-15: NO LONGER NEEDED? - - php{{ php_version }}-bz2 # Optional (for extraction of apps) - - php{{ php_version }}-cli + - php{{ php_version }}-bz2 # Optional (for extraction of apps) + - php{{ php_version }}-cli # Like optional? @jvonau says this drags in php{{ php_version }}-common as @m-anish wanted in PR #2119 / #2258 - php{{ php_version }}-curl - php{{ php_version }}-gd - - php{{ php_version }}-gmp # Optional (for SFTP storage) - - php{{ php_version }}-imagick # Optional (for preview generation) - - php{{ php_version }}-intl # Optional (increases language translation performance and fixes sorting of non-ASCII characters) + - php{{ php_version }}-gmp # Optional (for SFTP storage) + - php{{ php_version }}-imagick # Optional (for preview generation) + - php{{ php_version }}-intl # Optional (increases language translation performance and fixes sorting of non-ASCII characters) - php{{ php_version }}-json - #- php-libxml # NOT INSTALLABLE: ENABLED BY DEFAULT (https://www.php.net/manual/en/libxml.installation.php) + #- php{{ php_version }}-libxml # NOT INSTALLABLE: ENABLED BY DEFAULT (https://www.php.net/manual/en/libxml.installation.php) - php{{ php_version }}-mbstring - php{{ php_version }}-mysql - #- php-openssl # NOT INSTALLABLE: ENABLED BY DEFAULT? - #- php-pdo_mysql # NOT INSTALLABLE: php-mysql handles this on all OS's? - #- php-redis # @m-anish future work? - #- php-session # NOT INSTALLABLE: ENABLED BY DEFAULT? -# - php-smbclient # Optional (SMB/CIFS integration - - php{{ php_version }}-xml # NOT FORMALLY REQUESTED by Nextcloud (BUT hopefully delivers php-simplexml if not {php-xmlreader, php-xmlwriter} on Raspbian?) + #- php{{ php_version }}-openssl # NOT INSTALLABLE: ENABLED BY DEFAULT? + #- php{{ php_version }}-pdo_mysql # NOT INSTALLABLE: php-mysql handles this on all OS's? + #- php{{ php_version }}-redis # @m-anish future work? + #- php{{ php_version }}-session # NOT INSTALLABLE: ENABLED BY DEFAULT? + #- php{{ php_version }}-smbclient # Optional (SMB/CIFS integration) + - php{{ php_version }}-xml # NOT FORMALLY REQUESTED by Nextcloud (BUT hopefully delivers php-simplexml if not {php-xmlreader, php-xmlwriter} on Raspbian?) - php{{ php_version }}-zip - #- php-zlib # NOT INSTALLABLE: ENABLED BY DEFAULT? + #- php{{ php_version }}-zlib # NOT INSTALLABLE: ENABLED BY DEFAULT? state: present # https://docs.nextcloud.com/server/18/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation #- name: Install 9 additional php packages, if OS is not Raspbian (these are not available on Raspbian on RPi, as of Feb 2020) # package: # name: -# - php-ctype -# - php-dom -# - php-exif # Optional (for image rotation in pictures app) -# - php-fileinfo # Optional (enhances file analysis performance) -# - php-iconv -# - php-posix -# - php-simplexml -# - php-xmlreader -# - php-xmlwriter +# - php{{ php_version }}-ctype +# - php{{ php_version }}-dom +# - php{{ php_version }}-exif # Optional (for image rotation in pictures app) +# - php{{ php_version }}-fileinfo # Optional (enhances file analysis performance) +# - php{{ php_version }}-iconv +# - php{{ php_version }}-posix +# - php{{ php_version }}-simplexml +# - php{{ php_version }}-xmlreader +# - php{{ php_version }}-xmlwriter # state: present # when: not is_raspbian