Created
February 8, 2012 21:31
-
-
Save robbyt/1774044 to your computer and use it in GitHub Desktop.
puppet clean node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
echo "must feed me a FQDN of a server you want to delete!!!!" | |
exit 1 | |
fi | |
/usr/bin/puppet node clean --unexport $1 | |
/etc/puppet/tools/kill_node_in_storedconfigs_db.rb $1 > /dev/null | |
sudo su -c "/usr/bin/mysql -e \"delete from puppet.inventory_facts where node_id = (select id from puppet.inventory_nodes where name = '$1')\"" | |
sudo su -c "/usr/bin/mysql -e \"delete from puppet.inventory_nodes where name = '$1'\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment