Hi
I'm trying to change the order in which our group_vars are loaded with
ansible_group_priority but it's not working.
I have a role at roles/mytest/tasks/main.yaml like this:
_______________
- debug: var="myvar"
_______________
Then I have two group_vars files, one called
inventory/group_vars/cluster_1.yaml with this values:
________________
ansible_group_priority: 10
myvar: cluster
________________
And another one called inventory/group_vars/role_1.yaml with this value:
________________
myvar: role
________________
Finally I have a playbook called mytest.yaml like this:
________________
- hosts: role_1&cluster_1
roles:
- mytest
________________
I think I'm reproducing exactly the example at
https://docs.ansible.com/ansible/devel/user_guide/intro_inventory.html#how-variables-are-merged
but the result is always "myvar: role". And of course, when I comment that
line at role_1.yaml, the result is "myvar: cluster".
I've tried setting ansible_group_priority at role_1.yaml to 9 (and to 11, just
in case), but it still happens the same. Well I think at this point I've tried
all combinations :D
I'm using ansible version 2.4.0.0 but I also tried with 2.4.2.0 with the same
results.
Can anyone spot anything that I'm doing wrong or did I just hit a bug?
--
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/570bfcb2-688c-489d-a4e8-645a5024036f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.