diff --git a/roles/1-prep/tasks/internal-wifi.yml b/roles/1-prep/tasks/internal-wifi.yml index 24422d36b..2751dfd13 100644 --- a/roles/1-prep/tasks/internal-wifi.yml +++ b/roles/1-prep/tasks/internal-wifi.yml @@ -1,5 +1,5 @@ - name: Look for any wireless devices present - shell: "ls -la /sys/class/net/*/phy80211 | cut -d/ -f5" + shell: ls -la /sys/class/net/*/phy80211 | cut -d/ -f5 register: has_wifi_device ignore_errors: True changed_when: False @@ -7,9 +7,7 @@ - name: Set internal_wifi, if found set_fact: internal_wifi: True - when: has_wifi_device.stdout is defined and item|trim != "" - with_items: - - "{{ has_wifi_device.stdout_lines }}" + when: has_wifi_device is defined and has_wifi_device.stdout | trim != "" # 2021-07-27 explanation from @jvonau: The 3 BELOW (iw, rfkill, wireless-tools) # are provided by RasPiOS. Ubuntu|Debian on the other hand are hit or miss: