Running ssh on a remote system?

I need to install ypbind and yp-tools on over two-hundred remote client machines based on their redhat version. I have a centralized server on which I created an ssh public key. I then transfered the ssh public key to the authorized_keys file on all the remote hosts; therefore, I can login without being prompted for a password. However, my script is not working as expected. The script will copy the tarball with ypbind and yp-tools to the remote host, but it will not extract the tarball on the remote host. Is there a way of doing this with just one server side script or possibly ssh using a coprocess? Any help would be greatly appreciated. The following is a copy of my script:

#!/bin/bash
set -x
SERVERS=`cat list`
for MACHINE in $SERVERS
do
SYSREL=`/bin/ssh $MACHINE cat /etc/redhat-release`
if [ "$SYSREL" = "Red Hat Enterprise Linux AS release 3 (Taroon Update 3)" ]
then
/bin/scp ciscolinux_nis_package.tar $MACHINE:/tmp
/bin/ssh $MACHINE tar -xvf /tmp/ciscolinu_nis_package.tar
/bin/ssh $MACHINE rpm -ivh /tmp/yp-tools-2.8-1.i386.rpm /tmp/ypbind-1.12-5.i386.rpm
elif [ $SYSREL = "Red Hat Linux release 9 (Shrike)" ]
then
/bin/scp redhat9_nis_package.tar $MACHINE:/tmp
/bin/ssh $MACHINE tar -xvf /tmp/redhat9_nis_package.tar
/bin/ssh $MACHINE rpm -ivh /tmp/yp-tools-2.7-5.i386.rpm /tmp/ypbind-1.12-5.i386.rpm
elif [ $SYSREL = "Red Hat Linux release 8 (Shrike)" ]
then
/bin/scp redhat8_nis_package $MACHINE:/tmp
/bin/ssh $MACHINE tar -xvf redhat8_nis_package.tar
/bin/ssh $MACHINE rpm -ivh /tmp/yp-tools-2.7-3.i386.rpm /tmp/ypbind-1.11-2.i386.rpm
elif [ $SYSREL = "Red Hat Linux release 7.3 (Valhalla)" ]
then
/bin/scp redhat7.3_nis_package.tar $MACHINE:/tmp
/bin/ssh $MACHINE tar -xvf /tmp/redhat7.3_nis_package.tar
/bin/ssh $MACHINE rpm -ivh /tmp/yp-tools-2.6-4.i386.rpm /tmp/ypbind-1.10-7.i386.rpm
elif [ $SYSREL = "Red Hat Linux release 7.2 (Enigma)" ]
then
/bin/scp redhat7.2_nis_package.tar $MACHINE:/tmp
/bin/ssh $MACHINE tar -xvf /tmp/redhat7.2_nis_package.tar
/bin/ssh $MACHINE rpm -ivh /tmp/yp-tools-2.5-1.i386.rpm /tmp/ypbind-1.8-1.i386.rpm
elif [ $SYSREL = "Red Hat Linux release 7.1sbe (Seawolf)" ]
then
/bin/scp redhat7.1_nis_package.tar $MACHINE:/tmp
/bin/ssh $MACHINE tar -xvf /tmp/redhat7.1_nis_package.tar
/bin/ssh $MACHINE rpm -ivh /tmp/yp-tools-2.4-7.i386.rpm /tmp/ypbind-1.7-8.i386.rpm
else
echo "Error install ypbind and yptools"
fi
done

Try it with quotes...
/bin/ssh $MACHINE "tar -xvf redhat8_nis_package.tar"