Skip to content

Instantly share code, notes, and snippets.

@specialkevin
Created July 11, 2012 19:05
Show Gist options
  • Save specialkevin/3092427 to your computer and use it in GitHub Desktop.
Save specialkevin/3092427 to your computer and use it in GitHub Desktop.
VagrantFile Template
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "lucid64"
config.vm.provision :chef_client do |chef|
chef.chef_server_url = "http://example.com"
chef.validation_key_path = "~/.chef/validation.pem"
chef.node_name = "example"
chef.add_role("example")
end
end
module Vagrant
module Provisioners
class ChefClient
def cleanup
puts "Deleting client: #{config.node_name}"
puts `sh -c 'knife client delete #{config.node_name} -y'`
puts "Deleting node: #{config.node_name}"
puts `sh -c 'knife node delete #{config.node_name} -y'`
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment