mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	#1320 fix for U-18 dnsmasq
This commit is contained in:
		
							parent
							
								
									967102bc4f
								
							
						
					
					
						commit
						3167f8133a
					
				
					 3 changed files with 37 additions and 23 deletions
				
			
		| 
						 | 
					@ -3,21 +3,7 @@
 | 
				
			||||||
  shell: ls /etc/netplan | grep -v -e 01-iiab-config
 | 
					  shell: ls /etc/netplan | grep -v -e 01-iiab-config
 | 
				
			||||||
  register: netplan
 | 
					  register: netplan
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Think 50-cloud-init.yaml is created on the fly by cloud-init on every boot
 | 
					- name: Disable cloud-init the easy way
 | 
				
			||||||
# need to double check the timestamps of the file on a rebooted machine
 | 
					 | 
				
			||||||
# disable cloud-init if that holds true
 | 
					 | 
				
			||||||
#- name: Disable and mask cloud-init
 | 
					 | 
				
			||||||
#  systemd:
 | 
					 | 
				
			||||||
#    name: "{{ item }}"
 | 
					 | 
				
			||||||
#    enabled: no
 | 
					 | 
				
			||||||
#    masked: yes
 | 
					 | 
				
			||||||
#    state: stopped
 | 
					 | 
				
			||||||
#  with_items:
 | 
					 | 
				
			||||||
#   - cloud-init-local
 | 
					 | 
				
			||||||
#   - cloud-init
 | 
					 | 
				
			||||||
#  when: "{{ netplan }}" == "50-cloud-init.yaml"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Disable cloud-init
 | 
					 | 
				
			||||||
  shell: touch /etc/cloud/cloud-init.disabled
 | 
					  shell: touch /etc/cloud/cloud-init.disabled
 | 
				
			||||||
  when: "{{ netplan }}" == "50-cloud-init.yaml"
 | 
					  when: "{{ netplan }}" == "50-cloud-init.yaml"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,13 +13,27 @@
 | 
				
			||||||
    dest: /etc/netplan/{{ netplan }}
 | 
					    dest: /etc/netplan/{{ netplan }}
 | 
				
			||||||
  when: netplan != ""
 | 
					  when: netplan != ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Was needed at one point retesting current needs
 | 
					### NM might need attention also
 | 
				
			||||||
#- name: Disable and mask systemd-networkd-wait-online
 | 
					- name: Disable the stock dnsmasq unit file that starts too early with systemd_networkd_active
 | 
				
			||||||
#  systemd:
 | 
					  systemd:
 | 
				
			||||||
#    name: systemd-networkd-wait-online
 | 
					    name: dnsmasq
 | 
				
			||||||
#    enabled: no
 | 
					    enabled: no
 | 
				
			||||||
#    masked: yes
 | 
					  when: systemd_networkd_active
 | 
				
			||||||
#    state: stopped
 | 
					
 | 
				
			||||||
 | 
					- name: Install dnsmasq helper unit file when systemd_networkd_active
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: network/dnsmasq.service.u18
 | 
				
			||||||
 | 
					    dest: /etc/systemd/system/iiab-dnsmasq.service
 | 
				
			||||||
 | 
					  when: systemd_networkd_active
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Ensure required dnsmasq unit files are enabled for reboot systemd_networkd_active
 | 
				
			||||||
 | 
					  systemd:
 | 
				
			||||||
 | 
					    name: "{{ item }}"
 | 
				
			||||||
 | 
					    enabled: yes
 | 
				
			||||||
 | 
					  with_items:
 | 
				
			||||||
 | 
					   - iiab-dnsmasq
 | 
				
			||||||
 | 
					   - systemd-networkd-wait-online
 | 
				
			||||||
 | 
					  when: systemd_networkd_active
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ICO will always set gui_static_wan_ip away from the default of 'unset' while
 | 
					# ICO will always set gui_static_wan_ip away from the default of 'unset' while
 | 
				
			||||||
# gui_static_wan turns dhcp on/off through wan_ip in computed_network and
 | 
					# gui_static_wan turns dhcp on/off through wan_ip in computed_network and
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
[Unit]
 | 
					[Unit]
 | 
				
			||||||
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
 | 
					Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
 | 
				
			||||||
After=network-online.target
 | 
					Requires=network.target
 | 
				
			||||||
 | 
					Before=network-online.target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Service]
 | 
					[Service]
 | 
				
			||||||
Type=idle
 | 
					Type=idle
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										13
									
								
								roles/network/templates/network/dnsmasq.service.u18
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								roles/network/templates/network/dnsmasq.service.u18
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,13 @@
 | 
				
			||||||
 | 
					Unit]
 | 
				
			||||||
 | 
					Description=Network iiab-dnsmasq
 | 
				
			||||||
 | 
					Wants=network.target
 | 
				
			||||||
 | 
					After=network-online.target
 | 
				
			||||||
 | 
					Requires=network-online.target
 | 
				
			||||||
 | 
					Requires=systemd-networkd-wait-online
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Service]
 | 
				
			||||||
 | 
					Type=oneshot
 | 
				
			||||||
 | 
					ExecStart=/bin/systemctl start dnsmasq
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Install]
 | 
				
			||||||
 | 
					WantedBy=multi-user.target
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue