From 566bef36c8c5e1966b3f450ec979fd477c180497 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Mar 2022 19:45:29 -0400 Subject: [PATCH] 1-prep/tasks/internal-wifi.yml: Ansible code touch-ups --- roles/1-prep/tasks/internal-wifi.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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: