From 29e103a1769bb7f9d9ee6143541ea3b32dae3481 Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Sun, 18 Dec 2022 15:19:22 -0500 Subject: [PATCH] feat: netconfig: Allow wifi-iface(s) to remain without ifname There are certain situations we do not want to set the ifname on a wifi-ifae, e.g. when navigating bugs related to hard-setting the `ifname` as we see on DBDC-capable mt76 devices. Change our wifi-iface setup so that we do not search for devices by ifname, but instead, by section name (e.g. `labb5` in `config wifi-iface 'labb5'`). Also, add an `force_ifnameless` variable to our wifi-iface YAML so that we can optionally force-empty the ifname field in settings where we would like to do so. By default (with `force_ifnameless` unset or false), we will use the same value for the `ifname` option and for the section name. Impacts - You will need to migrate manually by naming your wifi-iface sections --- roles/netconfig/tasks/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/roles/netconfig/tasks/main.yml b/roles/netconfig/tasks/main.yml index c789eac..e80f5a9 100644 --- a/roles/netconfig/tasks/main.yml +++ b/roles/netconfig/tasks/main.yml @@ -52,10 +52,9 @@ command: section config: wireless type: wifi-iface - find: - ifname: "{{ item.ifname | default(wifi_iface[item.template].ifname) | default('') }}" + name: "{{ item.ifname | default(wifi_iface[item.template].ifname) | default('') }}" value: - ifname: "{{ item.ifname | default(wifi_iface[item.template].ifname) | default('') }}" + ifname: "{{ item.ifname | default(wifi_iface[item.template].ifname) | default('') if not item.force_ifnameless | default(false) }}" mode: "{{ item.mode | default(wifi_iface[item.template].mode) }}" device: "{{ item.device | default(wifi_iface[item.template].device) }}" network: "{{ item.network | default(wifi_iface[item.template].network) }}"