feat: wifi_device: Make band vs hwmode configurable

As per openwrt.org[1], the `band` configurable was introduced in
OpenWrt 21.02.2, replacing `hwmode`.

To handle the pre-21.02.2 nodes to which we're deploying, allow us to
configure either of the two (but defaulting hwmode to null).

[1]: https://openwrt.org/docs/guide-user/network/wifi/basic
This commit is contained in:
Martin Kennedy 2022-07-26 15:35:47 -04:00
parent df2c87b5fc
commit 6592260901

View File

@ -42,10 +42,11 @@
find_by:
path: "{{ item.path }}"
value:
band: "{{ item.band | default(wifi_device[item.template].band) }}"
band: "{{ item.band | default(wifi_device[item.template].band) | default() }}"
channel: "{{ item.channel | default(wifi_device[item.template].channel) }}"
country: "{{ item.country | default(wifi_device[item.template].country) }}"
disabled: "{{ item.disabled | default(wifi_device[item.template].disabled) }}"
hwmode: "{{ item.hwmode | default(wifi_device[item.template].hwmode) | default() }}"
htmode: "{{ item.htmode | default(wifi_device[item.template].htmode) }}"
loop: "{{ wireless['wifi_device'] }}"