How to pass group vars to role in playbook?

36 views
Skip to first unread message

Dan

unread,
Jun 1, 2015, 8:44:29 AM6/1/15
to ansible...@googlegroups.com
When test_var is defined inside the playbook it gets passed to the role correctly. However when it's defined in group_vars/all.yml Ansilbe won't find it (undefined) and exits with an error:

fatal: [vagrant] => failed to combine variables, expected dicts but got a 'dict' and a 'unicode'

The unicode parameter is actually (Undefined,).

------------------
# site.yml
vars:
  var_in_playbook: bar

roles:
  # this works
  - { role: test, my_role_var: "{{ var_in_playbook }}" }

  # this doesn't 
  - { role: test, my_role_var: "{{ var_in_group_vars }}" }
------------------

Is there any workaround to this issue?
Reply all
Reply to author
Forward
0 new messages