You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
AHT currently uses a custom callback plugin to get the task and details of a failure in Ansible. Ansible's block/rescue creates a variable called ansible_failed_task and ansible_failed_result that stores the details of a failure allowing access to a failure without a custom callback plugin.
Caveats
Blocks do not work with roles so roles must be called using include_role/import_role. There is a maximum recursion depth for include_role so we have to use the static import_role when possible.
There is currently a bug in Ansible where the ansible_failed_task and ansible_failed_result is not available when running in a loop. This can be worked around but makes the code not as clean.
Advantages
Eliminate reliance on custom callback plugin. There is less code to maintain since block/rescue is all Ansible. It also allows AHT to use any plugin (maybe xunit for the standard test interface?)
More flexibility to perform actions based on failures
The text was updated successfully, but these errors were encountered:
There is currently a bug in Ansible where the ansible_failed_task and ansible_failed_result is not available when running in a loop.
Is there a link to the issue/bug?
Overall, this seems like a good proposal and I'm in favor of pursuing it. My outstanding question is how this would interact with Fedora STI, if at all.
There are a few open issues for ansible_failed_task/ansible_failed_result but none of them are resolved yet. Here is one of them: ansible/ansible#29047
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
AHT currently uses a custom callback plugin to get the task and details of a failure in Ansible. Ansible's block/rescue creates a variable called ansible_failed_task and ansible_failed_result that stores the details of a failure allowing access to a failure without a custom callback plugin.
Caveats
Blocks do not work with roles so roles must be called using include_role/import_role. There is a maximum recursion depth for include_role so we have to use the static import_role when possible.
There is currently a bug in Ansible where the ansible_failed_task and ansible_failed_result is not available when running in a loop. This can be worked around but makes the code not as clean.
Advantages
The text was updated successfully, but these errors were encountered: