From 4be4747f960e272630c66c9200af0a418fee70ea Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Sun, 11 Dec 2022 15:52:40 -0500 Subject: [PATCH] fix: Set wifi-device names to ensure ifaces point to correct device Before this commit, we do not add an uci section name to wifi-device(s). For example, if we do not have a section in `/etc/config/wireless` for the phy at sysfs path `ffe09000.pcie...`, creating one with Ansible with this inventory variable: ```yaml - name: radio1 path: ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0 template: ath9k_2 channel: 6 ``` would give us ```/etc/config/wireless config wifi-device option type 'mac80211' option htmode 'HT20' option band '2g' option channel '6' option country 'US' option disabled '0' option path 'ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0' ``` ... and not: ```/etc/config/wireless config wifi-device 'radio1' option type 'mac80211' option htmode 'HT20' option band '2g' option channel '6' option country 'US' option disabled '0' option path 'ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0' ``` We must name the wifi-device section, since wifi-iface sections point to the name of their wifi-device exclusively. (cherry picked from commit 0c8452b9a6d408b1669e273feb6a9161d0a56da6) --- roles/netconfig/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/netconfig/tasks/main.yml b/roles/netconfig/tasks/main.yml index ac4d6c4..3eb4e67 100644 --- a/roles/netconfig/tasks/main.yml +++ b/roles/netconfig/tasks/main.yml @@ -36,6 +36,7 @@ type: wifi-device find_by: path: "{{ item.path }}" + name: "{{ item.name }}" value: band: "{{ item.band | default(wifi_device[item.template].band) | default() }}" channel: "{{ item.channel | default(wifi_device[item.template].channel) }}"