accessing nested facts

i have to follwing fact structure…how to access the “size_available” stuff from the opt filesystem?

i tried this but it looks dorky…

- name: check free space on /opt
  aix_filesystem:
                filesystem: /opt
                size: +1G 
                state: present
  when: ansible_facts["mounts"]["mount"] == "/opt" and
        ansible_facts["mounts"]["size_available"] < 1073741824 

there should be a "one line" solution imho.

“mounts”: [

{

“device”: “/dev/hd4”,

“fstype”: “jfs2”,

“mount”: “/opt”,

“options”: “rw,log=/dev/hd8”,

“size_available”: 92508160,

“size_total”: 134217728,

“time”: “May 05 14:39”

}

];

Your mount is a list so you need to specify the element 0 for them both

ansible_facts["mounts"][0]["mount"]
ansible_facts["mounts"][0]["size_available"]