If role A depends on role B and you want to override the default var of 
role B by role A, you can define this var in vars/main.yml of role A. I use 
this solution in ansible 2.0.2.0. 


On Friday, April 29, 2016 at 9:42:54 PM UTC+8, Asif Nataliya wrote:
>
> Exactly the same problem I am also facing. Could you please share that how 
> did you resolve this issue?
>
> On Tuesday, January 19, 2016 at 10:12:34 AM UTC+5:30, [email protected] 
> wrote:
>>
>> Actually, I did test by setting the var of role B in vars folder of role 
>> A. Role A defines role B in meta. Override is failed. Role B would be 
>> executed before role A. So role A cannot override any vars of role B. If I 
>> want override vars of role B, I must set vars in playbook or inventory, 
>> right?
>> So I suppose "anywhere" except in the defaults of another role you said 
>> is not really exact. 
>>
>> On Tuesday, January 19, 2016 at 9:31:45 AM UTC+8, Brian Coca wrote:
>>>
>>> In 2.0 we defined this behavior (it was undefined and changed in 
>>> previous versions), roles will prefer their own defaults, you can 
>>> override these by setting the var anywhere else except in the defaults 
>>> of another role. 
>>>
>>>
>>>
>>> -- 
>>> Brian Coca 
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cff8a371-96c7-48d3-856d-a7cfc472cda2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to