# How to display verbose only for a particular task in playbook?

**URL:** <https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268>\
**Category:** Ansible Project\
**Created:** [June 1, 2021, 8:07pm UTC](https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268 "2021-06-01T20:07:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [June 1, 2021, 8:07pm UTC](https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268/1 "2021-06-01T20:07:39Z")

</div>

I have several tasks in a playbook. I want to see -vvvv (highest verbose level) only for a single task in the playbook. So i don’t want to give -vvvv after ‘ansible-playbook sample.yaml’.

Is there any way to display -vvvv info only for a single task while running the playbook?

Thanks,

Vikram

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [June 2, 2021, 1:29am UTC](https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268/2 "2021-06-02T01:29:16Z")

</div>

I don’t think there is a straightforward way.

As a workaround you could run the whole play with no\_log: true and add no\_log: false explicitly to your task calling ec2 action. Then run the playbook with -v.

---

<div class="post-metadata">

**Author:** ![Prasanna\_Kumar](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Prasanna\_Kumar](https://forum.ansible.com/u/Prasanna_Kumar)\
**Post date:** [June 2, 2021, 3:29am UTC](https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268/3 "2021-06-02T03:29:59Z")

</div>

There are log plugins specifically for these. You can refer logcallback plugin in ansible.

Create a copy of it and customize it as per your need.

---

<div class="post-metadata">

**Author:** ![pradnya\_waghmare](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@pradnya\_waghmare](https://forum.ansible.com/u/pradnya_waghmare)\
**Post date:** [June 2, 2021, 5:50am UTC](https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268/4 "2021-06-02T05:50:10Z")

</div>

8

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [June 2, 2021, 7:02am UTC](https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268/5 "2021-06-02T07:02:50Z")

</div>

Might be worth trying [https://awsbloglink.wordpress.com/2018/11/11/how-to-control-the-output-of-ansible-debug-with-verbose/](https://awsbloglink.wordpress.com/2018/11/11/how-to-control-the-output-of-ansible-debug-with-verbose/)

Also, there is an existing issue with this [https://github.com/ansible/ansible/issues/24215](https://github.com/ansible/ansible/issues/24215)

---

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [June 2, 2021, 4:53pm UTC](https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268/6 "2021-06-02T16:53:35Z")

</div>

Hi pushparaj,

The problem with this approach is that it is hiding even the normal output (success/fail, etc) of each task when i don’t use -vvvv. So it is hiding output of each task that i would otherwise need to see. Thanks for replying though.

Regards,  
Vikram

---

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [June 2, 2021, 5:03pm UTC](https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268/7 "2021-06-02T17:03:07Z")

</div>

Hi,

I tried this but it doesn’t exactly meet my requirements. I need to run only a single task with highest level verbosity. If i were to specify verbosity level as 4 as given in the article and if i were to run -vvvv, then all other tasks which have lower verbosity will also show debug info, not just the single task that i want shown.

Regards,  
Vikram

---

<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:** [June 2, 2021, 9:07pm UTC](https://forum.ansible.com/t/how-to-display-verbose-only-for-a-particular-task-in-playbook/35268/8 "2021-06-02T21:07:45Z")

</div>

or we add this [https://github.com/ansible/ansible/pull/74888](https://github.com/ansible/ansible/pull/74888)
