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
add last error to rescue block #12341
Comments
I was just mentioning to someone last night that this might be useful... not sure if we'll get it in by 2.0 but we'll keep this open. Thanks! |
Love this, +1. |
+1. I love this, too. |
`ansible_failed_task`: Contains the task data, essentially a serialized view of the Task() object. `ansible_failed_result`: Contains the result of the task failure, which is identical in function to registering the result. Doing so automatically like this saves the user from having to register every result in a block and then trying to figure out which result had the failure Similar to the way try/except/finally work, these variables will not be available in the `always` portion of a block unless there is a corresponding `rescue` first. Fixes #12341
+1. |
Closing This TicketHi! We believe the above commit should resolve this problem for you. This will also be included in the next 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 issue is resolved. Thank you! |
Issue Type: Feature Idea
Ansible Version: 2.0.0
Ansible Configuration: not modified
Environment: Ubuntu 14.04
Summary: add last error to rescue block
Steps To Reproduce:
Rescue block described at http://docs.ansible.com/ansible/playbooks_blocks.html have no way to retrieve last error.
I think error notification will be frequent use case for blocks.
Something like this:
Expected Results:
Last error - playbook, task name, failure message.
Actual Results:
No variable defined
The text was updated successfully, but these errors were encountered: