2018-07-17 05:41:51 +00:00
|
|
|
- name: Restart hostapd when WiFi is present
|
2018-04-07 21:45:04 +00:00
|
|
|
systemd:
|
|
|
|
name: hostapd
|
|
|
|
state: restarted
|
|
|
|
when: iiab_wireless_lan_iface is defined and hostapd_enabled and iiab_network_mode != "Appliance"
|
2017-11-01 14:59:33 +00:00
|
|
|
|
2017-05-27 18:09:50 +00:00
|
|
|
- name: Start named service
|
2018-11-04 03:39:03 +00:00
|
|
|
systemd:
|
2017-12-29 06:19:06 +00:00
|
|
|
name: "{{ dns_service }}"
|
|
|
|
state: restarted
|
2017-09-13 11:07:25 +00:00
|
|
|
when: named_enabled and named_install
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2017-11-02 17:52:16 +00:00
|
|
|
- name: Stop Squid service
|
2018-11-04 03:39:03 +00:00
|
|
|
systemd:
|
2017-12-29 06:19:06 +00:00
|
|
|
name: "{{ proxy }}"
|
|
|
|
state: stopped
|
2017-11-11 23:43:55 +00:00
|
|
|
async: 120
|
2017-11-02 17:52:16 +00:00
|
|
|
when: squid_install
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2017-11-03 03:52:13 +00:00
|
|
|
- name: Stop DansGuardian
|
2018-11-04 03:39:03 +00:00
|
|
|
systemd:
|
2017-12-29 06:19:06 +00:00
|
|
|
name: dansguardian
|
|
|
|
state: stopped
|
2017-11-03 03:52:13 +00:00
|
|
|
when: dansguardian_install
|
|
|
|
|
2018-11-04 03:39:03 +00:00
|
|
|
- name: Restart DansGuardian service (dansguardian) except Ubuntu which needs reboot to activate
|
|
|
|
systemd:
|
2017-12-29 06:19:06 +00:00
|
|
|
name: dansguardian
|
|
|
|
state: restarted
|
2017-11-03 02:16:28 +00:00
|
|
|
when: dansguardian_enabled and dansguardian_install and ( not is_ubuntu and iiab_stage|int < 4 )
|
2017-05-27 18:09:50 +00:00
|
|
|
|
|
|
|
# Squid get re-loaded with dispatcher.d
|
2018-11-04 03:39:03 +00:00
|
|
|
- name: Restart Squid service ({{ proxy }})
|
|
|
|
systemd:
|
2017-12-29 06:19:06 +00:00
|
|
|
name: "{{ proxy }}"
|
|
|
|
state: restarted
|
2017-08-09 05:29:40 +00:00
|
|
|
when: squid_enabled and squid_install
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2018-11-04 03:39:03 +00:00
|
|
|
- name: Restart Wondershaper service (wondershaper)
|
|
|
|
systemd:
|
2017-12-29 06:19:06 +00:00
|
|
|
name: wondershaper
|
|
|
|
state: restarted
|
2017-05-27 18:09:50 +00:00
|
|
|
when: wondershaper_enabled
|
|
|
|
|
2018-11-04 03:39:03 +00:00
|
|
|
- name: Restart Avahi service (avahi-daemon)
|
|
|
|
systemd:
|
2017-12-29 06:19:06 +00:00
|
|
|
name: avahi-daemon
|
|
|
|
state: restarted
|
2017-05-27 18:09:50 +00:00
|
|
|
|
|
|
|
- name: Create gateway flag
|
|
|
|
shell: echo 1 > /etc/sysconfig/olpc-scripts/setup.d/installed/gateway
|
2017-12-29 06:19:06 +00:00
|
|
|
args:
|
|
|
|
creates: /etc/sysconfig/olpc-scripts/setup.d/installed/gateway
|
2017-06-09 23:25:56 +00:00
|
|
|
when: iiab_network_mode == "Gateway"
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2019-05-07 20:16:07 +00:00
|
|
|
- name: Waiting {{ hostapd_wait }} seconds for network to stabilize (iiap-gen-iptables will fail if dnsmasq isn't ready!)
|
2017-11-01 14:59:33 +00:00
|
|
|
shell: sleep {{ hostapd_wait }}
|
|
|
|
|
2018-11-04 03:39:03 +00:00
|
|
|
- name: Run /usr/bin/iiab-gen-iptables
|
2017-06-28 02:53:13 +00:00
|
|
|
command: /usr/bin/iiab-gen-iptables
|
2017-09-13 14:30:59 +00:00
|
|
|
|
2017-11-08 06:58:26 +00:00
|
|
|
- name: Checking if WiFi slave is active
|
2017-11-06 23:14:33 +00:00
|
|
|
shell: brctl show br0 | grep {{ iiab_wireless_lan_iface }} | wc -l
|
2018-01-01 16:03:29 +00:00
|
|
|
when: hostapd_enabled and iiab_wireless_lan_iface is defined and iiab_lan_iface == "br0"
|
2017-10-16 01:33:12 +00:00
|
|
|
register: wifi_slave
|
2017-09-13 14:30:59 +00:00
|
|
|
|
2017-11-08 06:58:26 +00:00
|
|
|
- name: Restart hostapd if WiFi slave is inactive
|
2018-04-07 21:45:04 +00:00
|
|
|
systemd:
|
|
|
|
name: hostapd
|
2017-12-29 06:19:06 +00:00
|
|
|
state: restarted
|
2018-01-01 16:03:29 +00:00
|
|
|
when: hostapd_enabled and wifi_slave.stdout is defined and wifi_slave.stdout == 0
|
2017-11-01 14:59:33 +00:00
|
|
|
|
|
|
|
- name: dhcp_server may be affected - starting - user choice
|
2018-11-04 03:39:03 +00:00
|
|
|
systemd:
|
2017-12-29 06:19:06 +00:00
|
|
|
name: "{{ dhcp_service2 }}"
|
|
|
|
state: restarted
|
2019-02-26 18:23:55 +00:00
|
|
|
when: (iiab_network_mode != "Appliance") # Sufficient b/c br0 exists thanks to /etc/network/interfaces.d/iiab
|
|
|
|
#when: (iiab_network_mode != "Appliance") and (not no_net_restart)
|
2019-02-25 17:00:46 +00:00
|
|
|
#when: iiab_network_mode != "Appliance" and iiab_wan_iface != discovered_wireless_iface
|