vagrant-butcher 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -5
- data/lib/vagrant-butcher/cleanup.rb +5 -5
- data/lib/vagrant-butcher/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -18,10 +18,6 @@ And then execute:
|
|
18
18
|
|
19
19
|
$ bundle
|
20
20
|
|
21
|
-
Or install it yourself as:
|
22
|
-
|
23
|
-
$ gem install vagrant-butcher
|
24
|
-
|
25
21
|
### If you're not using bundler
|
26
22
|
|
27
23
|
You have to install this plugin via Vagrant:
|
@@ -34,7 +30,7 @@ Explanation for that is found on the [Vagrant Plugins Documentation](http://vagr
|
|
34
30
|
|
35
31
|
The plugin is loaded automatically once installed.
|
36
32
|
|
37
|
-
By default, the gem looks for `$HOME/.chef/knife.rb
|
33
|
+
By default, the gem looks for the Chef server settings on `$HOME/.chef/knife.rb`. This can be overrdidden by setting:
|
38
34
|
|
39
35
|
Vagrant::Config.run do |config|
|
40
36
|
config.vm.provision :chef_solo do |chef|
|
@@ -7,13 +7,13 @@ module Vagrant
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def cleanup_chef_server(host_name)
|
10
|
-
|
11
|
-
|
10
|
+
chef_api = ::Chef::REST.new(::Chef::Config[:chef_server_url])
|
11
|
+
%w(node client).each do |resource|
|
12
|
+
env[:ui].info "Removing Chef #{resource} \"#{host_name}\"..."
|
12
13
|
begin
|
13
|
-
|
14
|
-
chef_resource.destroy
|
14
|
+
chef_api.delete_rest("#{resource}s/#{host_name}")
|
15
15
|
rescue Exception => e
|
16
|
-
env[:ui].warn "Could not
|
16
|
+
env[:ui].warn "Could not remove #{resource} #{host_name}: #{e.message}"
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-butcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: vagrant
|