# Tasks in a task file that should not have been included are being listed

**URL:** <https://forum.ansible.com/t/tasks-in-a-task-file-that-should-not-have-been-included-are-being-listed/31607>\
**Category:** Ansible Project\
**Created:** [November 6, 2019, 10:56am UTC](https://forum.ansible.com/t/tasks-in-a-task-file-that-should-not-have-been-included-are-being-listed/31607 "2019-11-06T10:56:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [November 6, 2019, 10:56am UTC](https://forum.ansible.com/t/tasks-in-a-task-file-that-should-not-have-been-included-are-being-listed/31607/1 "2019-11-06T10:56:46Z")

</div>

My roles/test/tasks/main.yml file looks like this:

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [November 6, 2019, 11:56am UTC](https://forum.ansible.com/t/tasks-in-a-task-file-that-should-not-have-been-included-are-being-listed/31607/2 "2019-11-06T11:56:27Z")

</div>

Use \*include\_tasks\* instead of \*include\*.

Quoting:"Prior to Ansible 2.4, only include was available and it behaved  
differently depending on context". See "Including and Importing"  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_reuse\_includes.html#including-and-importing](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_includes.html#including-and-importing)

Cheers,

&nbsp;&nbsp;-vlado
