Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
- name: Download & install python-dateutil, sqlite3
|
|
|
|
package:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- python-dateutil
|
2018-12-12 18:27:44 +00:00
|
|
|
- sqlite3 # @georgejhunt hopes to move this to 2-common (or more likely 3-base-server, alongside MySQL) in October 2018
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
|
2018-12-12 17:34:05 +00:00
|
|
|
- name: Install libapache2-mod-wsgi (debuntu)
|
2018-12-08 23:11:49 +00:00
|
|
|
package:
|
2018-12-12 17:34:05 +00:00
|
|
|
name: libapache2-mod-wsgi
|
2018-12-08 23:11:49 +00:00
|
|
|
state: present
|
2019-05-24 22:33:10 +00:00
|
|
|
when: is_debuntu | bool
|
2018-12-08 23:11:49 +00:00
|
|
|
|
2018-12-12 17:34:05 +00:00
|
|
|
- name: Install mod_wsgi (not debuntu)
|
2018-12-08 23:11:49 +00:00
|
|
|
package:
|
2018-12-12 17:34:05 +00:00
|
|
|
name: mod_wsgi
|
2018-12-08 23:11:49 +00:00
|
|
|
state: present
|
|
|
|
when: not is_debuntu
|
|
|
|
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
- name: Create directory /opt/iiab/captive-portal for scripts & templates
|
|
|
|
file:
|
|
|
|
path: /opt/iiab/captive-portal
|
|
|
|
state: directory
|
2018-12-05 21:03:12 +00:00
|
|
|
owner: "{{ apache_user }}"
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
|
|
|
|
- name: 'Copy scripts: checkurls, capture-wsgi.py'
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: /opt/iiab/captive-portal/
|
|
|
|
mode: "{{ item.mode }}"
|
|
|
|
with_items:
|
|
|
|
- { src: roles/captive-portal/templates/checkurls, mode: '0644' }
|
|
|
|
- { src: roles/captive-portal/templates/capture-wsgi.py, mode: '0755' }
|
|
|
|
|
|
|
|
- name: 'Copy templates: simple.template, mac.template'
|
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: /opt/iiab/captive-portal/
|
|
|
|
with_items:
|
|
|
|
- roles/captive-portal/files/simple.template
|
|
|
|
- roles/captive-portal/files/mac.template
|
|
|
|
|
|
|
|
- name: Copy iiab-catch & iiab-uncatch into /usr/bin/
|
|
|
|
template:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: /usr/bin/
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
with_items:
|
|
|
|
- roles/captive-portal/templates/iiab-catch
|
|
|
|
- roles/captive-portal/templates/iiab-uncatch
|
|
|
|
|
|
|
|
- name: Run iiab-uncatch to generate diversion lists for dnsmasq and apache2
|
|
|
|
shell: /usr/bin/iiab-uncatch
|
|
|
|
|
2018-12-06 02:41:33 +00:00
|
|
|
#- name: Install systemd unit file captive-portal.service from template
|
|
|
|
# template:
|
|
|
|
# src: roles/captive-portal/templates/captive-portal.service.j2
|
|
|
|
# dest: /etc/systemd/system/captive-portal.service
|
|
|
|
# owner: root
|
|
|
|
# group: root
|
|
|
|
# mode: 0644
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
|
|
|
|
- name: Install Apache's captive-portal.conf from template if captive_portal_enabled
|
|
|
|
template:
|
|
|
|
src: roles/captive-portal/templates/001-captive-portal.conf
|
|
|
|
dest: /etc/{{ apache_config_dir }}/001-captive-portal.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2019-05-24 22:33:10 +00:00
|
|
|
when: captive_portal_enabled | bool
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
|
|
|
|
- name: Enable Apache's captive-portal.conf if captive_portal_enabled (debuntu)
|
|
|
|
file:
|
|
|
|
src: /etc/apache2/sites-available/001-captive-portal.conf
|
|
|
|
path: /etc/apache2/sites-enabled/001-captive-portal.conf
|
|
|
|
state: link
|
|
|
|
when: captive_portal_enabled and is_debuntu
|
|
|
|
|
|
|
|
- name: Enable Apache's default-ssl.conf if captive_portal_enabled (debuntu)
|
|
|
|
file:
|
|
|
|
src: /etc/apache2/sites-available/default-ssl.conf
|
|
|
|
path: /etc/apache2/sites-enabled/default-ssl.conf
|
|
|
|
state: link
|
|
|
|
when: captive_portal_enabled and is_debuntu
|
|
|
|
|
2018-12-06 02:41:33 +00:00
|
|
|
#- name: Enable & Start systemd service captive-portal.service if captive_portal_enabled
|
|
|
|
# systemd:
|
|
|
|
# name: captive-portal.service
|
|
|
|
# daemon-reload: yes
|
|
|
|
# enabled: yes
|
|
|
|
# state: started
|
2019-05-24 22:33:10 +00:00
|
|
|
# when: captive_portal_enabled | bool
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
|
2018-12-06 02:41:33 +00:00
|
|
|
#- name: Disable & Stop captive-portal.service if not captive_portal_enabled
|
|
|
|
# systemd:
|
|
|
|
# name: captive-portal.service
|
|
|
|
# enabled: no
|
|
|
|
# state: stopped
|
|
|
|
# when: not captive_portal_enabled
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
|
|
|
|
- name: Disable Apache's captive-portal.conf if not captive_portal_enabled (debuntu)
|
|
|
|
file:
|
|
|
|
path: /etc/apache2/sites-enabled/001-captive-portal.conf
|
|
|
|
state: absent
|
|
|
|
when: not captive_portal_enabled and is_debuntu
|
|
|
|
|
|
|
|
- name: Disable Apache's default-ssl.conf if not captive_portal_enabled (debuntu)
|
|
|
|
file:
|
|
|
|
path: /etc/apache2/sites-enabled/default-ssl.conf
|
|
|
|
state: absent
|
|
|
|
when: not captive_portal_enabled and is_debuntu
|
|
|
|
|
|
|
|
- name: Make sure dnsmasq is not diverting if not captive_portal_enabled
|
|
|
|
file:
|
|
|
|
path: /etc/dnsmasq.d/capture
|
|
|
|
state: absent
|
|
|
|
when: not captive_portal_enabled
|
|
|
|
|
2019-02-03 03:41:43 +00:00
|
|
|
- name: Restart Apache service ({{ apache_service }}) # i.e. apache2 on most distros
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
systemd:
|
2019-02-03 03:41:43 +00:00
|
|
|
name: "{{ apache_service }}"
|
2018-12-12 17:34:05 +00:00
|
|
|
state: restarted
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
|
2019-01-09 03:55:05 +00:00
|
|
|
#- name: Restart dnsmasq
|
|
|
|
# systemd:
|
|
|
|
# name: dnsmasq
|
|
|
|
# state: restarted
|
2019-05-24 22:33:10 +00:00
|
|
|
# when: dnsmasq_enabled | bool
|
2019-01-09 03:55:05 +00:00
|
|
|
|
|
|
|
# ABOVE DOES NOT WORK ON UBUNTU 16.04 -- what follows is a crude hack (seems to work!)
|
|
|
|
|
|
|
|
- name: Stop dnsmasq
|
|
|
|
systemd:
|
Cap2 (#1300)
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* move captive portal to its own role
* runrole still not working
* make apache name consistent, define py_captive_portal_port
* record android fixes
* some progress -- windows8.1 works but detectportal.firefox active for both mac and windows
* works all platforms
* one captive_portal_install not changed to py_captive...
* port into defaults
* windows 7,8,10,mac,ios,android 5,7
* add # to dnsmasq.d/captive
* guess what android 8 might need
* restart apache2 and dnsmasq in role
* do not hard code apache name
* cut out disfunctional experiments
* variable py_captive_portal_port misspelled
* add wildcard serveralias to box.lan vhost to fix default
* add in STDOUT to log
* remove the py_
* add in msn to urls to capture
* missed a few py_
2018-11-18 04:09:40 +00:00
|
|
|
name: dnsmasq
|
2019-01-09 03:55:05 +00:00
|
|
|
state: stopped
|
2019-05-24 22:33:10 +00:00
|
|
|
when: dnsmasq_enabled | bool
|
2019-01-09 03:55:05 +00:00
|
|
|
|
|
|
|
- name: Start dnsmasq
|
|
|
|
systemd:
|
|
|
|
name: dnsmasq
|
|
|
|
state: started
|
2019-05-24 22:33:10 +00:00
|
|
|
when: dnsmasq_enabled | bool
|
2019-01-09 03:55:05 +00:00
|
|
|
|