1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

use apps-enabled in place of service file

This commit is contained in:
Jerry Vonau 2020-01-18 22:59:55 -06:00
parent eec9500192
commit 9c19f9112f

View file

@ -41,11 +41,11 @@
- mac.template - mac.template
#- roles/captiveportal/files/mac.template #- roles/captiveportal/files/mac.template
- name: Install uWSGI config file /opt/iiab/captiveportal/captiveportal.ini from template #- name: Install /etc/systemd/system/uwsgi-captiveportal.service from template
template: # template:
src: captiveportal.ini.j2 # src: uwsgi-captiveportal.service
#src: roles/captiveportal/templates/captiveportal.ini.j2 # #src: roles/captiveportal/templates/uwsgi-captiveportal.service
dest: /opt/iiab/captiveportal/captiveportal.ini # dest: /etc/systemd/system/
- name: "Add 'captiveportal_installed: True' to {{ iiab_state_file }}" - name: "Add 'captiveportal_installed: True' to {{ iiab_state_file }}"
lineinfile: lineinfile:
@ -55,25 +55,33 @@
# TO DO: move most/all 7-10 stanzas below into enable-or-disable.yml # TO DO: move most/all 7-10 stanzas below into enable-or-disable.yml
- name: Install /etc/systemd/system/uwsgi-captiveportal.service from template #- name: Restart & Enable 'uwsgi-captiveportal' systemd service (uWSGI server) that responds to browsers trying to detect a Captive Portal
template: # systemd:
src: uwsgi-captiveportal.service # name: uwsgi-captiveportal
#src: roles/captiveportal/templates/uwsgi-captiveportal.service # daemon_reload: yes
dest: /etc/systemd/system/ # state: restarted
# enabled: True
# when: captiveportal_enabled | bool
- name: Restart & Enable 'uwsgi-captiveportal' systemd service (uWSGI server) that responds to browsers trying to detect a Captive Portal #- name: Stop & Disable 'uwsgi-captiveportal' systemd service (uWSGI server) if Captive Portal has been disabled
systemd: # systemd:
name: uwsgi-captiveportal # name: uwsgi-captiveportal
daemon_reload: yes # state: stopped
state: restarted # enabled: False
enabled: True # when: not captiveportal_enabled
- name: Install uWSGI config file /etc/uwsgi/apps-enabled/captiveportal.ini from template
template:
src: captiveportal.ini.j2
#src: roles/captiveportal/templates/captiveportal.ini.j2
dest: /etc/uwsgi/apps-enabled/captiveportal.ini
when: captiveportal_enabled | bool when: captiveportal_enabled | bool
- name: Stop & Disable 'uwsgi-captiveportal' systemd service (uWSGI server) if Captive Portal has been disabled - name: Delete uWSGI config file /etc/uwsgi/apps-enabled/captiveportal.ini when disabled
systemd: file:
name: uwsgi-captiveportal #src: /etc/nginx/sites-available/capture.conf
state: stopped path: /etc/uwsgi/apps-enabled/captiveportal.ini
enabled: False state: absent
when: not captiveportal_enabled when: not captiveportal_enabled
- name: Run iiab-divert-to-nginx to generate diversion lists for NGINX - name: Run iiab-divert-to-nginx to generate diversion lists for NGINX
@ -104,11 +112,11 @@
state: absent state: absent
when: not captiveportal_enabled when: not captiveportal_enabled
#- name: Restart dnsmasq - name: Restart uwsgi
# systemd: systemd:
# name: dnsmasq name: uwsgi
# state: restarted state: restarted
# when: dnsmasq_enabled | bool daemon_reload: yes
# ABOVE DOES NOT WORK ON UBUNTU 16.04 -- what follows is a crude hack (seems to work!) # ABOVE DOES NOT WORK ON UBUNTU 16.04 -- what follows is a crude hack (seems to work!)