variable scope groups_vars overwrides host_vars?

Hi all,

I have read the http://docs.ansible.com/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable it does nto answer my question.

Basically I saw two unexpected (at least common sense speaking) behaviour.

example in my inventory hosts file

[base]
jibs

[base:vars]
DNS_SERVER=172.17.42.1

[jibs]
test-jibs ansible_ssh_host=192.168.0.100 ansible_ssh_user=root

[jibs:vars]
XX=VALUE

  1. The host test-jibs in jibs groups does not inherit the base:vars

  2. If I have a file named test-jibs in the directory host_vars these variable is not used when the section [jibs:vars] has the same variable name - which is group_vars has more priority than host_vars.

Is it correct behaviour or am I wrong somewhere in my setup.

Kind regards

I think you want

[base:groups]
jibs

as for the var priority, host_vars should trump group vars, if that is
not the case it is a bug.

I just tested with 1.7.2 and current devel and this works as expected.

what versions are you running? (ansible, python, OS)

that was meant to be:

[base:children]
jibs

ansible 1.5.4 on ubuntuy 14.04

Thanks - I will try

Looks like a bug in the version 1.5.2 on Ubuntu. I upgrade it to 1.7.2 and the host vars is correct now.

I also use [base:children] syntax and it seems all good.

Thanks all for suggestions.

Kind regards