# Capture the path from the list returned via find module

**URL:** <https://forum.ansible.com/t/capture-the-path-from-the-list-returned-via-find-module/27374>\
**Category:** Ansible Project\
**Created:** [April 25, 2018, 4:09pm UTC](https://forum.ansible.com/t/capture-the-path-from-the-list-returned-via-find-module/27374 "2018-04-25T16:09:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saranya\_N](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Saranya\_N](https://forum.ansible.com/u/Saranya_N)\
**Post date:** [April 25, 2018, 4:09pm UTC](https://forum.ansible.com/t/capture-the-path-from-the-list-returned-via-find-module/27374/1 "2018-04-25T16:09:37Z")

</div>

Hi all ,

I'm trying to find two XML files in all the locations only if it contains a severname and then pass the list of these files to the replace module to replace that severname by another string.

I'm able to get the file list via shell module but not via the find module.

I tried various options that I found online

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [April 25, 2018, 11:05pm UTC](https://forum.ansible.com/t/capture-the-path-from-the-list-returned-via-find-module/27374/2 "2018-04-25T23:05:15Z")

</div>

Not sure if it will make a difference, but you have a space after “servername” in your contains: line.

---

<div class="post-metadata">

**Author:** ![Saranya\_N](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Saranya\_N](https://forum.ansible.com/u/Saranya_N)\
**Post date:** [April 26, 2018, 2:50am UTC](https://forum.ansible.com/t/capture-the-path-from-the-list-returned-via-find-module/27374/3 "2018-04-26T02:50:28Z")

</div>

That space is a typo in my post
