ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
13.5k stars 3.34k forks source link

task check_mode=false ignored by awx job template - Playbook Check #15162

Open jon-nfc opened 2 weeks ago

jon-nfc commented 2 weeks ago

Please confirm the following

Bug Summary

when running a job template with job type Playbook Check, tasks with check_mode: false do not run as intended when on the cli they do.

AWX version

23.9.0

Select the relevant components

Installation method

kubernetes

Modifications

no

Ansible version

23.9.0

Operating system

k3s 1.29

Web browser

No response

Steps to reproduce

add the following task

- name: Get Hostname
  ansible.builtin.command:
    cmd: hostname
  changed_when: false
  check_mode: false
  register: hostname_to_check
  tags:
    - always

and run the playbook in "check" mode from awx. the task fails to run

Expected results

that a task with check_mode: false runs when the play is run in "check mode". This is what already occurs when the cli is used, i.e. ansible-playboook my-playbook-name.yaml --check.

Actual results


skipping: [<truncated>] => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "cmd": [
        "hostname"
    ],
    "delta": null,
    "end": null,
    "invocation": {
        "module_args": {
            "_raw_params": "hostname",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "expand_argument_vars": true,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true
        }
    },
    "msg": "Command would have run if not in check mode",
  …

Additional information

No response