1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

Merge pull request #359 from iiab/master

sync from iiab:master
This commit is contained in:
A Holt 2020-01-26 23:59:20 -05:00 committed by GitHub
commit 7caa005fb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 76 additions and 24 deletions

View file

@ -11,12 +11,7 @@
- include_tasks: install.yml
- include_tasks: html.yml
# 2018-07-18: Partially fixes search @ http://box/modules/es-wikihow (on RPi
# anyway) https://github.com/iiab/iiab/issues/829 & PR #925
# 2020-01-23: Deprecated as @tim-moody's attempt to revive this for PHP 7.3
# instead of 7.0 failed: https://github.com/iiab/iiab/issues/2123
#- include_tasks: php-stem.yml
- include_tasks: php-stem.yml
- name: Install /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation. (Script can be run manually and/or at the end of Stage 4 = roles/4-server-options/tasks/main.yml)
template:

View file

@ -3,17 +3,9 @@
# June 2018 debugging & compilation thanks to Tim Moody & George Hunt
# Original bug: https://github.com/iiab/iiab/issues/829
#- name: Download php-stem.rpi.tar
# command: cd /; wget http://download.iiab.io/packages/php-stem.rpi.tar
# when: is_rpi | bool
#- name: Download php-stem.x86.tar
# command: cd /; wget http://download.iiab.io/packages/php-stem.x64.tar
# when: not is_rpi
- name: Unarchive http://download.iiab.io/packages/php-stem.rpi.tar to / (rpi)
- name: Unarchive http://download.iiab.io/packages/php{{ php_version }}-stem.rpi.tar to / (rpi)
unarchive:
src: http://download.iiab.io/packages/php-stem.rpi.tar
src: http://download.iiab.io/packages/php{{ php_version }}-stem.rpi.tar
dest: /
owner: root
group: root
@ -21,15 +13,21 @@
remote_src: yes
when: is_rpi | bool
- name: Unarchive http://download.iiab.io/packages/php-stem.x64.tar to / (debian-9 on x86_64 only)
- name: Unarchive http://download.iiab.io/packages/php{{ php_version }}-stem.x64.tar to / (x64)
unarchive:
src: http://download.iiab.io/packages/php-stem.x64.tar
src: http://download.iiab.io/packages/php{{ php_version }}-stem.x64.tar
dest: /
owner: root
group: root
#mode: ????
remote_src: yes
when: is_debian_9 and (ansible_machine == "x86_64")
when: ansible_machine == "x86_64"
# link to php done in nginx when php-fpm is installed
# Not sure what to do for apache, so do nothing for now
# The following are probably no longer true 2020-01-25
# Presumably fails on Debian 8 & 10?
# Fails on Debian i686 as of 2018-08-07: https://github.com/iiab/iiab/issues/983
# Fails on Ubuntu 18.04 as of 2018-07-28: https://github.com/iiab/iiab/issues/829

View file

@ -1,4 +1,18 @@
# mongodb_install: False
# MongoDB (/library/dbdata/mongodb) greatly enhances the Sugarizer experience.
# The roles/mongodb playbook (was?) invoked by roles/sugarizer/meta/main.yml
# 2020-01-23: mongodb_install is completely ignored as MongoDB is installed on
# demand as a dependency -- by Sugarizer -- but for now we set fake value
# 'mongodb_install: True' for 'mongodb_installed is defined' tests e.g. in
# 0-init/tasks/validate_vars.yml
# mongodb_install: True
# FYI 'mongodb_enabled: False' works when Sugarizer is disabled. Required by
# mongodb/tasks/enable.yml to shut down the service and log status, but that is
# misleading as Sugarizer starts mongodb's systemd service on its own, due to
# 'Requires=mongodb.service' within /etc/systemd/system/sugarizer.service
# mongodb_enabled: False
# mongodb_port: 27018

View file

@ -1,14 +1,16 @@
### Transition to NGINX
1. Initial testing strategy is to move NGINX to port 80, and proxy everything to Apache on port 8090 — creating "Shims" for each IIAB App/Service in *Section iii.* below.
1. Initial testing strategy (December 2019 - January 2020) is to move NGINX to [port 80](https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services), and proxy everything to Apache on [port 8090](https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services) — creating "Shims" for each IIAB App/Service in *Section iii.* below.
Until "Native" NGINX is later implemented for that IIAB App/Service — allowing it to move up to *Section ii.* below.
And potentially later moving it up to *Section i.* if its Apache support is dropped!
(Background: IIAB Apps/Services are generally [Ansible roles](https://github.com/iiab/iiab/wiki/IIAB-Contributors-Guide#ansible) that live in [/opt/iiab/iiab/roles](https://github.com/iiab/iiab/tree/master/roles))
2. Without PHP available via FastCGI, any function at all for PHP-based applications validates NGINX.
3. Current state IIAB App/Service migrations as of 2020-01-23...
3. Current state of IIAB App/Service migrations as of 2020-01-24:
1. These support "Native" NGINX but ***NOT*** Apache
* Admin Console
@ -17,7 +19,7 @@
* RACHEL-like modules
* usb-lib
2. These support "Native" NGINX ***AND*** Apache, a.k.a. "dual support" for legacy testing (if suitable "Shims" from *Section iii.* below are preserved!) Both "Native" NGINX and "Shim" proxying from NGINX to Apache port 8090 *cannot be enabled simultaneously* for these IIAB Apps/Service. But if you want to attempt their "Shim" proxying legacy testing mode, [auto-enable Apache](../0-init/tasks/main.yml#L40-L44) by setting `nginx_enabled: False` in [/etc/iiab/local_vars.yml](http://wiki.laptop.org/go/IIAB/FAQ#What_is_local_vars.yml_and_how_do_I_customize_it.3F)
2. These support "Native" NGINX ***AND*** Apache, a.k.a. "dual support" for legacy testing (if suitable "Shims" from *Section iii.* below are preserved!) Both "Native" NGINX and "Shim" proxying from NGINX to Apache port 8090 *cannot be enabled simultaneously* for these IIAB Apps/Service. But if you want to attempt their "Shim" proxying legacy testing mode, change your *primary web server* over to Apache by setting `nginx_enabled: False` in [/etc/iiab/local_vars.yml](http://wiki.laptop.org/go/IIAB/FAQ#What_is_local_vars.yml_and_how_do_I_customize_it.3F) (which will [auto-enable Apache](../0-init/tasks/main.yml#L40-L44) for your testing).
* awstats
* calibre-web
* gitea
@ -28,7 +30,7 @@
* sugarizer
* wordpress
3. These support Apache but ***NOT*** "Native" NGINX. These use a "Shim" to [proxy_pass](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) from NGINX to Apache on port 8090. See [roles/0-init/tasks/main.yml#L40-L44](../0-init/tasks/main.yml#L40-L44) for a list of these IIAB Apps/Services, that auto-enable Apache.
3. These support Apache but ***NOT*** "Native" NGINX. They use a "Shim" to [proxy_pass](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) from NGINX to Apache on port 8090. See [roles/0-init/tasks/main.yml#L40-L44](../0-init/tasks/main.yml#L40-L44) for a list of these IIAB Apps/Services, that auto-enable Apache.
* dokuwiki ([#2056](https://github.com/iiab/iiab/issues/2056))
* elgg
* lokole

View file

@ -28,6 +28,21 @@
- { src: 'roles/nginx/templates/nginx.conf.j2', dest: '/etc/nginx/nginx.conf' }
- { src: 'roles/nginx/templates/ports.conf.j2', dest: '/etc/{{ apache_service }}/ports.conf' }
# php stem extension is installed in role httpd
# here it is linked to php-fpm
- name: Create softlink 20-stem.ini to /etc/php/{{ php_version }}/mods-available/stem.ini
file:
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
- name: Restart php{{ php_version }}-fpm service
service:
name: "php{{ php_version }}-fpm"
state: restarted
when: nginx_enabled
- name: "Add 'nginx_installed: True' to {{ iiab_state_file }}"
lineinfile:
dest: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml

View file

@ -0,0 +1,15 @@
# 2020-01-23: nodejs_install is completely ignored as Node.js is installed on
# demand as a dependency -- by Node-RED, Sugarizer and/or Internet Archive --
# but for now we set fake value 'nodejs_install: True' for
# 'nodejs_installed is defined' tests e.g. in 0-init/tasks/validate_vars.yml
# nodejs_install: True
# nodejs_enabled: False
# Node.js version used by roles/nodejs/tasks/main.yml for 3 roles:
# nodered (Node-RED), pbx (Asterix, FreePBX) & sugarizer (Sugarizer)
# nodejs_version: 12.x # was 8.x until 2019-02-02, was 10.x until 2019-12-21
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!

View file

@ -1 +1,12 @@
# 2020-01-23: postgresql_install is completely ignored as PostgreSQL is
# installed on demand as a dependency -- by Moodle &/or Pathagar as nec --
# but for now we set fake value 'postgresql_install: True' for
# 'postgresql_installed is defined' tests e.g. in 0-init/tasks/validate_vars.yml
# postgresql_install: True
# postgresql_enabled: False
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
postgresql_locale: "en_US.UTF-8"

View file

@ -91,6 +91,7 @@
regexp: '^postgresql_installed'
line: 'postgresql_installed: True'
- name: Enable & Start 'postgresql-iiab' systemd service, if 'postgresql_enabled'
systemd:
name: postgresql-iiab
@ -105,6 +106,7 @@
enabled: no
when: not postgresql_enabled
- name: Add 'postgresql' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"