You could also use pdsh
for this, it allows running a command in parallel on multiple hosts.
pdsh -w ^hostlist.txt -R ssh "cat /etc/redhat-release"
^
defines a file with the list of hostnames, alternatively a comma separated list could be used:
pdsh -w host1,host2,host3,... -R ssh "cat /etc/redhat-release"
A result would look like:
pdsh, -w raspi,raspi.local,192.168.0.3,localhost,127.0.0.1 -R ssh "cat /etc/issue"
raspi: Raspbian GNU/Linux 10 \n \l
raspi:
raspi.local: Raspbian GNU/Linux 10 \n \l
raspi.local:
192.168.0.3: Raspbian GNU/Linux 10 \n \l
192.168.0.3:
localhost: Debian GNU/Linux 10 \n \l
localhost:
127.0.0.1: Debian GNU/Linux 10 \n \l
127.0.0.1: