# read multiarray with find module

**URL:** <https://forum.ansible.com/t/read-multiarray-with-find-module/31041>\
**Category:** Ansible Developer\
**Created:** [August 14, 2019, 7:33pm UTC](https://forum.ansible.com/t/read-multiarray-with-find-module/31041 "2019-08-14T19:33:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enzo](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@Enzo](https://forum.ansible.com/u/Enzo)\
**Post date:** [August 14, 2019, 7:33pm UTC](https://forum.ansible.com/t/read-multiarray-with-find-module/31041/1 "2019-08-14T19:33:09Z")

</div>

Hello all,

I’ve the follow case, have some directories that receive though list, by example:

Directories:

- /path/to/dir1
- /path/to/dir2
- /path/to/dir3

My objective is use **find** module to get the files with **.sh** extension of these directories and **set +x permission** s, when I register the find command, receive a output like this:

`  
“results”: [  
{  
“ansible\_loop\_var”: “item”,  
“changed”: false,  
“examined”: 2,  
“failed”: false,  
“files”: [  
{

…  
“path”: “/path/to/dir1/ficheros20.txt”,  
…  
},  
{

…  
“path”: “/path/to/dir1/ficheros20.txt”,  
…  
}  
],  
“invocation”: {  
“module\_args”: {  
“age”: null,  
“age\_stamp”: “mtime”,  
“contains”: null,  
“depth”: null,  
“excludes”: null,  
“file\_type”: “file”,  
“follow”: false,  
“get\_checksum”: false,  
“hidden”: false,  
“path”: “/path/to/dir1/”,  
“paths”: [  
“/path/to/dir1/”  
],  
“patterns”: [  
“\*”  
],  
“recurse”: false,  
“size”: null,  
“use\_regex”: false  
}  
},  
“item”: “/path/to/dir1/”,  
“matched”: 2,  
“msg”: “”  
},  
{  
“ansible\_loop\_var”: “item”,  
“changed”: false,  
“examined”: 2,  
“failed”: false,  
“files”: [  
{  
…  
“path”: “/path/to/dir2/ficheros20.txt”,  
…  
},  
{

…  
“path”: “/path/to/dir2/ficheros20.txt”,  
…  
}  
],  
“invocation”: {  
“module\_args”: {  
“age”: null,  
“age\_stamp”: “mtime”,  
“contains”: null,  
“depth”: null,  
“excludes”: null,  
“file\_type”: “file”,  
“follow”: false,  
“get\_checksum”: false,  
“hidden”: false,  
“path”: “/path/to/dir2/”,  
“paths”: [  
“/path/to/dir2/”  
],  
“patterns”: [  
“\*”  
],  
“recurse”: false,  
“size”: null,  
“use\_regex”: false  
}  
},  
“item”: “/path/to/dir2/”,  
“matched”: 2,  
“msg”: “”  
}  
]  
`

As see, the **files** is a tupple then for join to the first index I can use this variable:

item.files.0.path

But is possible that in order to the size of directory be more big, how can I join to all index using with\_items?

Thank you very much.  
Best regards
