1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/network/tasks/restart.yml

80 lines
2.4 KiB
YAML
Raw Normal View History

2018-07-17 05:41:51 +00:00
- name: Restart hostapd when WiFi is present
systemd:
name: hostapd
state: restarted
when: iiab_wireless_lan_iface is defined and hostapd_enabled and iiab_network_mode != "Appliance"
2017-05-27 18:09:50 +00:00
- name: Start named service
2018-11-04 03:39:03 +00:00
systemd:
name: "{{ dns_service }}"
state: restarted
when: named_enabled and named_install
2017-05-27 18:09:50 +00:00
- name: Stop Squid service
2018-11-04 03:39:03 +00:00
systemd:
name: "{{ proxy }}"
state: stopped
2017-11-11 23:43:55 +00:00
async: 120
2019-05-24 05:51:03 +00:00
when: squid_install | bool
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:
name: dansguardian
state: stopped
2019-05-24 05:51:03 +00:00
when: dansguardian_install | bool
2017-11-03 03:52:13 +00:00
2018-11-04 03:39:03 +00:00
- name: Restart DansGuardian service (dansguardian) except Ubuntu which needs reboot to activate
systemd:
name: dansguardian
state: restarted
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:
name: "{{ proxy }}"
state: restarted
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:
name: wondershaper
state: restarted
2019-05-24 05:51:03 +00:00
when: wondershaper_enabled | bool
2017-05-27 18:09:50 +00:00
2018-11-04 03:39:03 +00:00
- name: Restart Avahi service (avahi-daemon)
systemd:
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
args:
creates: /etc/sysconfig/olpc-scripts/setup.d/installed/gateway
when: iiab_network_mode == "Gateway"
2017-05-27 18:09:50 +00:00
- name: Waiting {{ hostapd_wait }} seconds for network to stabilize (iiap-gen-iptables will fail if dnsmasq isn't ready!)
shell: sleep {{ hostapd_wait }}
2018-11-04 03:39:03 +00:00
- name: Run /usr/bin/iiab-gen-iptables
command: /usr/bin/iiab-gen-iptables
2017-11-08 06:58:26 +00:00
- name: Checking if WiFi slave is active
shell: brctl show br0 | grep {{ iiab_wireless_lan_iface }} | wc -l
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-11-08 06:58:26 +00:00
- name: Restart hostapd if WiFi slave is inactive
systemd:
name: hostapd
state: restarted
when: hostapd_enabled and wifi_slave.stdout is defined and wifi_slave.stdout == 0
- name: dhcp_server may be affected - starting - user choice
2018-11-04 03:39:03 +00:00
systemd:
name: "{{ dhcp_service2 }}"
state: restarted
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