I've run into a snag and feel like an idiot because I can't seem to figure 
it out. you can filter through complex data by doing {{ var.sub.data }} 
this works great but what about when that data has it's own array? A 
perfect example would be something like eth0 data.

        "ipv4": {
            "address": "192.168.1.50",
            "broadcast": "192.168.1.255",
            "netmask": "255.255.255.0",
            "network": "192.168.1.0"
        },
        "ipv6": [
            {
                "address": "fe80::XXXX:XXXX:XXXX:94f7",
                "prefix": "64",
                "scope": "link"
            }
        ],

If we do {{ ansible_eth0.ipv4.address }} we get back the correct 
192.168.1.50. What if we do {{ ansible_eth0.ipv6.address }}? We get an 
error. Any data that has an array that is in another array can't seem to be 
filtered out by standard filtering rules.

I am well aware I can use other variables to get this data they are just 
examples. Here comes the big question. *How can we filter to sub-arrays 
like that? where we could get just the prefix or just the address?*

Thanks in advance.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1af03b4b-2e7a-4a51-9b88-01ca308da1bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to