# ANSIBLE\_STDOUT\_CALLBACK json with Ansible 2.9

**URL:** <https://forum.ansible.com/t/ansible-stdout-callback-json-with-ansible-2-9/40104>\
**Category:** Get Help\
**Tags:** ansible\
**Created:** [February 6, 2025, 1:08pm UTC](https://forum.ansible.com/t/ansible-stdout-callback-json-with-ansible-2-9/40104 "2025-02-06T13:08:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [February 6, 2025, 1:08pm UTC](https://forum.ansible.com/t/ansible-stdout-callback-json-with-ansible-2-9/40104/1 "2025-02-06T13:08:21Z")

</div>

Hi All,

For reasons of extreme inertia, for certain use cases Ansible 2.9.27 is used in my organisation, something I’m working to change but it is what it is. I have seen when I set ANSIBLE\_STDOUT\_CALLBACK to “json” while the output is produced as expected in JSON format but this output only appears when the playbook is over. However when I revert to default or set ANSIBLE\_STDOUT\_CALLBACK to “yaml”, the output comes task by task.

I would like to get JSON output, but to appear as each task is executed as it does with ANSIBLE\_STDOUT\_CALLBACK=YAML. Is there anything I can do to effect this, while continuing to use this version of Ansible?

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 6, 2025, 3:45pm UTC](https://forum.ansible.com/t/ansible-stdout-callback-json-with-ansible-2-9/40104/2 "2025-02-06T15:45:14Z")

</div>

That is just the way the plugin works, to give a full parsable JSON as the stdout at the conclusion of the execution. If you want a different behavior you would need to write a custom callback plugin.

For what it is worth, the `yaml` callback doesn’t actually produce full parsable yaml output, or if you find it does, it is coincidental, and not intended.

However, to get a JSON version of the YAML callback, just use the `default` callback.

---

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [February 7, 2025, 4:19am UTC](https://forum.ansible.com/t/ansible-stdout-callback-json-with-ansible-2-9/40104/3 "2025-02-07T04:19:02Z")

</div>

Thanks for your explanation.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 9, 2025, 4:19am UTC](https://forum.ansible.com/t/ansible-stdout-callback-json-with-ansible-2-9/40104/4 "2025-03-09T04:19:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
