Hello,

I have a command running a loop through with items and I get a registered 
result like the following structure:

{
    "changed": false,
    "msg": "All items completed",
    "results": [
        {
            "machines": [
                {
                    "ip": "127.0.0.1",
                    "name": "machine1"
                },
                {
                    "ip": "127.0.0.1",
                    "name": "machine2"
                }
            ]
        },
        {
            "machines": [
                {
                    "ip": "127.0.0.1",
                    "name": "machine3"
                },
                {
                    "ip": "127.0.0.1",
                    "name": "machine4"
                }
            ]
        }
    ]
}



I wanted to extract a list of machines.name out of it so I used the 
following filter:

map(attribute="machines.name") 

And I got a list of Undefined as an output:
<https://lh3.googleusercontent.com/-5BrIwPLx8lc/WNJL1XEU-nI/AAAAAAAAJQA/4MPcLLSvzywvqPlQtZqORgq84rYX_uqrQCLcB/s1600/Selection_133.jpg>
"[Undefined, Undefined]": "[Undefined, Undefined]"


How can I correctly extract a list of machine names out of that data 
structure?

-- 
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/d5f34f32-d5a8-4853-8ba0-f241fbdef3fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to