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

Merge pull request #3885 from jvonau/HT-new

Ht new
This commit is contained in:
A Holt 2025-01-13 22:20:20 -05:00 committed by GitHub
commit 3fa91b821a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 28 deletions

View file

@ -239,6 +239,22 @@
iiab_lan_iface: "{{ iiab_wireless_lan_iface }}"
when: iiab_wireless_lan_iface is defined and nobridge is defined
- name: Detect WiFi country code in use
shell: iw reg get | grep country | grep -v UNSET | awk '{print $2}' | sed "s|:||"
register: REG_DOM
ignore_errors: True
when: wifi_up_down and can_be_ap and has_wifi_gateway is defined
- name: Set Wifi Region country to {{ REG_DOM.stdout }} for hostapd when present
set_fact:
host_country_code: "{{ REG_DOM.stdout }}"
when: REG_DOM.stdout is defined and REG_DOM.stdout | length > 0
- name: Detect current Wifi channel
shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2
register: current_client_channel
when: wifi_up_down and can_be_ap and has_wifi_gateway is defined
- name: In VM disable LAN - needs local_vars entry to activate
set_fact:
iiab_lan_iface: none
@ -295,6 +311,19 @@
value: "{{ iiab_wan_iface }}"
- option: can_be_ap
value: "{{ can_be_ap }}"
- option: host_country_code_found
value: "{{ host_country_code }}"
- name: Add 'detected_network' variable 'current_client_channel_found' value if defined, to {{ iiab_ini_file }}
ini_file:
dest: "{{ iiab_ini_file }}"
section: detected_network
option: "{{ item.option }}"
value: "{{ item.value | string }}"
with_items:
- option: client_wifi_channel_found
value: "{{ current_client_channel.stdout }}"
when: current_client_channel.stdout is defined
# well if there ever was a point to tell the user things are FUBAR this is it.
# limit 2 network adapters wifi wired

View file

@ -3,28 +3,12 @@
hostapd_enabled: False
when: (not wifi_up_down and discovered_wireless_iface == iiab_wan_iface) or discovered_wireless_iface == "none" or not can_be_ap
- name: Disable the Access Point 'hostapd' service
- name: Disable the Access Point 'hostapd' service if hostapd_enabled False
systemd:
name: hostapd
enabled: no
when: not hostapd_enabled
- name: Detect WiFi country code in use
shell: iw reg get | grep country | grep -v UNSET | awk '{print $2}' | sed "s|:||"
register: REG_DOM
ignore_errors: True
when: wifi_up_down and can_be_ap and has_wifi_gateway is defined
- name: Set Wifi Region country code for hostapd when present
set_fact:
host_country_code: "{{ REG_DOM.stdout }}"
when: REG_DOM.stdout is defined and REG_DOM.stdout | length > 0
- name: Detect current Wifi channel
shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2
register: current_client_channel
when: wifi_up_down and can_be_ap and has_wifi_gateway is defined
- name: Setting WiFi channel to {{ current_client_channel.stdout }}
set_fact:
host_channel: "{{ current_client_channel.stdout }}"
@ -131,14 +115,3 @@
value: "{{ host_country_code }}"
- option: host_channel
value: "{{ host_channel }}"
- name: Add 'network' variable 'current_client_channel' value if defined, to {{ iiab_ini_file }}
ini_file:
dest: "{{ iiab_ini_file }}"
section: network
option: "{{ item.option }}"
value: "{{ item.value | string }}"
with_items:
- option: client_wifi_channel
value: "{{ current_client_channel.stdout }}"
when: current_client_channel.stdout is defined