1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-14 20:22:08 +00:00

Further reduce dependency on Apache

This commit is contained in:
root 2020-05-20 19:38:09 -04:00
parent 8efc06a273
commit 5c904b30ea
7 changed files with 42 additions and 29 deletions

View file

@ -8,16 +8,14 @@
name: mysql
when: mysql_install | bool
# 2020-05-17: Invoked as nec by 5 roles {cups, elgg, lokole, moodle, nodered}.
# These 13 roles conditionally touch Apache .conf files etc: awstats,
# calibre-web, gitea, kalite, kiwix, kolibri, mediawiki, munin, nextcloud,
# sugarizer, usb_lib, wordpress, www_options. SEE ALSO: roles/nginx/README.md
# CAUTION: mysql/tasks/install.yml's php install drags in apache2 regardless !
# 2020-05-20: Apache role 'httpd' is installed as nec by any of these 6 roles:
# cups, elgg, lokole, moodle, nodered, phpmyadmin.
#
# - name: HTTPD (Apache)
# include_role:
# name: httpd
# when: apache_install | bool
# These 14 roles conditionally touch Apache .conf files etc: awstats,
# calibre-web, gitea, internetarchive, kalite, kiwix, kolibri, mediawiki,
# munin, nextcloud, sugarizer, usb_lib, wordpress, www_options.
#
# SEE ALSO: roles/nginx/README.md
- name: NGINX
include_role:

View file

@ -3,8 +3,10 @@
# TO DO:
# - validate input vars + prereqs
# - move 7 top stanzas into install.yml
# - move 7 next stanzas into enable-or-disable.yml
# - move ~7 top stanzas into install.yml
# - move ~7 next stanzas into enable-or-disable.yml
# - create /etc/nginx/conf.d/cups-nginx.conf as SHIM to Apache on port 8090 ?
# - deprecate ~2 F18 stanzas?
- name: "Set 'apache_install: True' and 'apache_enabled: True'"

View file

@ -56,13 +56,16 @@
# 3. CONFIG FILES
- name: "Install from templates: /etc/systemd/system/internetarchive.service, /etc/{{ apache_conf_dir }}/internetarchive.conf"
- name: "Install from template: /etc/systemd/system/internetarchive.service"
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: 'internetarchive.service.j2', dest: '/etc/systemd/system/internetarchive.service' }
- { src: 'internetarchive.conf', dest: '/etc/{{ apache_conf_dir }}/internetarchive.conf' } # apache2/sites-available
src: internetarchive.service.j2
dest: /etc/systemd/system/internetarchive.service
- name: "Install from template: /etc/{{ apache_conf_dir }}/internetarchive.conf"
template:
src: internetarchive.conf
dest: "{{ /etc/{{ apache_conf_dir }}/internetarchive.conf }}" # apache2/sites-available
when: apache_installed is defined
# 4. RECORD Internet Archive AS INSTALLED

View file

@ -51,7 +51,6 @@
when: internetarchive_installed is undefined and internet_available
# ENABLE/DISABLE/RESTART SYSTEMD SERVICE & WEB SERVERS AS NEC ?
- name: Enable & Restart 'internetarchive' systemd service, if internetarchive_enabled
@ -69,10 +68,9 @@
state: stopped
when: not internetarchive_enabled
#- name: Enable/Disable/Restart Apache if primary
- name: SHIM FOR NOW SO ALWAYS DO THE...Enable/Disable/Restart Apache
- name: Enable/Disable/Restart Apache if primary
include_tasks: apache.yml
#when: not nginx_enabled
when: apache_installed is defined and not nginx_enabled
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml

View file

@ -10,7 +10,8 @@
name:
- mariadb-server
- mariadb-client
- php{{ php_version }} # On Ubuntu 20.04 (and prob other OS's) this forces the install of: apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php{{ php_version }} ETC
# - php{{ php_version }} # On Ubuntu 20.04 (and prob other OS's) this forces the install of: apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php{{ php_version }} ETC
- php{{ php_version }}-common # 2020-05-19: @jvonau suggests this to avoid Apache above. Or its superset php{{ php_version }}-cli if absolutely nec?
- php{{ php_version }}-mysql
- php-pear
- php{{ php_version }}-gd

View file

@ -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-05-17:
3. Current state of IIAB App/Service migrations as of 2020-05-20:
1. These support "Native" NGINX but ***NOT*** Apache
* Admin Console
@ -32,8 +32,8 @@
* sugarizer
* wordpress
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/3-base-server/tasks/main.yml#L11](../3-base-server/tasks/main.yml#L11) for a list of these IIAB Apps/Services, that auto-enable Apache.
* cups ?
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/3-base-server/tasks/main.yml#L11](../3-base-server/tasks/main.yml#L11) for a list of IIAB Apps/Services that auto-enable Apache.
* cups [*, shim not yet in place.]
* elgg
* lokole
* moodle
@ -46,6 +46,7 @@
* minetest [*]
* openvpn
* pbx [*]
* phpmyadmin [*, requires Apache for now, as in Section 3.]
* transmission [*]
[*] The 4 above starred roles could use improvement, as of 2020-05-17.
[*] The 6 above starred roles could use improvement, as of 2020-05-20.

View file

@ -1,3 +1,13 @@
- name: "Set 'apache_install: True' and 'apache_enabled: True'"
set_fact:
apache_install: True
apache_enabled: True
- name: APACHE - run 'httpd' role
include_role:
name: httpd
- name: Download {{ iiab_download_url }}/{{ phpmyadmin_name_zip }} to {{ downloads_dir }}
get_url:
url: "{{ iiab_download_url }}/{{ phpmyadmin_name_zip }}"
@ -49,7 +59,7 @@
template:
src: phpmyadmin.j2
dest: "/etc/{{ apache_conf_dir }}/phpmyadmin.conf"
when: apache_install | bool
when: apache_installed is defined
# RECORD phpMyAdmin AS INSTALLED
@ -67,11 +77,11 @@
- name: Enable phpMyAdmin via Apache, if phpmyadmin_enabled
command: a2ensite phpmyadmin.conf
when: apache_install and phpmyadmin_enabled
when: apache_installed is defined and phpmyadmin_enabled
- name: Disable phpMyAdmin via Apache, if not phpmyadmin_enabled
command: a2dissite phpmyadmin.conf
when: apache_install and not phpmyadmin_enabled
when: apache_installed is defined and not phpmyadmin_enabled
- name: Add 'phpmyadmin' variable values to {{ iiab_ini_file }}