# using with\_first\_found in a with\_items loop?

**URL:** <https://forum.ansible.com/t/using-with-first-found-in-a-with-items-loop/14860>\
**Category:** Ansible Project\
**Created:** [March 26, 2014, 5:09am UTC](https://forum.ansible.com/t/using-with-first-found-in-a-with-items-loop/14860 "2014-03-26T05:09:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brice\_Burgess](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brice\_Burgess](https://forum.ansible.com/u/Brice_Burgess)\
**Post date:** [March 26, 2014, 5:09am UTC](https://forum.ansible.com/t/using-with-first-found-in-a-with-items-loop/14860/1 "2014-03-26T05:09:02Z")

</div>

Is it possible to use with\_first\_found in a with\_items loop? Such as;

```auto
- template:
dest=/foo/{{ item.name }}-{{ item.branch | default('master') }}
src={{ item }}
with_first_found:
- {{ item.name }}-{{ item.branch | default('master') }}
- {{ item.name }}.j2
- apache_site.j2
with_items: apache_sites

```

Can’t seem to make it work using with\_nested

Many thanks!
