diff --git a/ansible/roles/wipe-disks/tasks/main.yml b/ansible/roles/wipe-disks/tasks/main.yml index cad98fc7c..b44095f95 100644 --- a/ansible/roles/wipe-disks/tasks/main.yml +++ b/ansible/roles/wipe-disks/tasks/main.yml @@ -15,9 +15,9 @@ - name: Check for unmounted block devices shell: > lsblk -i -o NAME,MOUNTPOINT | awk \ - '/^ *[|`]-/ && NF > 1 { mounts[master_dev] = mounts[master_dev] $2 " " } - /^sd/ && NF == 1 { master_dev = $1; mounts[master_dev] = "" } - END { for (dev in mounts) if (mounts[dev] == "") print dev }' + '/^ *[|`]-/ && NF > 1 { mounts[master_dev] = mounts[master_dev] $2 " " } + /^(nvme|sd)/ && NF == 1 { master_dev = $1; mounts[master_dev] = "" } + END { for (dev in mounts) if (mounts[dev] == "") print dev }' register: unmounted_devices changed_when: False