This pull request should contribute to #2329.
Hashes loaded from vars and vars_files should now be merged when merge_hash is set to True in ansible.cfg.
I'm not very experienced with Python, so please let me know if I can improve something.
Tweaked merge_hash to also affect Runner behavior
Merge branch 'devel' into combine_vars
This looks nice and clean, in queue for testing, thanks!
Hi @laggyluke if you run "make tests" this causes about 13 new test failures (there is one lineinfile test that we know to be broken and are working on fixing).
Can you take a look at what is going on? Thanks!
Sure, I just need to find some time to set up a testing infrastructure.
Fixed utils.combine_vars to always return dict
I believe I've fixed it - the only test failing is the one that you've mentioned (lineinfile).
Now I have a testing environment set up properly, so I guess I don't have any excuses not to write some new tests :)
I hope to do it this weekend, so you may wish to hold back this PR until then.
Added basic tests for hash behavior
I've added some basic tests for two hash behaviors - replace and merge.
Unfortunately I spent several hours trying to come up with a clean way to test it, but eventually gave up and just rendered the hash via template into a temporary file.
If you have any suggestions how to test this better, please let me know.
You have a merge commit in here, can you please resubmit this.
always use 'git pull --rebase' and not 'git pull' and never 'git merge', but always 'git rebase'.
I'd also like to have this as a single squashed commit versus the commit + the fixes, you should probably be able to force push to the same branch to replace things, but it is always a good idea to start a new branch for each feature to keep things simple.