# copy src lookup

**URL:** <https://forum.ansible.com/t/copy-src-lookup/24463>\
**Category:** Ansible Project\
**Created:** [May 11, 2017, 3:00pm UTC](https://forum.ansible.com/t/copy-src-lookup/24463 "2017-05-11T15:00:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [May 11, 2017, 3:00pm UTC](https://forum.ansible.com/t/copy-src-lookup/24463/1 "2017-05-11T15:00:57Z")

</div>

HI!

Is it possible to lookup the pathname of a local file on the ansible controller used in a  
copy task for src: \*before\* performing the copy task?

Ciao, Michael.

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [May 12, 2017, 4:18pm UTC](https://forum.ansible.com/t/copy-src-lookup/24463/2 "2017-05-12T16:18:49Z")

</div>

Probably several ways of doing this - lookup plugin, conditional include\_var come to mind. Plus you can use shell or command module, delegated to localhost and perhaps use set\_fact to set the path name to use as src.

What are you trying to achieve? It might help to understand the problem you are trying to solve.
