I would like to use pdsh to assert that a command successfully run on multiple nodes, if the command fails on any nodes the exit code (from pdsh) should be non-zero.
Consider the following examples:
$ pdsh -w host1,host2 "exit 0"; echo $?
host1: host1
host2: host2
0
$ pdsh -w host1,host2 "exit 1"; echo $?
host1: host1: ssh exited with exit code 1
host2: host2: ssh exited with exit code 1
0
$ pdsh -w host1,host2,host3 "exit 1"; echo $?
host1: host1: ssh exited with exit code 1
host2: host2: ssh exited with exit code 1
host3: host3: ssh exited with exit code 255
0
The second example should return a non-zero exit code.
In the third example host3 does not exist and still the exit code is zero.
Am I missing something?
Thanks