Created
July 11, 2012 19:05
-
-
Save specialkevin/3092427 to your computer and use it in GitHub Desktop.
VagrantFile Template
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
# -*- 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