# How should I avoid skipped tasks from displaying on the console

**URL:** <https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671>\
**Category:** Ansible Developer\
**Created:** [June 6, 2016, 7:19am UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671 "2016-06-06T07:19:39Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tejas\_Gadaria1](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@Tejas\_Gadaria1](https://forum.ansible.com/u/Tejas_Gadaria1)\
**Post date:** [June 6, 2016, 7:19am UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/1 "2016-06-06T07:19:39Z")

</div>

Hi,

I have couple of rollback task in the playbook, displayed as skipped tasked, on the console.

`  
TASK: [deploy-stack | Deleting\_Validation\_Template] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
skipping: [10.17.10.150]

TASK: [deploy-stack | shell echo ‘Template Validation has Failed’] \*\*\*\*\*\*\*\*\*\*\*\*  
skipping: [10.17.10.150]

TASK: [deploy-stack | Deploying\_the\_Stack…] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [10.17.10.150]  
`

I am able to hide “skipping” tags under the task header with the help of “[display\_skipped\_hosts](http://docs.ansible.com/ansible/intro_configuration.html#display-skipped-hosts)” parameter in ansible.cfg file. However TASK is still displayed on the console.

Is there any way to achieve this ?

Thanks,

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [June 6, 2016, 7:33am UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/2 "2016-06-06T07:33:34Z")

</div>

Not tried it myself but I believe there is a callback plugin called actionable which you can try which might do this.

See [http://docs.ansible.com/ansible/developing\_plugins.html#callbacks](http://docs.ansible.com/ansible/developing_plugins.html#callbacks)

Since this is a supplied callback plugin then I think you can enable it just by adding it to the callback\_whitelist in your ansible.cfg - see [http://docs.ansible.com/ansible/intro\_configuration.html#callback-whitelist](http://docs.ansible.com/ansible/intro_configuration.html#callback-whitelist)

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Tejas\_Gadaria1](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@Tejas\_Gadaria1](https://forum.ansible.com/u/Tejas_Gadaria1)\
**Post date:** [June 6, 2016, 2:08pm UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/3 "2016-06-06T14:08:03Z")

</div>

Thanks for replay jhawkesworth,

There are good plugins, however it does not hide the skipped tasks.

I found this [link](https://github.com/madduck/ansible/commit/78299ebbba8af7954b7418de9104bfa10be3158e) but could not find “callbacks.py” file in “ansible/plugins/callback”. ☹

Is it better to own call plugin to achive this, or this functionality is available ? I am using ansible version 2.1

Thanks,

---

<div class="post-metadata">

**Author:** ![Tobias\_Wolf](https://avatars.discourse-cdn.com/v4/letter/t/eada6e/32.png) [@Tobias\_Wolf](https://forum.ansible.com/u/Tobias_Wolf)\
**Post date:** [June 6, 2016, 2:44pm UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/4 "2016-06-06T14:44:19Z")

</div>

> > Since this is a supplied callback plugin then I think you can enable it just by adding it to the callback\_whitelist in your ansible.cfg - see [http://docs.ansible.com/ansible/intro\_configuration.html#callback-whitelist](http://docs.ansible.com/ansible/intro_configuration.html#callback-whitelist)

In `ansible.cfg` you need to set

> stdout\_callback = actionable

for it to be used for the output. It works, it only shows the changed: results.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 6, 2016, 11:37pm UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/5 "2016-06-06T23:37:09Z")

</div>

the skippy is the one which ONLY hides skipped tasks, actionable also hides OK tasks.

---

<div class="post-metadata">

**Author:** ![Tejas\_Gadaria1](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@Tejas\_Gadaria1](https://forum.ansible.com/u/Tejas_Gadaria1)\
**Post date:** [June 7, 2016, 2:42am UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/6 "2016-06-07T02:42:14Z")

</div>

Hi Brian,

I updated ansible.cfg file with “stdout\_callback = skippy” however this plugin is hiding only notification tags “skipping”. It is not hiding “TASK” header.

`  
TASK: [deploy-stack | Deleting\_Validation\_Template] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK: [deploy-stack | shell echo ‘Template Validation has Failed’] \*\*\*\*\*\*\*\*\*\*\*\*

TASK: [deploy-stack | Deploying\_the\_Stack…] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [10.17.10.150]  
`

Where, “Deleting\_Validation\_Template” and “shell echo ‘Template Validation has Failed’” are the “skipped” tasks.

Thanks,

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 7, 2016, 2:44am UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/7 "2016-06-07T02:44:50Z")

</div>

task headers get printed before a task gets attempted for any of the hosts, the callback hides the skipped hosts but cannot ‘unprint’ the headers if all hosts skip the task.

The only way to do that would be to buffer the output and wait until all hosts skip.

---

<div class="post-metadata">

**Author:** ![Tejas\_Gadaria1](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@Tejas\_Gadaria1](https://forum.ansible.com/u/Tejas_Gadaria1)\
**Post date:** [June 7, 2016, 3:26am UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/8 "2016-06-07T03:26:58Z")

</div>

Thanks for the replay Brian,

So If I understood correctly, In order to achieve this, I need to write custom “callback\_plugins” which can buffer the output until all hosts skip in the playbook.

If answer is positive, I will try this out ans update.

Thanks,

---

<div class="post-metadata">

**Author:** ![Arjav\_Shah](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@Arjav\_Shah](https://forum.ansible.com/u/Arjav_Shah)\
**Post date:** [January 23, 2017, 2:53pm UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/9 "2017-01-23T14:53:15Z")

</div>

Tejas,

Did you attempt writing a module which buffers output and only prints header if task is not skipped. If yes, would be great if you can provide me some pointers.

Thx!  
Arjav

---

<div class="post-metadata">

**Author:** ![Rory\_Bramwell](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@Rory\_Bramwell](https://forum.ansible.com/u/Rory_Bramwell)\
**Post date:** [June 23, 2017, 4:22pm UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/10 "2017-06-23T16:22:35Z")

</div>

I found this thread, looking for a similar solution.

What worked for me was to set the following under the [defaults] section in my ansible.cfg file:

display\_skipped\_hosts = False

See for more info: [http://docs.ansible.com/ansible/intro\_configuration.html#display-skipped-hosts](http://docs.ansible.com/ansible/intro_configuration.html#display-skipped-hosts)

---

<div class="post-metadata">

**Author:** ![max.meng.tor](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@max.meng.tor](https://forum.ansible.com/u/max.meng.tor)\
**Post date:** [August 25, 2017, 7:42pm UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/11 "2017-08-25T19:42:59Z")

</div>



---

<div class="post-metadata">

**Author:** ![max.meng.tor](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@max.meng.tor](https://forum.ansible.com/u/max.meng.tor)\
**Post date:** [August 28, 2017, 9:43pm UTC](https://forum.ansible.com/t/how-should-i-avoid-skipped-tasks-from-displaying-on-the-console/21671/12 "2017-08-28T21:43:46Z")

</div>

If you try with free mode, it will work.
