Can ansible do dshbak-like output?

213 views
Skip to first unread message

ja...@jrib.net

unread,
Nov 21, 2013, 10:23:44 PM11/21/13
to ansible...@googlegroups.com
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 .

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



Michael DeHaan

unread,
Nov 22, 2013, 2:18:17 AM11/22/13
to ansible...@googlegroups.com
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
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Yaroslav Halchenko

unread,
Apr 3, 2014, 7:54:39 PM4/3/14
to ansible...@googlegroups.com
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!

Michael DeHaan

unread,
Apr 4, 2014, 11:06:27 AM4/4/14
to ansible...@googlegroups.com
I'd welcome experimentation with the callbacks classes maybe, I don't think a thing on top of ansible is appropriate.






--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages