1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

rpi wifi-runtime changes

This commit is contained in:
Jerry Vonau 2020-05-06 15:51:40 -04:00
parent 52c0f2aaea
commit a95d476287
3 changed files with 33 additions and 31 deletions

View file

@ -1,37 +1,10 @@
- name: Clone wifi if needed
systemd:
name: clone-wifi
state: started
#hostapd_enabled False - set in hostapd.yml to avoid the enable with wifi_up_down False
#no_net_restart: True - main.yml discovered_wireless_iface == iiab_wan_iface
- name: Restart hostapd when WiFi is present but not when using WiFi as gateway with wifi_up_down False
systemd:
name: hostapd
state: restarted
when: hostapd_enabled and (wifi_up_down or not no_net_restart)
- name: Stop wpa_supplicant on Raspbian
shell: killall wpa_supplicant
when: is_raspbian
# now pick up denyinterfaces and respawn wpa_supplicant
- name: Restart wpa_supplicant dhcpcd on Raspbian
- name: Restart wpa_supplicant service
systemd:
name: "{{ item }}"
state: restarted
with_items:
- wpa_supplicant
- dhcpcd
when: is_raspbian
- name: Restart wpa_supplicant service on Ubuntu
systemd:
name: "{{ item }}"
state: restarted
with_items:
- wpa_supplicant
when: wifi_up_down and hostapd_enabled and is_ubuntu
when: wifi_up_down and hostapd_enabled
- name: Reload netplan for Wifi gateway on Ubuntu 18+
shell: netplan apply

View file

@ -50,10 +50,28 @@
systemd:
daemon_reload: yes
- name: Clone wifi if needed
systemd:
name: clone-wifi
state: started
- name: Restart the networking service if appropriate
systemd:
name: networking
enabled: yes
state: restarted
when: not nobridge is defined # less is better
#when: not nobridge is defined and not no_net_restart
- name: Restart hostapd when WiFi is present but not when using WiFi as gateway$
systemd:
name: hostapd
state: restarted
when: hostapd_enabled and (wifi_up_down or not no_net_restart)
- name: Stop wpa_supplicant on Raspbian
shell: killall wpa_supplicant
# now pick up denyinterfaces and respawn wpa_supplicant
- name: Restart dhcpcd on Raspbian
systemd:
name: dhcpcd
state: restarted

View file

@ -51,7 +51,18 @@
systemd:
daemon_reload: yes
- name: Clone wifi if needed
systemd:
name: clone-wifi
state: started
- name: Restart the systemd-networkd service
systemd:
name: systemd-networkd
state: restarted
- name: Restart hostapd when WiFi is present but not when using WiFi as gateway$
systemd:
name: hostapd
state: restarted
when: hostapd_enabled and (wifi_up_down or not no_net_restart)