# Can ansible do dshbak-like output?

**URL:** <https://forum.ansible.com/t/can-ansible-do-dshbak-like-output/13964>\
**Category:** Ansible Project\
**Created:** [November 22, 2013, 3:23am UTC](https://forum.ansible.com/t/can-ansible-do-dshbak-like-output/13964 "2013-11-22T03:23:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason1](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@jason1](https://forum.ansible.com/u/jason1)\
**Post date:** [November 22, 2013, 3:23am UTC](https://forum.ansible.com/t/can-ansible-do-dshbak-like-output/13964/1 "2013-11-22T03:23:44Z")

</div>

Hello,

I use “ansible -m shell” quite a bit. I would like ansible to not show me the output multiple times if it is identical on several machines. The dshbak tool for pdsh [0] and clush -b from clustershell [1] are examples of similar tools that behave in the desired way. I wrote a simple proof of concept for ansible at [https://github.com/jrib/ansbak](https://github.com/jrib/ansbak) .

What happens now:

> $ ansible host1:host2 -m shell -a ‘echo foo\nbar’  
> host1 | success | rc=0 \>\>  
> foo  
> bar
> 
> host2 | success | rc=0 \>\>  
> foo  
> bar

What I want to happen:

> $ ansible host1:host2 -m shell -a ‘echo foo\nbar’ | ansbak.py  
> [‘host1’, ‘host2’] | success | rc=0 \>\>  
> foo  
> bar

My questions are:

1. Does something like this already exist?
2. Is ansbak a good approach? What features should I add?
3. Would it be preferable to add this feature directly to ansible? (hints where welcomed)

Thanks!  
Jason

[0] [https://code.google.com/p/pdsh/](https://code.google.com/p/pdsh/)  
[1] [http://cea-hpc.github.io/clustershell/](http://cea-hpc.github.io/clustershell/)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [November 22, 2013, 7:18am UTC](https://forum.ansible.com/t/can-ansible-do-dshbak-like-output/13964/2 "2013-11-22T07:18:17Z")

</div>

Doesn’t currently exist, I suspect architecturally that wouldn’t fit for a large number of systems that exceed the fork count, but you might have a go and find out 🙂

– Michael

---

<div class="post-metadata">

**Author:** ![Yaroslav\_Halchenko](https://avatars.discourse-cdn.com/v4/letter/y/8edcca/32.png) [@Yaroslav\_Halchenko](https://forum.ansible.com/u/Yaroslav_Halchenko)\
**Post date:** [April 3, 2014, 11:54pm UTC](https://forum.ansible.com/t/can-ansible-do-dshbak-like-output/13964/3 "2014-04-03T23:54:39Z")

</div>

FWIW I would second having such a feature builtin, e.g. even just having something like a --collate option would be really nice. --diff could be also very neat to not just collate common output as a whole into one, but rather visualize where output is the same (across all hosts) and where differs. Both modes would be useful not only for -m shell but others (e.g. setup) as well, so not really module dependent.

Cheers!

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 4, 2014, 3:06pm UTC](https://forum.ansible.com/t/can-ansible-do-dshbak-like-output/13964/4 "2014-04-04T15:06:27Z")

</div>

I’d welcome experimentation with the callbacks classes maybe, I don’t think a thing on top of ansible is appropriate.
