We need to delete stray networks, wifi_iface(s), etc. when we set up wireless #5

Closed
opened 2022-12-11 16:06:54 -05:00 by hurricos · 2 comments
Owner

For example, OpenWrt gives us some default wireless networks which we do not want, but which are enabled by default and only restriced by the initial disablement of the radios (which is reversed when we add them).

One way to fix this would be to set the names of all of these sensitive objects (ready now, thanks to 4be4747f96), and as a final step, delete all objects that are not in the list of known names. This (thankfully) protects us from renames.

For example, OpenWrt gives us some default wireless networks which we do not want, but which are enabled by default and only restriced by the initial disablement of the radios (which is reversed when we add them). One way to fix this would be to set the names of all of these sensitive objects (ready now, thanks to 4be4747f960e272630c66c9200af0a418fee70ea), and as a final step, delete all objects that are not in the list of known names. This (thankfully) protects us from renames.
Author
Owner

A simpler fix: just delete default_radio0 and default_radio1, for now.

A simpler fix: just delete `default_radio0` and `default_radio1`, for now.
Author
Owner

Turns out commit 074dba4453 doesn't work:


modified   roles/netconfig/tasks/main.yml
@@ -29,6 +29,16 @@
     key: network
   notify: restart network
 
+- name: Tear down the default wifi-iface(s)
+  uci:
+    config: wireless
+    command: absent
+    type: wifi-iface
+    name: "{{ item }}"
+  loop:
+    - default_radio0
+    - default_radio1
+
 - name: Setup wireless devices (radios)
   uci:
     command: section

This works, though.

Turns out commit 074dba44531b7d27fe1e71ad2972686017b2d916 doesn't work: ```diff modified roles/netconfig/tasks/main.yml @@ -29,6 +29,16 @@ key: network notify: restart network +- name: Tear down the default wifi-iface(s) + uci: + config: wireless + command: absent + type: wifi-iface + name: "{{ item }}" + loop: + - default_radio0 + - default_radio1 + - name: Setup wireless devices (radios) uci: command: section ``` [This](https://github.com/gekmihesg/ansible-openwrt/issues/41#issuecomment-1006476695) works, though.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hurricos/ansible-labb-wifi#5