Skip to content

Commit 18af02f

Browse files
committed
Fix task for when there are no NVMe drives
1 parent a8e8a01 commit 18af02f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

etc/kayobe/ansible/deployment/get-nvme-drives.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@
1717
- name: Retrieve NVMe device information via smartctl
1818
ansible.builtin.command: "smartctl -i -j {{ item }}"
1919
register: smartctl_info
20-
loop: "{{ nvme_devices }}"
20+
loop: "{{ nvme_devices | default([], true) }}"
2121
loop_control:
2222
label: "{{ item }}"
2323
changed_when: false
2424
become: true
25-
when: nvme_devices | length > 0
2625

2726
- name: Parse NVMe device model names
2827
ansible.builtin.set_fact:

0 commit comments

Comments
 (0)