Skip to content

Delete Chef client and node when destroying Vagrant VM

License

Notifications You must be signed in to change notification settings

dcondomitti/vagrant-butcher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant::Butcher

If you're using Vagrant with the Chef-Client provisioner, e.g. for creating cookbooks, it creates a client and a node on the Chef server. Once you destroy the VM, both the client and node will be kept on the server, which may cause problems if you fire up the same VM again.

This gem attempts to correct that.

Installation

Installation will depend on whether you're using bundler or not.

If you're using Bundler

Add this line to your application's Gemfile:

gem 'vagrant-butcher'

And then execute:

$ bundle

If you're not using bundler

You have to install this plugin via Vagrant:

$ vagrant gem 'vagrant-butcher'

Explanation for that is found on the Vagrant Plugins Documentation

Usage

The plugin is loaded automatically once installed.

By default, the gem looks for the Chef server settings on $HOME/.chef/knife.rb. This can be overrdidden by setting:

Vagrant::Config.run do |config|
  config.vm.provision :chef_solo do |chef|
    chef.knife_config = '/path/to/knife.rb'
  end
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Delete Chef client and node when destroying Vagrant VM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published