Make raw_vars compatible with play vars and Ansible 2.1 #684
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
discourse.roots.io/t/7861/3 revealed that
raw_vars
auto-escaping stopped working as of Ansible 2.1. Ansible made an internal API change removing the possibility for vars plugins to access and modify vars forHost
objects. The fate of Ansible vars plugins appears uncertain, given that Ansible...This PR moves
plugins/vars/vars.py
toplugins/callback/vars.py
. In the new callback context, the plugin can still access and modifyHost
vars, restoring theraw_vars
auto-escaping functionality.Given that this new callback context also grants access to play vars, the
raw_vars
can now escape play vars (i.e., vars defined in playbooks) in addition to group vars. Play vars take precedence.I moved the Ansible 1.x warning to the callback plugin
output.py
. As the designated stdout callback plugin,output.py
is processed first, beforevars.py
.