Skip to content

Instantly share code, notes, and snippets.

View needle-deploy's full-sized avatar

Haymaker needle-deploy

View GitHub Profile
@needle-deploy
needle-deploy / gist:4150249
Created November 26, 2012 19:55
delete matching chef client and node when destroying a vagrant box
module Vagrant
module Provisioners
class ChefClient < Chef
def cleanup
::Chef::Config.from_file(File.expand_path('~/chef/repo/.chef/knife.rb'))
node_name = env[:vm].config.vm.provisioners[0].config.node_name
begin
puts "Destroying node #{node_name} on Chef server"
dead_node = ::Chef::Node.load(node_name)