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

Comments/0-init/NGINX/Apache cleanup

This commit is contained in:
root 2020-05-18 17:33:30 -04:00
parent 6188f30c0a
commit 8efc06a273
4 changed files with 11 additions and 51 deletions

View file

@ -43,11 +43,6 @@
- name: Pre-check that IIAB's "XYZ_install" + "XYZ_enabled" vars (1) are defined, (2) are boolean-not-string variables, and (3) contain plausible values. Also checks that "XYZ_install" is True when "XYZ_installed" is defined. - name: Pre-check that IIAB's "XYZ_install" + "XYZ_enabled" vars (1) are defined, (2) are boolean-not-string variables, and (3) contain plausible values. Also checks that "XYZ_install" is True when "XYZ_installed" is defined.
include_tasks: validate_vars.yml include_tasks: validate_vars.yml
#- name: Set exFAT_enabled if xo_model != "none"
# set_fact:
# exFAT_enabled: True
# when: xo_model != "none"
# Discover: do we have a gateway? # Discover: do we have a gateway?
# If Ansible detects gateway, becomes WAN candidate. # If Ansible detects gateway, becomes WAN candidate.
- name: "Do we have a gateway? If so set discovered_wan_iface: {{ ansible_default_ipv4.alias }}" - name: "Do we have a gateway? If so set discovered_wan_iface: {{ ansible_default_ipv4.alias }}"

View file

@ -69,28 +69,6 @@
- mpm_prefork.load - mpm_prefork.load
when: is_debuntu | bool when: is_debuntu | bool
# - name: Remove mpm_event.conf & mpm_event.load symlinks, using a2dissite
# command: "a2dissite {{ item }}"
# with_items:
# - mpm_event.conf
# - mpm_event.load
# ignore_errors: yes
#
# - name: Symlink mpm_prefork.conf & mpm_prefork.load, using a2ensite
# command: "a2ensite {{ item }}"
# with_items:
# - mpm_prefork.conf
# - mpm_prefork.load
#- name: 'Turn on mod_proxy using a2enmod with: proxy, proxy_html, headers, rewrite (debuntu)'
# command: a2enmod {{ item }}
# with_items:
# - proxy
# - proxy_html
# - headers
# - rewrite
# when: is_debuntu | bool
- name: 'Enable 5 Apache modules, as with "a2enmod" command: headers, proxy, proxy_html, proxy_http, rewrite (for http://box/kiwix, http://box/kolibri, http://box/nodered, etc--if debuntu)' - name: 'Enable 5 Apache modules, as with "a2enmod" command: headers, proxy, proxy_html, proxy_http, rewrite (for http://box/kiwix, http://box/kolibri, http://box/nodered, etc--if debuntu)'
apache2_module: apache2_module:
name: "{{ item }}" name: "{{ item }}"
@ -115,9 +93,9 @@
file: file:
state: directory state: directory
path: "/var/run/{{ apache_user }}" path: "/var/run/{{ apache_user }}"
owner: root #owner: root
group: root #group: root
mode: '0755' #mode: '0755'
- name: 'Create group: admin' - name: 'Create group: admin'
group: group:
@ -131,13 +109,13 @@
state: present state: present
createhome: no createhome: no
- name: Create Apache dir /var/log/{{ apache_service }} - name: Create Apache dir /var/log/{{ apache_service }} ({{ apache_user }}:{{ apache_user }})
file: file:
state: directory state: directory
path: "/var/log/{{ apache_service }}" path: "/var/log/{{ apache_service }}"
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
group: "{{ apache_user }}" group: "{{ apache_user }}"
mode: '0755' #mode: '0755'
- name: Install Apache's 010-iiab.conf & proxy_ajp.conf into /etc/apache2/sites-available, from templates - name: Install Apache's 010-iiab.conf & proxy_ajp.conf into /etc/apache2/sites-available, from templates
@ -156,15 +134,14 @@
# command: a2dissite 010-iiab.conf # command: a2dissite 010-iiab.conf
# when: not apache_enabled # when: not apache_enabled
- debug: - debug:
msg: roles/httpd/tasks/homepage.yml will run LATER (invoked by roles/www_options/tasks/main.yml) SO THAT APACHE CAN REDIRECT http://box TO http://box{{ iiab_home_url }} (based on var iiab_home_url) msg: roles/httpd/tasks/homepage.yml will run LATER (invoked by roles/www_options/tasks/main.yml) SO THAT APACHE CAN REDIRECT http://box TO http://box{{ iiab_home_url }} (based on var iiab_home_url)
# - include_tasks: roles/httpd/tasks/homepage.yml # - include_tasks: roles/httpd/tasks/homepage.yml
# - name: Enable & Stop '{{ apache_service }}' systemd service - name: Run 'systemctl daemon-reload'
# systemd: systemd:
# name: "{{ apache_service }}" daemon_reload: yes
# enabled: yes
# state: stopped
# RECORD Apache AS INSTALLED # RECORD Apache AS INSTALLED

View file

@ -31,12 +31,11 @@
when: apache_installed is undefined when: apache_installed is undefined
- name: Enable & (Re)Start {{ apache_service }} systemd service, if apache_enabled - name: Enable & Start-if-nec {{ apache_service }} systemd service, if apache_enabled
systemd: systemd:
name: "{{ apache_service }}" name: "{{ apache_service }}"
daemon_reload: yes
enabled: yes enabled: yes
state: restarted state: started # No need to restart, as many IIAB apps do that later
when: apache_enabled | bool when: apache_enabled | bool
- name: Disable & Stop {{ apache_service }} systemd service, if not apache_enabled - name: Disable & Stop {{ apache_service }} systemd service, if not apache_enabled

View file

@ -1,14 +1,3 @@
# This stanza can likely be removed later in 2020:
#
# - name: 'Remove legacy files if present: /etc/systemd/system/uwsgi.service, {{ nginx_conf_dir }}/usb-lib.conf, {{ nginx_conf_dir }}/modules.conf'
# file:
# path: "{{ item.path }}"
# state: absent
# with_items:
# - { path: "/etc/systemd/system/uwsgi.service" }
# - { path: "{{ nginx_conf_dir }}/usb-lib.conf" }
# - { path: "{{ nginx_conf_dir }}/modules.conf" }
- name: Stop '{{ apache_service }}' systemd service - name: Stop '{{ apache_service }}' systemd service
systemd: systemd:
name: "{{ apache_service }}" # apache2 or httpd, per /opt/iiab/iiab/vars/<OS>.yml name: "{{ apache_service }}" # apache2 or httpd, per /opt/iiab/iiab/vars/<OS>.yml