Tweaked merge_hash to also affect Runner behavior #2476

Closed
wants to merge 6 commits into
from

2 participants

@laggyluke

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.

@mpdehaan

This looks nice and clean, in queue for testing, thanks!

@mpdehaan

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!

@laggyluke

Sure, I just need to find some time to set up a testing infrastructure.

@laggyluke

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.

@laggyluke

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.

@mpdehaan

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.

@mpdehaan mpdehaan closed this Apr 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment