# How to disable aysnc poll/ok/failed message output

**URL:** <https://forum.ansible.com/t/how-to-disable-aysnc-poll-ok-failed-message-output/2112>\
**Category:** Get Help\
**Tags:** ansible-core\
**Created:** [November 2, 2023, 2:43pm UTC](https://forum.ansible.com/t/how-to-disable-aysnc-poll-ok-failed-message-output/2112 "2023-11-02T14:43:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Defiant5090](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/defiant5090/32/1409_2.png) [@Defiant5090](https://forum.ansible.com/u/Defiant5090)\
**Post date:** [November 2, 2023, 2:43pm UTC](https://forum.ansible.com/t/how-to-disable-aysnc-poll-ok-failed-message-output/2112/1 "2023-11-02T14:43:06Z")

</div>

Hello,

We recently upgraded ansible from 2.10 to 2.14 and have noticed ASYNC POLL/OK/FAILED messages are now displayed during async tasks. Where as before these messages where not displayed, is there any way to disable/hide these maessages from stdout?

Example output:  
ASYNC POLL on host.fqdn jid=1234.6789 started=1 finished=0

The OK/FAILED messages are similar to the POLL message.

I have tried setting the following callback options in the config file to false, but they either don’t work or they are referenced in some other way.  
[https://github.com/ansible/ansible/pull/74953](https://github.com/ansible/ansible/pull/74953)

If anyone knows how to remove these messages, it would be appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [November 2, 2023, 6:36pm UTC](https://forum.ansible.com/t/how-to-disable-aysnc-poll-ok-failed-message-output/2112/2 "2023-11-02T18:36:44Z")

</div>

Hi,

Just a thought, you could use [diy callback plugin](https://docs.ansible.com/ansible/latest/collections/community/general/diy_callback.html) to this end. I don’t have an example tailored to your needs, but here is one to remove all headers and stats from output:

```yaml
$ less ./ansible.cfg
[defaults]
stdout_callback = community.general.diy
...

$ less test.yml
---

- name: "Print some stuff"
  gather_facts: false
  connection: local
  hosts: localhost
  become: false
  vars:
    ansible_callback_diy_playbook_on_play_start_msg: ""
    ansible_callback_diy_playbook_on_stats_msg: ""
  tasks:
    - name: Print stuff
      ansible.builtin.debug:
        msg:
          - stuff
      vars:
        ansible_callback_diy_playbook_on_task_start_msg: ""
        ansible_callback_diy_runner_on_ok_msg: "{{ ansible_callback_diy.result.output.msg }}\n"

$ ANSIBLE_CONFIG=./ansible.cfg ansible-playbook test.yml
['stuff']

```

Hope it helps !

---

<div class="post-metadata">

**Author:** ![Defiant5090](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/defiant5090/32/1409_2.png) [@Defiant5090](https://forum.ansible.com/u/Defiant5090)\
**Post date:** [November 2, 2023, 7:32pm UTC](https://forum.ansible.com/t/how-to-disable-aysnc-poll-ok-failed-message-output/2112/3 "2023-11-02T19:32:32Z")

</div>

Hi,

Thanks for the suggestion, but I’ve actually already tried the diy stdout callback. The irony is that the async poll/ok/failed messages do not display by default using this stdout callback; which is great, however you can not format the results.

For example the callback parameters:

callback\_format\_pretty = true  
callback\_result\_format = yaml

have no effect using the diy stdout callback under the [defaults] or [callback\_diy] sections in the ansible.cfg file, so reading the errors are a pain.

---

<div class="post-metadata">

**Author:** ![Defiant5090](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/defiant5090/32/1409_2.png) [@Defiant5090](https://forum.ansible.com/u/Defiant5090)\
**Post date:** [December 5, 2023, 8:23pm UTC](https://forum.ansible.com/t/how-to-disable-aysnc-poll-ok-failed-message-output/2112/4 "2023-12-05T20:23:17Z")

</div>

So just to let others know, the solution to the issue was to modify the default callback for the python version being used.

%ansible python module location%/plugins/callback/default.py

%ansible python module location% = the python path ansible is using (ansible --version)

By commenting out the “v2\_runner\_on\_async\_poll/ok/failed” block sections I managed to remove the (IMO useless) async messages.

The DIY callback currently doesn’t include these async runners and as such does not show these messages, however the DIY callback also doesn’t currently support pretty formatting.

Hence this is why I modified the default callback instead since it was a simple solution and I am not ready to write my own callback just to remove those async messages.

Anyway, hopefully this helps others looking to remove these async messages as well.

---

<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:** [January 4, 2024, 8:23pm UTC](https://forum.ansible.com/t/how-to-disable-aysnc-poll-ok-failed-message-output/2112/5 "2024-01-04T20:23:28Z")

</div>

Closed on January 4, 2024, 8:23pm UTC

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