I am trying to loop thru facter_disks to find disk with a particular size. In the below code would like to get disk sdb with size of 30 . Any help is greatly appreciated
---
- name: sample Playbook
hosts: localhost
gather_facts: false
become: yes
vars:
disks:
- sda:
model: SYMMETRIX
size: 55.00 GiB
size_bytes: 59057111040
vendor: EMC
sdb:
model: SYMMETRIX
size: 35.00 GiB
size_bytes: 37581619200
vendor: EMC
sdc:
model: SYMMETRIX
size: 20.00 GiB
size_bytes: 21475491840
vendor: EMC
tasks:
- debug:
msg:
# - "{{ disks[0]['sda']['size'] }}"
- "{{ item['sda']['size'] }}"
with_items: " {{disks}} "