On 30.12.21 16:42, Andy Smith wrote:

On Thu, Dec 30, 2021 at 05:15:18PM +0200, Anssi Saari wrote:
Marco Möller <ta...@debianlists.mobilxpress.net> writes:
this command is then sent to all SSH connected remote systems at
once as if the command would have been typed in at each single
of the SSH connected remote systems CLI individually. Do you
know about such feature to be implemented in some Linux tool?

I do simple stuff with just a for loop in the shell. For more complex
stuff I use Ansible which uses ssh internally.

Aside from shell loops, I've also in the past used dsh which is
still packaged in Debian:

     http://www.netfort.gr.jp/~dancer/software/dsh.html

…but these days I also switched to using Ansible ad hoc commands and
playbooks for anything I do repeatedly. Well worth looking into.


I understand from your answer that with Ansible it will be possible to send commands to various destinations, and on its website (which I quickly have had a look at) it claims, that it is good for repeating several command long tasks. Right?

As my aim is to interactively run the same commands on several machines, in order to observe if they everywhere behave the same or what different results they would produce, does each SSH session report back to Ansible the console output of the command, or allow interactivity with the session like answering questions at the console if the command would produce a question, as tmux allows such interactivity? Or is Ansible thought to send non-interactive commands which are supposed to not write output back to a visible console?

Maybe I specify better what I want to do: for educational or for diagnostic purpose or for developing and testing a script, I would like to run a same command on various Linux systems, which have different configurations, and to then observe at the various consoles the result of it. So, the Ansible feature for handling repetitive tasks is for sure nice, but for me it is more of interest to write a command once and to observe its behavior multiple times, also after having sent the command once to all sessions to then interactivity follow up in each individual session where needed.

To everybody thanks to all the interesting feedback already provided, also in the parallel to his sub-thread answers!
Marco

Reply via email to