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

Accepts new status conditions from the operator on the CR object #2016

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

rooftopcellist
Copy link
Member

SUMMARY

Thanks to the Ansible Operator SDK, status.conditions are automatically added to the AWX CR if a task fails, with the error as part of the status.

Unfortunately, the CRD schema currently exclude all status conditions that are not explicitly accepted. This PR changes that so that error messages can be seen on the AWX CR if a task fails. For example:

  status:
    conditions:
    - ansibleResult:
        changed: 3
        completion: 2025-02-10T21:14:09.383551
        failures: 1
        ok: 42
        skipped: 17
      lastTransitionTime: "2025-02-10T21:14:09Z"
      message: |
        The task includes an option with an undefined variable. The error was: 'this_will_fail' is undefined. 'this_will_fail' is undefined

        The error appears to be in '/opt/ansible/roles/installer/tasks/database_configuration.yml': line 54, column 3, but may
        be elsewhere in the file depending on the exact syntax problem.

        The offending line appears to be:


        - name: this will fail
          ^ here
      reason: Failed
      status: "True"
      type: Failure
ISSUE TYPE
  • New or Enhanced Feature

@rooftopcellist rooftopcellist merged commit 97efcab into ansible:devel Feb 17, 2025
7 checks passed
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