Skip to content
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

Make raw_vars compatible with play vars and Ansible 2.1 #684

Merged
merged 1 commit into from
Nov 7, 2016

Conversation

fullyint
Copy link
Contributor

@fullyint fullyint commented Nov 7, 2016

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 for Host objects. The fate of Ansible vars plugins appears uncertain, given that Ansible...

was planning on killing vars_plugins in their current form --ref

This PR moves plugins/vars/vars.py to plugins/callback/vars.py. In the new callback context, the plugin can still access and modify Host vars, restoring the raw_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, before vars.py.

@swalkinshaw
Copy link
Member

Annoying 😔 but changes look good :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants