hallo,

i have a  nested json file like :
{
        "fw1": {
                "ipv4": {
                        "rtr": {
                                "ip": "1.2.3.4",
                                "net": "1.2.3.4",
                             
                        }
                }
        },
        "fw2": {
                "ipv4": {
                        "rtr": {
                                "ip": "4.3.2.1",
                                "net": "4.3.2.1",
                                
                        }
                }
        }
}


How could i parse in this case only the "ip" value of "fw2" ?
for a non nested json dictionary this phrase has worked for me

{{ (lookup('file', '/etc/foo.txt') | from_json).get('ip') }}.


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/99e9662b-8ff6-47bf-970a-fb57559a4ef5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to