# "ERROR: expecting dict" when trying to define a dictionary in my vars file

**URL:** <https://forum.ansible.com/t/error-expecting-dict-when-trying-to-define-a-dictionary-in-my-vars-file/19729>\
**Category:** Ansible Project\
**Created:** [November 10, 2015, 7:33pm UTC](https://forum.ansible.com/t/error-expecting-dict-when-trying-to-define-a-dictionary-in-my-vars-file/19729 "2015-11-10T19:33:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavel\_Vaysberg](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pavel\_Vaysberg](https://forum.ansible.com/u/Pavel_Vaysberg)\
**Post date:** [November 10, 2015, 7:33pm UTC](https://forum.ansible.com/t/error-expecting-dict-when-trying-to-define-a-dictionary-in-my-vars-file/19729/1 "2015-11-10T19:33:20Z")

</div>

Sorry if this is a beginner question, but I am having trouble defining a dictionary of key value pairs in my vars file for one of my roles. My purpose for packaging these pairs instead of just setting them as variables is so that I can cycle through them in my templates. Here is my code:

`

# WebLogic Domain Templates

templates:  
jrf: “{{ common\_home }}/common/templates/applications/jrf\_template\_11.1.1.jar”  
em: “{{ common\_home }}/common/templates/applications/oracle.em\_11\_1\_1\_0\_0\_template.jar”  
wsm: “{{ common\_home }}/common/templates/applications/oracle.wsmpm\_template\_11.1.1.jar”  
jrf\_async: “{{ common\_home }}/common/templates/applications/oracle.jrf.ws.async\_template\_11.1.1.jar”  
opss: “{{ oim\_home }}/common/templates/applications/oracle.opss\_11.1.1.3.0\_template.jar”  
soa: “{{ soa\_home }}/common/templates/applications/oracle.soa\_template\_11.1.1.jar”  
oim: “{{ oim\_home }}/common/templates/applications/oracle.oim\_11.1.2.0.0\_template.jar”

# OIM Config

`

The error I get is:

`ERROR: expecting dict; got: templates, error in /dir/to/vars/file.yml`

---

<div class="post-metadata">

**Author:** ![Pavel\_Vaysberg](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pavel\_Vaysberg](https://forum.ansible.com/u/Pavel_Vaysberg)\
**Post date:** [November 10, 2015, 9:20pm UTC](https://forum.ansible.com/t/error-expecting-dict-when-trying-to-define-a-dictionary-in-my-vars-file/19729/2 "2015-11-10T21:20:37Z")

</div>

Nevermind, I figured it out.

The file that I was using to test the vars file was importing it using the “include” task, when I should have actually been using the include\_vars module. It tried to open my vars like a file of tasks and gave me this error.
