mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Reduce Apache dependency in usb_lib & nginx roles
This commit is contained in:
parent
333feadba0
commit
b1fcec30fe
6 changed files with 39 additions and 23 deletions
12
roles/usb_lib/tasks/apache.yml
Normal file
12
roles/usb_lib/tasks/apache.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
- name: Enable http://box/usb via Apache
|
||||
command: a2ensite content_dir.conf
|
||||
when: usb_lib_enabled | bool
|
||||
|
||||
- name: Disable http://box/usb via Apache
|
||||
command: a2dissite content_dir.conf
|
||||
when: not usb_lib_enabled
|
||||
|
||||
- name: (Re)Start '{{ apache_service }}' systemd service
|
||||
systemd:
|
||||
name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
|
||||
state: restarted
|
|
@ -30,7 +30,13 @@
|
|||
when: usb_lib_installed is undefined
|
||||
|
||||
|
||||
- include_tasks: enable-or-disable.yml
|
||||
- name: Enable/Disable/Restart Apache if primary
|
||||
include_tasks: apache.yml
|
||||
when: not nginx_enabled
|
||||
|
||||
- name: Enable/Disable/Restart NGINX if primary
|
||||
include_tasks: nginx.yml
|
||||
when: nginx_enabled | bool
|
||||
|
||||
|
||||
- name: Put variable in iiab.env that enables display of content at root of USB
|
||||
|
|
|
@ -28,10 +28,7 @@
|
|||
state: absent
|
||||
when: not usb_lib_enabled
|
||||
|
||||
- name: Enable http://box/usb via Apache, if usb_lib_enabled
|
||||
command: a2ensite content_dir.conf
|
||||
when: apache_install and usb_lib_enabled
|
||||
|
||||
- name: Disable http://box/usb via Apache, if not usb_lib_enabled
|
||||
command: a2dissite content_dir.conf
|
||||
when: apache_install and not usb_lib_enabled
|
||||
- name: Restart 'nginx' systemd service
|
||||
systemd:
|
||||
name: nginx
|
||||
state: restarted
|
Loading…
Add table
Add a link
Reference in a new issue