# ERROR! included task files must contain a list of tasks

**URL:** <https://forum.ansible.com/t/error-included-task-files-must-contain-a-list-of-tasks/36705>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [June 9, 2022, 7:25am UTC](https://forum.ansible.com/t/error-included-task-files-must-contain-a-list-of-tasks/36705 "2022-06-09T07:25:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yanga\_Zukelwa](https://avatars.discourse-cdn.com/v4/letter/y/59ef9b/32.png) [@Yanga\_Zukelwa](https://forum.ansible.com/u/Yanga_Zukelwa)\
**Post date:** [June 9, 2022, 7:25am UTC](https://forum.ansible.com/t/error-included-task-files-must-contain-a-list-of-tasks/36705/1 "2022-06-09T07:25:50Z")

</div>

Morning -

I’m currently running a test on the suing variable with the file. I’ve made my set-up for the playbook using _galaxy-init_

_Can someone help explain the error below?_

ERROR! included task files must contain a list of tasks

_The error appears to be in ‘/etc/ansible/roles/cassandra\_version\_upgrade\_dev/tasks/test.yml’: line 2, column 1, but may_  
_be elsewhere in the file depending on the exact syntax problem._

_The offending line appears to be:_

---

<div class="post-metadata">

**Author:** ![Nipun\_Jain](https://avatars.discourse-cdn.com/v4/letter/n/5f9b8f/32.png) [@Nipun\_Jain](https://forum.ansible.com/u/Nipun_Jain)\
**Post date:** [June 9, 2022, 8:12am UTC](https://forum.ansible.com/t/error-included-task-files-must-contain-a-list-of-tasks/36705/2 "2022-06-09T08:12:43Z")

</div>

Hi Yangaz,  
in second line of your playbook its shd be bracket like this “/var/main.yml”  
For your reference pls check this out :- [https://stackoverflow.com/questions/36620963/dynamic-file-name-in-vars-files](https://stackoverflow.com/questions/36620963/dynamic-file-name-in-vars-files)

if its error then i wish i could learn about ansible variables and i could help u.

---

<div class="post-metadata">

**Author:** ![Melvin\_Satheesan](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@Melvin\_Satheesan](https://forum.ansible.com/u/Melvin_Satheesan)\
**Post date:** [June 10, 2022, 3:16pm UTC](https://forum.ansible.com/t/error-included-task-files-must-contain-a-list-of-tasks/36705/3 "2022-06-10T15:16:26Z")

</div>

I think the variable declaration is causing this issue. For a role, you may use, ‘include\_vars’ module and declare the same like,

tasks:

- name:  
include\_vars:  
file: ‹path›

Try this.
