# vars\_files, include\_vars don't work with role vars

**URL:** <https://forum.ansible.com/t/vars-files-include-vars-dont-work-with-role-vars/25873>\
**Category:** Ansible Project\
**Created:** [October 31, 2017, 10:33am UTC](https://forum.ansible.com/t/vars-files-include-vars-dont-work-with-role-vars/25873 "2017-10-31T10:33:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![1.61803](https://avatars.discourse-cdn.com/v4/letter/1/e79b87/32.png) [@1.61803](https://forum.ansible.com/u/1.61803)\
**Post date:** [October 31, 2017, 10:33am UTC](https://forum.ansible.com/t/vars-files-include-vars-dont-work-with-role-vars/25873/1 "2017-10-31T10:33:58Z")

</div>

I want to separate vars in a role structure from **vars/main.yml** into different files using **vars\_files** or **include\_vars** as per [Variable File Separation](http://docs.ansible.com/ansible/latest/playbooks_variables.html#variable-file-separation), with something like

`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 31, 2017, 3:04pm UTC](https://forum.ansible.com/t/vars-files-include-vars-dont-work-with-role-vars/25873/2 "2017-10-31T15:04:00Z")

</div>

The vars/main.yml cannot contain keywords, it (like all vars files)  
MUST be a dictionary, not a list.

There is no way to do 'includes' inside a vars file. What you are  
doing is just not supported.

---

<div class="post-metadata">

**Author:** ![1.61803](https://avatars.discourse-cdn.com/v4/letter/1/e79b87/32.png) [@1.61803](https://forum.ansible.com/u/1.61803)\
**Post date:** [October 31, 2017, 3:50pm UTC](https://forum.ansible.com/t/vars-files-include-vars-dont-work-with-role-vars/25873/3 "2017-10-31T15:50:21Z")

</div>

Since you triaged [#32328](https://github.com/ansible/ansible/issues/32328), could you turn it into a feature request? Role vars separation would be a useful addition.
