# Display path of return variable of module find

**URL:** <https://forum.ansible.com/t/display-path-of-return-variable-of-module-find/35033>\
**Category:** Ansible Project\
**Created:** [April 22, 2021, 8:31am UTC](https://forum.ansible.com/t/display-path-of-return-variable-of-module-find/35033 "2021-04-22T08:31:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcoussi](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mcoussi/32/8056_2.png) [@mcoussi](https://forum.ansible.com/u/mcoussi)\
**Post date:** [April 22, 2021, 8:31am UTC](https://forum.ansible.com/t/display-path-of-return-variable-of-module-find/35033/1 "2021-04-22T08:31:05Z")

</div>

Hi,

I want to get into a variable the list of file present in a directory.

- name: Affichage du contenu de chaque Oracle\_Home sqlNet  
find:  
paths: “{{ item.item }}/network/admin”  
register: tmp\_oracle\_sqlnet\_content  
with\_items: “{{ tmp\_oracle\_sqlnet\_dir.results }}”  
when: item.stat.exists

I get the list into tmp\_oracle\_sqlnet\_content variable.

Here the results :  
{  
“msg”: {  
“results”: [  
{  
“files”: [  
{  
“uid”: 500,  
“woth”: false,  
“mtime”: 1355715796,  
“inode”: 134880,  
“isgid”: false,  
“size”: 381,  
“roth”: true,  
“isuid”: false,  
“isreg”: true,  
“pw\_name”: “oracle”,  
“gid”: 500,  
“ischr”: false,  
“wusr”: true,  
“xoth”: false,  
“rusr”: true,  
“nlink”: 1,  
“issock”: false,  
“rgrp”: true,  
“gr\_name”: “oinstall”,  
“path”: “/soft/oracle/product/11.2/client/network/admin/shrept.lst”,

Now i tried to list the file in a debug message.

- debug:  
msg: “{{ item.path }}”  
with\_items: “{{ tmp\_oracle\_sqlnet\_content.files }}”

Ansible say that thisvariable has no files attributs :  
{  
“msg”: “‘dict object’ has no attribute ‘files’”,  
“\_ansible\_no\_log”: false  
}

Can you help me please?

Thanks for you help,

Matt

---

<div class="post-metadata">

**Author:** ![mcoussi](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mcoussi/32/8056_2.png) [@mcoussi](https://forum.ansible.com/u/mcoussi)\
**Post date:** [April 22, 2021, 1:56pm UTC](https://forum.ansible.com/t/display-path-of-return-variable-of-module-find/35033/2 "2021-04-22T13:56:34Z")

</div>

Hi,

When i try this it works :

- name: Recuperation du contenu de /tmp  
find:  
paths: “/tmp”  
register: tmp\_directory\_content

- debug:  
msg: “{{ item.path }}”  
with\_items: “{{ tmp\_directory\_content.files }}”

I don’t understand what’s the difference with this : ?

- name: Affichage du contenu de chaque Oracle\_Home sqlNet  
find:  
paths: “{{ item.item }}/network/admin”  
register: tmp\_oracle\_sqlnet\_content  
with\_items: “{{ tmp\_oracle\_sqlnet\_dir.results }}”  
when: item.stat.exists

- debug:  
msg: “{{ item.path }}”  
with\_items: “{{ tmp\_oracle\_sqlnet\_content.files }}”

Thanks for your help,

Matt
