I'm look for an simple way to create a list keys of a dictionary as one does in Python with the keys method but it seems this doesn't exist in Ansible. For example, below is the output of the setup module on a host.
"ansible_lvm": {
...
"pvs": {
"/dev/sda2": {
"free_g": "0",
"size_g": "8.81",
"vg": "rhel"
},
"/dev/sdb1": {
"free_g": "1.50",
"size_g": "3.00",
"vg": "bob"
}
},
The result I would like to achieve is to have the devices, dev/sda1 ..., in a list so that I can easily test to see if a device in the list of pvs or other operations on the list of keys. I know there are workarounds for about every case I have come up with but I feel like I'm missing something since it seems like something rather fundamental.