mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	hostapd.yml - missed rpi_model != 'none', touchups
This commit is contained in:
		
							parent
							
								
									63c64271af
								
							
						
					
					
						commit
						117e40f5bc
					
				
					 1 changed files with 11 additions and 13 deletions
				
			
		| 
						 | 
					@ -1,3 +1,9 @@
 | 
				
			||||||
 | 
					- name: Unmask the Access Point 'hostapd' service
 | 
				
			||||||
 | 
					  systemd:
 | 
				
			||||||
 | 
					    name: hostapd
 | 
				
			||||||
 | 
					    enabled: no
 | 
				
			||||||
 | 
					    masked: no
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Disable hostapd when not using ap0 and wifi gateway present
 | 
					- name: Disable hostapd when not using ap0 and wifi gateway present
 | 
				
			||||||
  set_fact:
 | 
					  set_fact:
 | 
				
			||||||
    hostapd_enabled: False
 | 
					    hostapd_enabled: False
 | 
				
			||||||
| 
						 | 
					@ -73,7 +79,7 @@
 | 
				
			||||||
    group: root
 | 
					    group: root
 | 
				
			||||||
    mode: 0755
 | 
					    mode: 0755
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Create dhcpcd hook for hostapd
 | 
					- name: Create dhcpcd hook for hostapd and ap0 when wifi_up_down True
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: hostapd/50-hostapd
 | 
					    src: hostapd/50-hostapd
 | 
				
			||||||
    dest: /lib/dhcpcd/dhcpcd-hooks/50-hostapd
 | 
					    dest: /lib/dhcpcd/dhcpcd-hooks/50-hostapd
 | 
				
			||||||
| 
						 | 
					@ -82,7 +88,7 @@
 | 
				
			||||||
    mode: 0644
 | 
					    mode: 0644
 | 
				
			||||||
  when: is_raspbian and wifi_up_down
 | 
					  when: is_raspbian and wifi_up_down
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove dhcpcd hook for hostapd if WiFi is not split
 | 
					- name: Remove dhcpcd hook for hostapd if WiFi is not split using ap0
 | 
				
			||||||
  file:
 | 
					  file:
 | 
				
			||||||
    path: /lib/dhcpcd/dhcpcd-hooks/50-hostapd
 | 
					    path: /lib/dhcpcd/dhcpcd-hooks/50-hostapd
 | 
				
			||||||
    state: absent
 | 
					    state: absent
 | 
				
			||||||
| 
						 | 
					@ -104,7 +110,7 @@
 | 
				
			||||||
    - { src: 'hostapd/00-iiab-debug', dest: '/etc/networkd-dispatcher/routable.d/00-iiab-debug' }
 | 
					    - { src: 'hostapd/00-iiab-debug', dest: '/etc/networkd-dispatcher/routable.d/00-iiab-debug' }
 | 
				
			||||||
  when: systemd_networkd_active and discovered_wireless_iface != "none"
 | 
					  when: systemd_networkd_active and discovered_wireless_iface != "none"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Create networkd-dispatcher hook for hostapd
 | 
					- name: Create networkd-dispatcher hook for hostapd wifi_up_down True
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    owner: root
 | 
					    owner: root
 | 
				
			||||||
    group: root
 | 
					    group: root
 | 
				
			||||||
| 
						 | 
					@ -117,7 +123,7 @@
 | 
				
			||||||
    - { src: 'hostapd/netd-disp', dest: '/etc/networkd-dispatcher/routable.d/iiab-wifi' }
 | 
					    - { src: 'hostapd/netd-disp', dest: '/etc/networkd-dispatcher/routable.d/iiab-wifi' }
 | 
				
			||||||
  when: systemd_networkd_active and discovered_wireless_iface != "none" and wifi_up_down
 | 
					  when: systemd_networkd_active and discovered_wireless_iface != "none" and wifi_up_down
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove networkd-dispatcher hook for hostapd on RPi hardware and not up/down
 | 
					- name: Remove networkd-dispatcher hook wifi_up_down False
 | 
				
			||||||
  file:
 | 
					  file:
 | 
				
			||||||
    path: "{{ item.dest }}"
 | 
					    path: "{{ item.dest }}"
 | 
				
			||||||
    state: absent
 | 
					    state: absent
 | 
				
			||||||
| 
						 | 
					@ -125,19 +131,11 @@
 | 
				
			||||||
    - { dest: '/etc/networkd-dispatcher/carrier.d/iiab-wifi' }
 | 
					    - { dest: '/etc/networkd-dispatcher/carrier.d/iiab-wifi' }
 | 
				
			||||||
    - { dest: '/etc/networkd-dispatcher/no-carrier.d/iiab-wifi' }
 | 
					    - { dest: '/etc/networkd-dispatcher/no-carrier.d/iiab-wifi' }
 | 
				
			||||||
    - { dest: '/etc/networkd-dispatcher/routable.d/iiab-wifi' }
 | 
					    - { dest: '/etc/networkd-dispatcher/routable.d/iiab-wifi' }
 | 
				
			||||||
  when: systemd_networkd_active and discovered_wireless_iface != "none" and rpi_model != "none" and not wifi_up_down
 | 
					  when: systemd_networkd_active and discovered_wireless_iface != "none" and not wifi_up_down
 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Disable the Access Point 'hostapd' service
 | 
					 | 
				
			||||||
  systemd:
 | 
					 | 
				
			||||||
    name: hostapd
 | 
					 | 
				
			||||||
    enabled: no
 | 
					 | 
				
			||||||
# cheap workaround for when /etc/init.d is populated
 | 
					 | 
				
			||||||
#  when: not hostapd_enabled
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Enable the Access Point 'hostapd' service
 | 
					- name: Enable the Access Point 'hostapd' service
 | 
				
			||||||
  systemd:
 | 
					  systemd:
 | 
				
			||||||
    name: hostapd
 | 
					    name: hostapd
 | 
				
			||||||
    masked: no
 | 
					 | 
				
			||||||
    enabled: yes
 | 
					    enabled: yes
 | 
				
			||||||
  when: hostapd_enabled
 | 
					  when: hostapd_enabled
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue