mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
rework dhcp_service2 for race condition for WIFI without bridging enabled
This commit is contained in:
parent
54f7b4e728
commit
76835bac05
3 changed files with 28 additions and 17 deletions
|
@ -70,10 +70,10 @@
|
||||||
service: name=networking state=restarted
|
service: name=networking state=restarted
|
||||||
when: interface.changed and not is_VM is defined
|
when: interface.changed and not is_VM is defined
|
||||||
|
|
||||||
- name: restart hostapd when wifi is present
|
#- name: restart hostapd when wifi is present
|
||||||
service: name=hostapd state=started
|
# service: name=hostapd state=started
|
||||||
when: iiab_wireless_lan_iface != "none" and hostapd_enabled and iiab_network_mode != "Appliance"
|
# when: iiab_wireless_lan_iface != "none" and hostapd_enabled and iiab_network_mode != "Appliance"
|
||||||
|
|
||||||
- name: dhcp_server may be affected - starting - user choice
|
#- name: dhcp_server may be affected - starting - user choice
|
||||||
service: name={{ dhcp_service2 }} state=started
|
# service: name={{ dhcp_service2 }} state=started
|
||||||
when: iiab_network_mode != "Appliance"
|
# when: iiab_network_mode != "Appliance"
|
||||||
|
|
|
@ -110,9 +110,9 @@
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ lan_list_result.stdout_lines }}"
|
- "{{ lan_list_result.stdout_lines }}"
|
||||||
|
|
||||||
- name: restart hostapd when wifi is present
|
#- name: restart hostapd when wifi is present
|
||||||
service: name=hostapd state=started
|
# service: name=hostapd state=started
|
||||||
when: iiab_wireless_lan_iface != "none" and hostapd_enabled and iiab_network_mode != "Appliance"
|
# when: iiab_wireless_lan_iface != "none" and hostapd_enabled and iiab_network_mode != "Appliance"
|
||||||
|
|
||||||
- name: dhcp_server may be affected - starting - user choice
|
#- name: dhcp_server may be affected - starting - user choice
|
||||||
service: name={{ dhcp_service2 }} state=started
|
# service: name={{ dhcp_service2 }} state=started
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
- name: restart hostapd when wifi is present
|
||||||
|
service: name=hostapd state=started
|
||||||
|
when: iiab_wireless_lan_iface != "none" and hostapd_enabled
|
||||||
|
# when: iiab_wireless_lan_iface != "none" and hostapd_enabled and iiab_network_mode != "Appliance"
|
||||||
|
|
||||||
- name: Start named service
|
- name: Start named service
|
||||||
service: name={{ dns_service }}
|
service: name={{ dns_service }}
|
||||||
state=started
|
state=started
|
||||||
|
@ -26,7 +31,7 @@
|
||||||
|
|
||||||
- name: Restart Wondershaper service
|
- name: Restart Wondershaper service
|
||||||
service: name=wondershaper
|
service: name=wondershaper
|
||||||
state=restarted
|
state=restarted
|
||||||
when: wondershaper_enabled
|
when: wondershaper_enabled
|
||||||
|
|
||||||
- name: Restart avahi service
|
- name: Restart avahi service
|
||||||
|
@ -38,17 +43,23 @@
|
||||||
creates=/etc/sysconfig/olpc-scripts/setup.d/installed/gateway
|
creates=/etc/sysconfig/olpc-scripts/setup.d/installed/gateway
|
||||||
when: iiab_network_mode == "Gateway"
|
when: iiab_network_mode == "Gateway"
|
||||||
|
|
||||||
|
- name: Waiting {{ hostapd_wait }} seconds for network to stablize
|
||||||
|
shell: sleep {{ hostapd_wait }}
|
||||||
|
|
||||||
- name: Run iptables
|
- name: Run iptables
|
||||||
command: /usr/bin/iiab-gen-iptables
|
command: /usr/bin/iiab-gen-iptables
|
||||||
|
|
||||||
- name: Checking if wifi slave is active waiting {{ hostapd_wait }} seconds
|
- name: Checking if wifi slave is active waiting {{ hostapd_wait }} seconds
|
||||||
shell: "sleep {{ hostapd_wait }} | brctl show br0 | grep {{ iiab_wireless_lan_iface }}"
|
shell: brctl show br0 | grep {{ iiab_wireless_lan_iface }}
|
||||||
when: iiab_lan_iface == "br0" and iiab_wireless_lan_iface != "none"
|
when: iiab_wireless_lan_iface != "none" and iiab_lan_iface == "br0" and hostapd_enabled
|
||||||
register: wifi_slave
|
register: wifi_slave
|
||||||
|
|
||||||
- name: Restart hostapd if wifi slave is inactive
|
- name: Restart hostapd if wifi slave is inactive
|
||||||
service: name=hostapd.service
|
service: name=hostapd.service
|
||||||
state=restarted
|
state=restarted
|
||||||
when: iiab_wireless_lan_iface != "none" and hostapd_enabled and item|trim == ""
|
when: iiab_wireless_lan_iface != "none" and iiab_lan_iface == "br0" and hostapd_enabled
|
||||||
with_items:
|
|
||||||
- "{{ wifi_slave.stdout }}"
|
- name: dhcp_server may be affected - starting - user choice
|
||||||
|
service: name={{ dhcp_service2 }}
|
||||||
|
state=restarted
|
||||||
|
when: iiab_network_mode != "Appliance"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue