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
14.1k stars 3.43k forks source link

Playbooks ran as command inside other playbooks give garbage stdout characters #5380

Open AlanCoding opened 5 years ago

AlanCoding commented 5 years ago
ISSUE TYPE
SUMMARY

Extremely strange behavior is observed in event stdout for a task that runs an ansible-playbook command

ENVIRONMENT
STEPS TO REPRODUCE

Run a job using this playbook

https://github.com/AlanCoding/test-playbooks/blob/nested/nested_debug.yml

view the stdout for the only task in the playbook

EXPECTED RESULTS

same as CLI results

    "delta": "0:00:01.160476",
    "end": "2019-11-21 20:00:57.208672",
    "invocation": {
        "module_args": {
            "_raw_params": "ansible-playbook -i localhost, debug.yml",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "rc": 0,
    "start": "2019-11-21 20:00:56.048196",
    "stderr": "",
    "stderr_lines": [],
    "stdout": "\nPLAY [all] *********************************************************************\n\nTASK [debug] *******************************************************************\nok: [localhost] => {\n    \"msg\": \"hello\"\n}\n\nPLAY RECAP *********************************************************************\nlocalhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   ",
    "stdout_lines": [
        "",
        "PLAY [all] *********************************************************************",
        "",
        "TASK [debug] *******************************************************************",
        "ok: [localhost] => {",
        "    \"msg\": \"hello\"",
        "}",
        "",
        "PLAY RECAP *********************************************************************",
        "localhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   "
    ]
}
META: ran handlers
META: ran handlers

PLAY RECAP ******************************************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
ACTUAL RESULTS
Screen Shot 2019-11-21 at 8 07 48 PM
ADDITIONAL INFORMATION

leaky environment stuff from ansible-runner, just wanted to get a concrete test case established here.

ryanpetrello commented 3 years ago

This is fairly esoteric; we're unlikely to address this in the very near future.

jbowman-evh commented 1 year ago

I just ran into this issue trying to run Molecule in AAP where my playbook calls molecule create, molecule converge, molecule verify, etc. Outside of AAP, it occurred when I launched with ansible-runner, but not with ansible-playbook.