mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 19:22:24 +00:00
Comments/0-init/NGINX/Apache cleanup
This commit is contained in:
parent
6188f30c0a
commit
8efc06a273
4 changed files with 11 additions and 51 deletions
|
@ -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.
|
||||
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?
|
||||
# If Ansible detects gateway, becomes WAN candidate.
|
||||
- name: "Do we have a gateway? If so set discovered_wan_iface: {{ ansible_default_ipv4.alias }}"
|
||||
|
|
|
@ -69,28 +69,6 @@
|
|||
- mpm_prefork.load
|
||||
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)'
|
||||
apache2_module:
|
||||
name: "{{ item }}"
|
||||
|
@ -115,9 +93,9 @@
|
|||
file:
|
||||
state: directory
|
||||
path: "/var/run/{{ apache_user }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
#owner: root
|
||||
#group: root
|
||||
#mode: '0755'
|
||||
|
||||
- name: 'Create group: admin'
|
||||
group:
|
||||
|
@ -131,13 +109,13 @@
|
|||
state: present
|
||||
createhome: no
|
||||
|
||||
- name: Create Apache dir /var/log/{{ apache_service }}
|
||||
- name: Create Apache dir /var/log/{{ apache_service }} ({{ apache_user }}:{{ apache_user }})
|
||||
file:
|
||||
state: directory
|
||||
path: "/var/log/{{ apache_service }}"
|
||||
owner: "{{ 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
|
||||
|
@ -156,15 +134,14 @@
|
|||
# command: a2dissite 010-iiab.conf
|
||||
# when: not apache_enabled
|
||||
|
||||
|
||||
- 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)
|
||||
# - include_tasks: roles/httpd/tasks/homepage.yml
|
||||
|
||||
# - name: Enable & Stop '{{ apache_service }}' systemd service
|
||||
# systemd:
|
||||
# name: "{{ apache_service }}"
|
||||
# enabled: yes
|
||||
# state: stopped
|
||||
- name: Run 'systemctl daemon-reload'
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
|
||||
|
||||
# RECORD Apache AS INSTALLED
|
||||
|
|
|
@ -31,12 +31,11 @@
|
|||
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:
|
||||
name: "{{ apache_service }}"
|
||||
daemon_reload: yes
|
||||
enabled: yes
|
||||
state: restarted
|
||||
state: started # No need to restart, as many IIAB apps do that later
|
||||
when: apache_enabled | bool
|
||||
|
||||
- name: Disable & Stop {{ apache_service }} systemd service, if not apache_enabled
|
||||
|
|
|
@ -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
|
||||
systemd:
|
||||
name: "{{ apache_service }}" # apache2 or httpd, per /opt/iiab/iiab/vars/<OS>.yml
|
||||
|
|
Loading…
Reference in a new issue