Skip to content


the replacement for ansible?

I use Ansible for more than two years simply because I have not discovered “this thing” earlier…. I found “pssh” set of utilities this week as I was looking for tools to scan a few hundred machines for a presence of certain files and processes, which produces a better formatted output (not one clattered by flying cows – don’t get me wrong, nothing against animals – I have two dogs and two cats!).
What I found is called “parallel ssh”. It looks (to me) like Ansible has been build on “pssh” functionality or general idea…..?

So in some cases it could be pssh and at a different occasion ansible or something else that comes along…. 🙂


Example 1: copy a file to multiple hosts at once

# prsync -h ./hosts ./xxxx.tgz /root/


Example 2: execute a command on a number of UNIX hosts

# pssh -h ./hosts -o /tmp/scan.out tar xzvf /root/xxxx.tgz


Example 3: execute a script from the “pssh” host on a group of remote hosts

# pssh -h ./hosts -o /tmp/scan.out -I <./LongRiver


Example 4: execute a script from the “pssh” host on a single remote host

# pssh -H myhost.wmd.edu -o /tmp/myhost -I <./MyVeryOldPerlStuff.pl

Above, the “./hosts” file contains the names of the target hosts. The “/tmp/scan.out” indicates output location where the “interaction” between “pssh” and each host is stored in a separate sub-directory.
How to get all these goodies? I installed them on RedHat and Oracle Linuxes with “pip”. These operation will install all of the “parallel” ssh utilities like pssh, prsync, pscp, pnuke and pslurp.

# pip install pssh

Based on the limited amount of time i use “pssh”, I suggest you make sure to disable “getty” requirement in “/etc/sudoers” on all of your target machines. I do not believe that there is any harm in doing so.

Defaults:      !requiretty


Example run against a group hosts defined in the “./hosts” inventory file:

# pssh -h ./hosts -l root -o /tmp/libout -P 'getconf GNU_LIBPTHREAD_VERSION'
WMDBIPPL2: NPTL 2.12
[1] 12:57:54 [SUCCESS] WMDBIPPL2
WMDOIFPL1: NPTL 2.12
[2] 12:57:54 [SUCCESS] WMDOIFPL1
WMDOIMPL3: NPTL 2.12
[3] 12:57:54 [SUCCESS] WMDOIMPL3
WMDOIFPL2: NPTL 2.12
[4] 12:57:54 [SUCCESS] WMDOIFPL2
WMDWEBPL1: NPTL 2.12
[5] 12:57:54 [SUCCESS] WMDWEBPL1
WMDWEBPL2: NPTL 2.12
[6] 12:57:54 [SUCCESS] WMDWEBPL2
WMDOIMPL4: NPTL 2.12
[7] 12:57:55 [SUCCESS] WMDOIMPL4
WMDBIPPL1: NPTL 2.12
[8] 12:57:56 [SUCCESS] WMDBIPPL1

The output will also be written into the “/tmp/libout” directory – each host will have a file with the same name containing the output of the command. 

Posted in LINUX.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

WordPress Anti Spam by WP-SpamShield



Copyright © 2016 - 2018 Waldemar Mark Duszyk. All Rights Reserved. Created by Blog Copyright.