|
32 | 32 | # The 6 GHz network uses WPA3-SAE (mandatory on 6 GHz). We render a NetworkManager |
33 | 33 | # keyfile (0600, root) instead of `nmcli ... psk=...` so the passphrase never |
34 | 34 | # appears on a command line or in playbook output. A higher autoconnect priority |
35 | | -# than the imager-provisioned connection makes the robot prefer 6E when available |
36 | | -# and fall back to the existing network if 6 GHz is ever unreachable. |
| 35 | +# than the imager-provisioned connection makes the robot prefer 6E on the AX210. |
| 36 | +# The imager WiFi 5 connection is separately pinned to the built-in radio (see the |
| 37 | +# next task) so it can never autoconnect on the tri-band AX210 and hijack the 6E |
| 38 | +# interface; the robot still falls back to WiFi 5 on the built-in card when 6 GHz |
| 39 | +# is unreachable. |
37 | 40 | - name: Install the WiFi 6E (WPA3-SAE) NetworkManager connection |
38 | 41 | become: true |
39 | 42 | become_method: ansible.builtin.sudo |
|
47 | 50 | tags: |
48 | 51 | - setup_wifi_6e |
49 | 52 |
|
| 53 | +# The imager-provisioned WiFi 5 connection has no interface binding, so it can |
| 54 | +# autoconnect on the tri-band AX210 (tbotswifi6) and hijack the 6E radio whenever |
| 55 | +# the 6 GHz network is momentarily unavailable, leaving tbotswifi6 associated to |
| 56 | +# the WiFi 5 SSID. Pin every non-mezz WiFi connection to the built-in WiFi 5 radio |
| 57 | +# (tbotswifi5) so the AX210 stays exclusively on the 6E network and WiFi 5 only |
| 58 | +# ever runs on the built-in card. (Connection names containing ':' are not handled |
| 59 | +# - none of ours do.) |
| 60 | +- name: Pin the WiFi 5 connection(s) to the tbotswifi5 interface |
| 61 | + become: true |
| 62 | + become_method: ansible.builtin.sudo |
| 63 | + ansible.builtin.shell: |
| 64 | + executable: /bin/bash |
| 65 | + cmd: | |
| 66 | + set -euo pipefail |
| 67 | + changed=0 |
| 68 | + wifi_conns="$(nmcli -t -f NAME,TYPE connection show \ |
| 69 | + | awk -F: '$2 == "802-11-wireless" { print $1 }')" |
| 70 | + while IFS= read -r name; do |
| 71 | + if [ -z "$name" ] || [ "$name" = "{{ wifi_6e_ssid }}" ]; then |
| 72 | + continue |
| 73 | + fi |
| 74 | + current="$(nmcli -g connection.interface-name connection show "$name" || true)" |
| 75 | + if [ "$current" != "tbotswifi5" ]; then |
| 76 | + nmcli connection modify "$name" connection.interface-name tbotswifi5 |
| 77 | + changed=1 |
| 78 | + fi |
| 79 | + done <<< "$wifi_conns" |
| 80 | + if [ "$changed" -eq 1 ]; then |
| 81 | + echo CHANGED |
| 82 | + fi |
| 83 | + register: wifi5_pin |
| 84 | + changed_when: "'CHANGED' in wifi5_pin.stdout" |
| 85 | + tags: |
| 86 | + - setup_wifi_6e |
| 87 | + |
50 | 88 | - name: Reload NetworkManager connections |
51 | 89 | become: true |
52 | 90 | become_method: ansible.builtin.sudo |
53 | 91 | ansible.builtin.command: nmcli connection reload |
54 | | - when: wifi_6e_conn is changed |
| 92 | + when: wifi_6e_conn is changed or wifi5_pin is changed |
55 | 93 | changed_when: false |
56 | 94 | tags: |
57 | 95 | - setup_wifi_6e |
0 commit comments