mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	ubuntu no reboot
This commit is contained in:
		
							parent
							
								
									c51575f02b
								
							
						
					
					
						commit
						b60d4957a1
					
				
					 1 changed files with 19 additions and 5 deletions
				
			
		| 
						 | 
					@ -2,13 +2,26 @@
 | 
				
			||||||
#iiab_wireless_lan_iface(ap0) - wifi_up_down True needs hw
 | 
					#iiab_wireless_lan_iface(ap0) - wifi_up_down True needs hw
 | 
				
			||||||
#hostapd_enabled False - set in hostapd.yml to avoid the enable with wifi_up_down False
 | 
					#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
 | 
					#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
 | 
					- name: Restart hostapd when WiFi is present but not when using WiFi as gateway with wifi_up_down False
 | 
				
			||||||
  systemd:
 | 
					  systemd:
 | 
				
			||||||
    name: hostapd
 | 
					    name: hostapd
 | 
				
			||||||
    state: restarted
 | 
					    state: restarted
 | 
				
			||||||
 | 
					  when: hostapd_enabled and (wifi_up_down or not no_net_restart)
 | 
				
			||||||
#  when: iiab_wireless_lan_iface is defined and hostapd_enabled and discovered_wireless_iface != iiab_wan_iface
 | 
					#  when: iiab_wireless_lan_iface is defined and hostapd_enabled and discovered_wireless_iface != iiab_wan_iface
 | 
				
			||||||
#  when: hostapd_enabled and iiab_wireless_lan_iface is defined and discovered_wireless_iface == iiab_wireless_lan_iface
 | 
					#  when: hostapd_enabled and iiab_wireless_lan_iface is defined and discovered_wireless_iface == iiab_wireless_lan_iface
 | 
				
			||||||
  when: hostapd_enabled and not no_net_restart
 | 
					
 | 
				
			||||||
 | 
					- name: Restart clone-wifi wpa_supplicant service
 | 
				
			||||||
 | 
					  systemd:
 | 
				
			||||||
 | 
					    name: "{{ item }}"
 | 
				
			||||||
 | 
					    state: restarted
 | 
				
			||||||
 | 
					  with_items:
 | 
				
			||||||
 | 
					    - clone-wifi
 | 
				
			||||||
 | 
					    - wpa_supplicant
 | 
				
			||||||
 | 
					  when: wifi_up_down and hostapd_enabled and is_ubuntu
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Reload netplan for Wifi gateway on Ubuntu 18+
 | 
				
			||||||
 | 
					  shell: netplan apply
 | 
				
			||||||
 | 
					  when: wifi_up_down and netplan.stdout.find("yaml") != -1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Start named service
 | 
					- name: Start named service
 | 
				
			||||||
  systemd:
 | 
					  systemd:
 | 
				
			||||||
| 
						 | 
					@ -72,7 +85,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Checking if WiFi slave is active
 | 
					- name: Checking if WiFi slave is active
 | 
				
			||||||
  shell: brctl show br0 | grep {{ iiab_wireless_lan_iface }} | wc -l
 | 
					  shell: brctl show br0 | grep {{ iiab_wireless_lan_iface }} | wc -l
 | 
				
			||||||
  when: hostapd_enabled and discovered_wireless_iface != iiab_wan_iface and iiab_lan_iface == "br0"
 | 
					#  when: hostapd_enabled and discovered_wireless_iface != iiab_wan_iface and iiab_lan_iface == "br0"
 | 
				
			||||||
 | 
					  when: hostapd_enabled and iiab_lan_iface == "br0"
 | 
				
			||||||
  register: wifi_slave
 | 
					  register: wifi_slave
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Restart hostapd if WiFi slave is inactive
 | 
					- name: Restart hostapd if WiFi slave is inactive
 | 
				
			||||||
| 
						 | 
					@ -82,6 +96,8 @@
 | 
				
			||||||
  when: hostapd_enabled and wifi_slave.stdout is defined and wifi_slave.stdout == 0
 | 
					  when: hostapd_enabled and wifi_slave.stdout is defined and wifi_slave.stdout == 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#both interfaces.d and systemd-networkd should have br0 available and Appliance lacks br0
 | 
					#both interfaces.d and systemd-networkd should have br0 available and Appliance lacks br0
 | 
				
			||||||
 | 
					#keep an eye on legacy wifi installs where br0 is present but not 'online' with an ip address
 | 
				
			||||||
 | 
					#due to hostapd didn't go to a carrier state. All others should get dnsmasq restarted
 | 
				
			||||||
- name: User choice of dnsmasq or dhcpd - restarting {{ dhcp_service2 }}
 | 
					- name: User choice of dnsmasq or dhcpd - restarting {{ dhcp_service2 }}
 | 
				
			||||||
  systemd:
 | 
					  systemd:
 | 
				
			||||||
    name: "{{ dhcp_service2 }}"
 | 
					    name: "{{ dhcp_service2 }}"
 | 
				
			||||||
| 
						 | 
					@ -89,5 +105,3 @@
 | 
				
			||||||
  when: (not no_net_restart) or wifi_up_down
 | 
					  when: (not no_net_restart) or wifi_up_down
 | 
				
			||||||
  #when: (iiab_network_mode != "Appliance")    # Sufficient b/c br0 exists thanks to /etc/network/interfaces.d/iiab
 | 
					  #when: (iiab_network_mode != "Appliance")    # Sufficient b/c br0 exists thanks to /etc/network/interfaces.d/iiab
 | 
				
			||||||
  #when: iiab_network_mode != "Appliance" and iiab_wan_iface != discovered_wireless_iface
 | 
					  #when: iiab_network_mode != "Appliance" and iiab_wan_iface != discovered_wireless_iface
 | 
				
			||||||
#keep an eye on legacy wifi installs where br0 is present but not 'online' with an ip address
 | 
					 | 
				
			||||||
#due to hostapd didn't go to a carrier state. All others should get dnsmasq restarted
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue