diff --git a/roles/3-base-server/tasks/main.yml b/roles/3-base-server/tasks/main.yml index cbbcd3451..d81eb560d 100644 --- a/roles/3-base-server/tasks/main.yml +++ b/roles/3-base-server/tasks/main.yml @@ -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: diff --git a/roles/cups/tasks/main.yml b/roles/cups/tasks/main.yml index a8e488573..3a4beda15 100644 --- a/roles/cups/tasks/main.yml +++ b/roles/cups/tasks/main.yml @@ -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'" diff --git a/roles/internetarchive/tasks/install.yml b/roles/internetarchive/tasks/install.yml index 41896e647..44ebcdc29 100644 --- a/roles/internetarchive/tasks/install.yml +++ b/roles/internetarchive/tasks/install.yml @@ -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 diff --git a/roles/internetarchive/tasks/main.yml b/roles/internetarchive/tasks/main.yml index 3b908a143..06988fc2a 100644 --- a/roles/internetarchive/tasks/main.yml +++ b/roles/internetarchive/tasks/main.yml @@ -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 diff --git a/roles/mysql/tasks/install.yml b/roles/mysql/tasks/install.yml index 49634a5f0..6b5875a51 100644 --- a/roles/mysql/tasks/install.yml +++ b/roles/mysql/tasks/install.yml @@ -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 diff --git a/roles/nginx/README.md b/roles/nginx/README.md index 4128e6ae9..b2c35f702 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-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. diff --git a/roles/phpmyadmin/tasks/main.yml b/roles/phpmyadmin/tasks/main.yml index bfc8587d7..e5911c92c 100644 --- a/roles/phpmyadmin/tasks/main.yml +++ b/roles/phpmyadmin/tasks/main.yml @@ -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 }}