Variables precedence in dependencies

24 views
Skip to first unread message

Federico Alaimo

unread,
Sep 13, 2016, 1:00:46 PM9/13/16
to Ansible Project
Hello, I have a doubt regarding variables precedence:
I sometimes have the case where role B depends on role A with role A needing a specific variable value. 
So in the dependencies file for role B I have something like:

dependencies:
  - { role: role-A, role_a_var1: value1 }

But I'm not sure where this var declaration stands in the precedence list for ansible 2.0+. I'd like this to be stronger than site variables for instance, but less strong than inventory (group and host) variables.
By the way for site variables I mean variables defined somewhere and included at some point  in the playbook calling the role, with an include_vars (so playbook level, actually?)

Thanks!

Kai Stian Olstad

unread,
Sep 14, 2016, 9:05:09 AM9/14/16
to ansible...@googlegroups.com
On 12. sep. 2016 11:37, Federico Alaimo wrote:
> Hello, I have a doubt regarding variables precedence:

Have you looked at this site, maybe that answer you question
https://docs.ansible.com/ansible/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages