You're looking for DSSH. It's a distributed terminal. Execute command once, it will be executed across all of the hosts.
A hosts file is used
$ cat hosts
mojito
-l noland kodiak
mojito
kodiak
-C mojito
-i /home/noland/.ssh/id_rsa kodiak
Running a command
$ ./dssh.sh "uptime" < hosts
mojito:O:0:19:16:45 up 3 days, 14 min, 5 users, load average: 0.22, 0.22, 0.20
kodiak:O:0:13:24:00 up 20:00, 1 user, load average: 0.42, 0.16, 0.05
mojito:O:0:19:16:45 up 3 days, 14 min, 5 users, load average: 0.22, 0.22, 0.20
kodiak:O:0:13:24:00 up 20:00, 1 user, load average: 0.42, 0.16, 0.05
mojito:O:0:19:16:45 up 3 days, 14 min, 5 users, load average: 0.22, 0.22, 0.20
kodiak:O:0:13:24:00 up 20:00, 1 user, load average: 0.42, 0.16, 0.0