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

302 views
Skip to first unread message

Pavel Vaysberg

unread,
Nov 10, 2015, 2:34:44 PM11/10/15
to Ansible Project
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


Pavel Vaysberg

unread,
Nov 10, 2015, 4:20:37 PM11/10/15
to Ansible Project
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.
Reply all
Reply to author
Forward
0 new messages