Something like this will sort the keys and use the last one.
- debug: msg={{ansible_lvm.vgs[(ansible_lvm.vgs.keys()|sorted|list)[-1]]}}
Something like this will sort the keys and use the last one.
- debug: msg={{ansible_lvm.vgs[(ansible_lvm.vgs.keys()|sorted|list)[-1]]}}