# with\_first\_found issue

**URL:** <https://forum.ansible.com/t/with-first-found-issue/20773>\
**Category:** Ansible Project\
**Created:** [March 4, 2016, 2:28pm UTC](https://forum.ansible.com/t/with-first-found-issue/20773 "2016-03-04T14:28:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Paraschiv](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Adrian\_Paraschiv](https://forum.ansible.com/u/Adrian_Paraschiv)\
**Post date:** [March 4, 2016, 2:28pm UTC](https://forum.ansible.com/t/with-first-found-issue/20773/1 "2016-03-04T14:28:22Z")

</div>

Hello all,

I have this part of a playbbok

```auto
- shell: echo "{{ ansible_env.CMS_PLI }}/conf/application.conf"
  register: pli_loc
- shell: echo "{{ ansible_env.CMS }}/conf/application.conf"
  register: cms_loc
- shell: "echo {{ item }}"
  with_first_found:
    - "{{ pli_loc.stdout }}"
    - "{{ cms_loc.stdout }}"
    - "{{ ansible_env.CMS_PLI }}/conf/application.conf"
    - /etc/passwd

```

First and second shell output are ok, the files exist, location is good, but the third shell outputs only /etc/passwd

I would like the third shell output to be one of {{ pli\_loc.stdout }} or {{ cms\_loc.stdout}}

Why doesn’t it find one of the first ones?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 4, 2016, 3:16pm UTC](https://forum.ansible.com/t/with-first-found-issue/20773/2 "2016-03-04T15:16:57Z")

</div>

lookups (stuff after with\_) execute always on the ‘master’ not on the target machine, so the files have to be accessible on that path on the machine that runs ansible.
