I have Ansible output from a task which is registered to task_output.
"ansible_loop_var": "item",
"changed": false,
"files": [
{
"path": "file/path",
}
I tried to captured the path but none of there are working
"{{ task_output.files | map(attribute='path') }}"
"{{ task_output[0].files[0] | map(attribute='path') }}"
"{{ task_output[0].files | map(attribute='path') }}"
"{{ task_output.files[0] | map(attribute='path') }}"
"{{ task_output.json.files | map(attribute='path') }}"
"{{ task_output | map(attribute='path') }}"
task_output.files[0].pathortask_output.files.0.path, even.map, you need a list, but by getting the element0, you don't have a list anymore, instead, you have a dictionary.files": [ { "path": "file/path", }does not looks valid to me.