-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include_vars task does not merge hashes if told so via ansible config #9116
Comments
BTW, where is the code of that component? The only file I was able to find only contains documentation, not the actual code. https://github.com/ansible/ansible/blob/75e5b6401c65da9de8ec4acee0dd54cabdcdb546/library/utilities/include_vars |
Part of the code is in https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/action_plugins/include_vars.py The merging however happens somewhere in the runner I believe. Those vars are actually returned as ansible_facts, so merging include_vars would mean merging ansible_facts AFAICS. |
In that case this closed PR looks like it could have been the solution? #7700 |
Yes, that looks like it.. |
Given Michaels comments on #7700: FWIW and AFAICS: choosing wether to merge or not is done separately for
|
If anyone has the same problem, I created an action plugin |
This could be done apart from ansible_facts, by making the result parser look for something beyond ansible_facts, ie. The relevant code is in Based on the above discussion though, and that on #7700, I'll go ahead and close this. If you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:
Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved. Thank you! |
If you look into my gist you will see that this can never be solved inside the runner. Merging needs to happen in the plugin. Anyway, I expected nothing else than this to be closed, therefore solved myself with the plugin. |
@udondan, don't you update your code for ansible-2.0? |
Starting with Ansible v2.0 you can do it:
|
Issue Type:
Bug Report
Ansible Version:
Environment:
Local: OS X Mavericks
Remote: Debian
Summary:
include_vars
task does not merge hashes if told so via ansible config.Steps To Reproduce:
ansible.cfg
contains this line:Playbook with 3 tasks:
Content of file A:
Content of file B:
Expected Results:
The merged hash
test
should contain both keys,a
andb
.Actual Results:
The hash keys have not been merged. Only the latter one,
b
is available.The text was updated successfully, but these errors were encountered: