A few things to note here.

4-10 are all talking about host related vars.  It's just that group_vars
and host_vars can live at 2 locations:

1. relative to the inventory file
2. relative to the playbook file

It is assumed that if you put host_vars and group_vars relative to the
playbook, that they are more specific to that playbook, as such they
override host_vars and groups_vars that are relative to the inventory file.



On Sat, Oct 19, 2019 at 1:52 AM Stanislav German-Evtushenko <
[email protected]> wrote:

>
>
>> I agree that it's not intuitive... It's also backwards from what I would
>> expect.
>>
>> You can override the precedence order locally:
>> https://docs.ansible.com/ansible/latest/reference_appendices/config.html#variable-precedence
>>
>> I choose not to do that, and instead forgo separating inventory from
>> playbook group_vars.
>>
>> I, too, would be interested in an explanation of why the order is what it
>> is.  I've been bitten by it in the past.
>>
>>
> Ansible is supposed to be simple and overriding precedence would make it a
> way more complicated. Changing the default behaviour (with an option for
> backwards compatibility) would make it more logical. Any devs here?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/189f4180-9837-43a2-b8cf-57eec9ed61bf%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/189f4180-9837-43a2-b8cf-57eec9ed61bf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v_t%2BQ6knr0rOWxc5DE84qdPh1aULHF%3DnPgXPBALrGcEGQ%40mail.gmail.com.

Reply via email to