Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## kill_node_in_storeconfigs_db.rb
- Usage: sudo ./kill_node_in_storeconfigs_db.rb <hostname as stored in hosts table>
- #!/usr/bin/env ruby
- require 'puppet/rails'
- Puppet[:config] = "/etc/puppet/puppet.conf"
- Puppet.parse_config
- # This should work but Puppet[:dbadapter] is the default sqlite3 no matter what.
- Puppet::Rails.connect
- if @host = Puppet::Rails::Host.find_by_name(ARGV[0].strip)
- print "Killing #{ARGV[0]}..."
- $stdout.flush
- @host.destroy
- puts "done."
- else
- puts "Can't find host #{ARGV[0]}."
- end
Add Comment
Please, Sign In to add comment