Uploaded image for project: 'Ansible Automation Platform RFEs'
  1. Ansible Automation Platform RFEs
  2. AAPRFE-2117

RFE: Enable 'check mode' compatibility for async tasks in infra.* Collections

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 2.5
    • core
    • False
    • Hide

      None

      Show
      None
    • False

      1 - What is the nature and description of the request?

      Operations teams require the ability to run Ansible playbooks in --check mode to preview changes safely and verify expected outcomes. However, when tasks are configured to use asynchronous execution (async), check mode is currently unsupported and results in the following error:

       

      "msg": "check mode and async cannot be used on same task."

       

      2 - Why does the customer need this? (List the business requirements here)

      This prevents use of best practices like dry runs in automation workflows, especially in sensitive or production-like environments.

      • Pre-change validation to confirm expected automation behavior.
      • Operational safety for infrastructure and configuration management.
      • Improved confidence and auditability in automated workflows.
      • Alignment with compliance practices that require pre-change visibility.

       

      3 - How would you like to achieve this? (List the functional requirements here)

      The infra.controller_configuration collection (specifically the 'settings' role) provides an example that accommodates async and check mode and could serve as a model for other roles or modules : 

      async: "{{ ansible_check_mode | ternary(0, 1000) }}"

      poll: 0

      changed_when: "(__controller_setting_job_async.changed if ansible_check_mode else false)"

      when: not ansible_check_mode

       

      This pattern:

      • Disables async execution in check mode.
      • Allows changed_when to reflect module behavior.
      • Avoids polling or job waiting when in check mode.

      4 - List any affected known dependencies: 

      • ansible-core (raises the error)
      • Any CasC Validated or Certifies collection using async
      • Documentation and best practice guides

       

      5 Github:

      N/A

              dmendoza@redhat.com Dafne Mendoza
              rhn-support-dleroux Daniel Leroux
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: