# struggling with include files

**URL:** <https://forum.ansible.com/t/struggling-with-include-files/21295>\
**Category:** Ansible Developer\
**Created:** [April 28, 2016, 10:09am UTC](https://forum.ansible.com/t/struggling-with-include-files/21295 "2016-04-28T10:09:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Davies1](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@Paul\_Davies1](https://forum.ansible.com/u/Paul_Davies1)\
**Post date:** [April 28, 2016, 10:09am UTC](https://forum.ansible.com/t/struggling-with-include-files/21295/1 "2016-04-28T10:09:21Z")

</div>

I am seriously struggling with trying to include yml files in my top level play

I have prereqcheck.yml in which I want to set the host for the rest of the included files to use

---

<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:** [April 28, 2016, 12:02pm UTC](https://forum.ansible.com/t/struggling-with-include-files/21295/2 "2016-04-28T12:02:28Z")

</div>

Might be better asking this one on ansible-project.

Not looked in any detail but just wondering if you meant to use ‘include\_vars’ (loads vars from a file) or actually include (pulls tasks into a play from a file).

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Paul\_Davies1](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@Paul\_Davies1](https://forum.ansible.com/u/Paul_Davies1)\
**Post date:** [April 28, 2016, 12:09pm UTC](https://forum.ansible.com/t/struggling-with-include-files/21295/3 "2016-04-28T12:09:40Z")

</div>

Hi. It is the latter. The 2 forums seem to be very similar but I will try on the other. Thanks
