Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Use ansible to gather failure details #377

Open
mike-nguyen opened this issue Apr 16, 2018 · 2 comments
Open

Use ansible to gather failure details #377

mike-nguyen opened this issue Apr 16, 2018 · 2 comments

Comments

@mike-nguyen
Copy link
Collaborator

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
@miabbott
Copy link
Collaborator

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.

@mike-nguyen
Copy link
Collaborator Author

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 free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants