I have the following output from a variable called directories. It was created using a loop that would run stat against two different paths. What is the proper way to reference the “stat: exists: boolean” sections of the output? I need to check for both directories for both item.paths. I have tried and tried, but I must be doing something wrong.
"directories.results": [ { "_ansible_ignore_errors": null, "_ansible_item_result": true, "_ansible_no_log": false, "_ansible_parsed": true, "changed": false, "failed": false, "invocation": { "module_args": { "checksum_algorithm": "sha1", "follow": false, "get_attributes": true, "get_checksum": true, "get_md5": true, "get_mime": true, "path": "/home/applmgr/Scripts" } }, **"item": {** **"path": "/home/applmgr/Scripts"** }, "stat": { "atime": 1519330068.2478893, "attr_flags": "e", "attributes": [ "extents" ], ......lots of stuff **"exists": true,**
…lots of stuff`
}
},
{
“_ansible_ignore_errors”: null,
“_ansible_item_result”: true,
“_ansible_no_log”: false,
“_ansible_parsed”: true,
“changed”: false,
“failed”: false,
“invocation”: {
“module_args”: {
“checksum_algorithm”: “sha1”,
“follow”: false,
“get_attributes”: true,
“get_checksum”: true,
“get_md5”: true,
“get_mime”: true,
“path”: “/home/oracle/Scripts”
}
},
“item”: {
“path”: “/home/oracle/Scripts”
},
“stat”: {
“exists”: false
}
}
]
}
`