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
to_json not working on variable #9903
Comments
I'm also getting blocked by this issue, even with hard-coded json in body: "{...}" this same exception is thrown:
|
not sure if it helps, but I had this issue. - debug: var="{{my_var | to_json}}" changed to the following and it works: - name: Debugging json
debug: var="{{my_var | to_json}}" |
@seenaka I believe that your issue is different and solved by: ansible/ansible-modules-core#1011 (you'll need to get the updated module from the git repo as it's a new feature so it won't be released in the 1.9.x series. It will be released in the next major release.) |
@dlip There were some changes to Undefined handling in 1.9.x so I just tried the playbook in the original post with 1.9.1. That seems to work fine:
@abondis Since your issue went away when name: was added it's probably a different problem. Could you open a new ticket with more details (a playbook to reproduce, the version of anisble being used, etc)? Closing This TicketHi! We believe changes in the 1.9.1 release should resolve this question or problem for you. This will also be included in the next major release. If you continue seeing any problems related to this issue, or 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 Thank you! |
When running ansible v1.8.2, in the below playbook, to_json fails to handle a basic variable
It was confirmed in the mailing list here:
https://groups.google.com/forum/#!msg/ansible-project/B1EnYrc7xBI/r0N9yQmtYj8J
The text was updated successfully, but these errors were encountered: