Variable precedence is causing me some pain right now and would love
to fix for the way vars_files currently works, all I want is for -e to
always win which is not currently the case. Are we open to fixing
this? The last github issue that brought it up was closed
(https://github.com/ansible/ansible/issues/2713?source=cc)
In ansible 1.3 and 1.4 variables set in the vars_files: file list will
take precedence over extra-vars.
Thanks -John
So that’s a really really old github ticket and it’s generally good idea to not pretend any old github ticket has any bearing on today, as fast as things are moving.
1.2 was a rather annoying time with lots of threads about people wanting precedence implemented 10 different ways, and also roles being worked on, and at that time, it was probably correct.
-e should always rule, per docs, but -e values must also be usable in vars_files
However, I’m not open to another vars precedence “how do we want this to work”, only reinstating that.
If you believe this is important to you and you can’t fix this, please make sure there is a new github ticket filed.
1.2 was a rather annoying time with lots of threads about people wanting precedence implemented 10 different ways, and also roles being worked on, and at that time, it was probably correct.
Yeah I realize that, there is also this message on the list for the
1.3 release - https://groups.google.com/forum/#!searchin/ansible-project/possible$20documentation$20bug/ansible-project/zZyEqBbnxLU/XMhiJ9ms7LAJ
I guess I should have been more pro-active on this issue since I was
aware of it then.
-e should always rule, per docs, but -e values must also be usable in vars_files
Right now in 1.4 if the same variable is defined both in vars_files
and on the command line using -e the value in vars_files will win.
If I make the change to make it so -e wins over vars_files do we see
any potential issues? That's what we want right?