Skip to content

Commit b5bfedf

Browse files
committed
renaming, captive-portal requires dnsmasq, disable systemd call in scripts, enable only if not Appliance
1 parent 7d89898 commit b5bfedf

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

roles/4-server-options/tasks/main.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
- name: ...IS BEGINNING ==================================
44
command: echo
55

6+
- name: Installing Captive Portal
7+
include_tasks: roles/captive-portal/tasks/main.yml
8+
when: captive_portal_install
9+
tags: base, captive-portal, network, domain
10+
611
- name: Install dnsmasq
712
include_tasks: roles/network/tasks/dnsmasq.yml
8-
when: dnsmasq_install
9-
tags: base, domain, dnsmasq, network
13+
when: dnsmasq_install or captive_portal_install
14+
tags: base, captive-portal, domain, dnsmasq, network
1015

1116
- name: Install named / BIND
1217
include_tasks: roles/network/tasks/named.yml
1318
when: named_install
1419
tags: base, named, network, domain
1520

16-
- name: Installing captive portal
17-
include_tasks: roles/captive-portal/tasks/main.yml
18-
when: captive_portal_install
19-
tags: base, captive-portal, network, domain
20-
2121
- name: Installing dhcpd
2222
include_tasks: roles/network/tasks/dhcpd.yml
2323
when: dhcpd_install
@@ -28,11 +28,6 @@
2828
when: squid_install
2929
tags: base, squid, network, domain
3030

31-
- name: Installing Captive Portal
32-
include_tasks: roles/network/tasks/captive_portal.yml
33-
when: py_captive_portal_install
34-
tags: base, captive_portal
35-
3631
# NETWORK moved to the very end, after Stage 9 (9-LOCAL-ADDONS)
3732
# It can also be run manually using: cd /opt/iiab/iiab; ./iiab-network
3833
#

roles/captive-portal/templates/iiab-uncatch

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ awk '{print("address=/" $1 "/172.18.96.1")}' /opt/iiab/captive-portal/checkurls
1111
echo "#following tells windows 7 that captive portal is active" >>/etc/dnsmasq.d/capture
1212
echo "address=/dns.msftncsi.com/131.107.255.255" >> /etc/dnsmasq.d/capture
1313
awk '{print("ServerAlias ",$1)}' /opt/iiab/captive-portal/checkurls > /etc/apache2/capture
14-
systemctl start captive-portal
15-
systemctl start {{ apache_service }}

roles/network/tasks/captive_portal_enable.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@
88
owner: root
99
group: root
1010
mode: 0740
11-
when: py_captive_portal_enabled
11+
when: captive_portal_enabled
1212

1313
- name: Enable Apache's captive-portal.conf if py_captive_portal_enabled (debuntu)
1414
file:
1515
src: /etc/apache2/sites-available/001-captive-portal.conf
1616
path: /etc/apache2/sites-enabled/001-captive-portal.conf
1717
state: link
18-
when: py_captive_portal_enabled and is_debuntu
18+
when: captive_portal_enabled and is_debuntu
1919

2020
- name: Enable Apache's default-ssl.conf if py_captive_portal_enabled (debuntu)
2121
file:
2222
src: /etc/apache2/sites-available/default-ssl.conf
2323
path: /etc/apache2/sites-enabled/default-ssl.conf
2424
state: link
25-
when: py_captive_portal_enabled and is_debuntu
25+
when: captive_portal_enabled and is_debuntu
2626

2727
- name: Disable Apache's captive-portal.conf if not py_captive_portal_enabled (debuntu)
2828
file:
2929
path: /etc/apache2/sites-enabled/001-captive-portal.conf
3030
state: absent
31-
when: not py_captive_portal_enabled and is_debuntu
31+
when: not captive_portal_enabled and is_debuntu
3232

3333
- name: Disable Apache's captive-portal.conf if not py_captive_portal_enabled (redhat)
3434
file:
3535
path: /etc/{{ apache_config_dir }}/001-captive-portal.conf
3636
state: absent
37-
when: not py_captive_portal_enabled and not is_debuntu
37+
when: not captive_portal_enabled and not is_debuntu
3838

3939
- name: Disable Apache's default-ssl.conf if not py_captive_portal_enabled (debuntu)
4040
file:
@@ -44,19 +44,19 @@
4444

4545
- name: Enable & Start systemd service py-captive-portal.service if py_captive_portal_enabled
4646
systemd:
47-
name: py-captive-portal.service
47+
name: captive-portal.service
4848
daemon-reload: yes
4949
enabled: yes
5050
state: started
51-
when: py_captive_portal_enabled
51+
when: captive_portal_enabled
5252

5353
- name: Disable & Stop py-captive-portal.service if not py_captive_portal_enabled
5454
systemd:
55-
name: py-captive-portal.service
55+
name: captive-portal.service
5656
enabled: no
5757
state: stopped
5858
daemon-reload: yes
59-
when: not py_captive_portal_enabled
59+
when: not captive_portal_enabled
6060

6161
- name: Restart Apache
6262
systemd:

roles/network/tasks/computed_services.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
dansguardian_enabled: False
44
squid_enabled: False
55
wondershaper_enabled: False
6+
captive_portal_enabled: False
67
iiab_network_mode: "Appliance"
78
when: iiab_lan_iface == "none" or user_lan_iface == "none"
89

roles/network/tasks/enable_services.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
enabled: yes
6666
when: dnsmasq_enabled and dnsmasq_install
6767

68+
- name: Make sure dnsmasq is not diverting if not captive_portal_enabled
69+
file:
70+
path: /etc/dnsmasq.d/capture
71+
state: absent
72+
when: not captive_portal_enabled
73+
6874
- name: Enable DansGuardian systemd service, if dansguardian_enabled
6975
systemd:
7076
name: dansguardian

roles/network/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
#### end network layout
136136
- name: Captive Portal Configuration
137137
include_tasks: captive_portal_enable.yml
138-
when: py_captive_portal_install
138+
when: captive_portal_install
139139

140140
- include_tasks: restart.yml
141141
when: not installing

0 commit comments

Comments
 (0)