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.