ambari-server stop
ambari-agent stop
yum erase ambari-agent
yum erase ambari-server
rm /var/lib/ambari-*/keys
remove repo file at /etc/yum.repos.d/
yum -y remove ambari-log4j hadoop hadoop-lzo hbase hive libconfuse nagios sqoop zookeeper
more:
https://cwiki.apache.org/confluence/display/AMBARI/Cleaning+up+machines+for+Ambari+and+Stack