Hi,
Can somebody please explain to me why the variable precedence (http://ansible.cc/docs/playbooks2.html#understanding-variable-precedence) is the way it is?
Especially why `vars` and `vars_files` are in that order and so far apart? Shouldn't one be just an inline replacement of the other?
To me the following variable precedence would seem more natural:
1. `--extra-vars` in command line
2. `vars` in a playbook
3. `vars_files` in a playbook
4. assigned variables with `register`
5. parameters passed to tasks/handlers list `include` statements (also parameters to `roles`)
6. gathered facts
7. parameters passed to playlist `include` statements
8. inventory host variables
9. inventory group variables in inheritance order
Note that the above 4. and 6., 5. and 7. in current documentation are joined together, but for clarity it would be better to separate them (and probably change their order as I did above).
I also put `vars` in a playbook (2.) before `vars_files`, because it feels more natural to have sane defaults in external files and override them locally. Most programs behave similar to this when loading their configuration. This way way the following use case would be much more readable (because there would be no need to look in the additional `vars_files` files to see what is going on or put things in inventory variables or use parameterized roles):
# webservers.yml - assigns roles to hosts, allow specifying which repository and branch to use