vagrant-goodhosts 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/lib/vagrant-goodhosts/GoodHosts.rb +11 -25
- data/lib/vagrant-goodhosts/plugin.rb +3 -3
- data/lib/vagrant-goodhosts/version.rb +1 -1
- data/vagrant-goodhosts.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f01c22f92849382e5c320c60266b1c5f4cafe4f22f4dfa1675354d15244a4566
|
4
|
+
data.tar.gz: 5519bd1c50e50739e42f096be5744901e023e0dd3ef4b3d2bef6f70ea3212094
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5f38bb5c477970b055e595466e507b9f990ab8bfe355421f162e203edefba8b8c90ae05da25baa78a3b31f8018f73e58c325d11117eba5d3ae68fce14759fb9
|
7
|
+
data.tar.gz: 698212cce5999610ed8e20e8fb90bfb65a44f65132b6f493a176d77109da20346780db40faf8da470b9a19c870bc3647ec98011baf5e5026a2b102a0fa5de9d1
|
data/.rubocop.yml
CHANGED
@@ -10,12 +10,6 @@ module VagrantPlugins
|
|
10
10
|
module GoodHosts
|
11
11
|
def get_ips
|
12
12
|
ips = []
|
13
|
-
|
14
|
-
if @machine.config.vm.networks.empty?
|
15
|
-
@ui.error("[vagrant-goodhosts] No networks are available yet for this virtual machine to add IP/hosts for")
|
16
|
-
return ips
|
17
|
-
end
|
18
|
-
|
19
13
|
@machine.config.vm.networks.each do |network|
|
20
14
|
key, options = network[0], network[1]
|
21
15
|
if options[:goodhosts] == "skip"
|
@@ -23,23 +17,11 @@ module VagrantPlugins
|
|
23
17
|
end
|
24
18
|
ip = options[:ip] if (key == :private_network || key == :public_network) && options[:goodhosts] != "skip"
|
25
19
|
ips.push(ip) if ip
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
options = {
|
33
|
-
vmm_server_address: @machine.provider_config.vmm_server_address,
|
34
|
-
proxy_server_address: @machine.provider_config.proxy_server_address,
|
35
|
-
timeout: timeout,
|
36
|
-
machine: @machine
|
37
|
-
}
|
38
|
-
network = @machine.provider.driver.read_guest_ip(options)
|
39
|
-
if network["ip"]
|
40
|
-
ips.push(network["ip"]) unless ips.include? network["ip"]
|
41
|
-
end
|
42
|
-
end
|
20
|
+
end
|
21
|
+
if @machine.provider_name == :hyperv
|
22
|
+
ip = @machine.provider.driver.read_guest_ip["ip"]
|
23
|
+
@ui.info "[vagrant-goodhosts] Read guest IP #{ip} from Hyper-V provider"
|
24
|
+
ips.push(ip) unless ip.nil? or ips.include? ip
|
43
25
|
end
|
44
26
|
return ips
|
45
27
|
end
|
@@ -105,8 +87,12 @@ module VagrantPlugins
|
|
105
87
|
hostnames = hostnames.split
|
106
88
|
# check which hostnames actually need adding
|
107
89
|
hostnames.each do |hostname|
|
108
|
-
|
109
|
-
|
90
|
+
begin
|
91
|
+
address = Resolv.getaddress(hostname)
|
92
|
+
if address != ip_address
|
93
|
+
hostnames_to_add.append(hostname)
|
94
|
+
end
|
95
|
+
rescue StandardError => _e
|
110
96
|
hostnames_to_add.append(hostname)
|
111
97
|
end
|
112
98
|
rescue StandardError => _e
|
@@ -31,15 +31,15 @@ module VagrantPlugins
|
|
31
31
|
end
|
32
32
|
|
33
33
|
action_hook(:goodhosts, :machine_action_halt) do |hook|
|
34
|
-
hook.
|
34
|
+
hook.prepend(Action::RemoveHosts)
|
35
35
|
end
|
36
36
|
|
37
37
|
action_hook(:goodhosts, :machine_action_suspend) do |hook|
|
38
|
-
hook.
|
38
|
+
hook.prepend(Action::RemoveHosts)
|
39
39
|
end
|
40
40
|
|
41
41
|
action_hook(:goodhosts, :machine_action_destroy) do |hook|
|
42
|
-
hook.
|
42
|
+
hook.prepend(Action::RemoveHosts)
|
43
43
|
end
|
44
44
|
|
45
45
|
action_hook(:goodhosts, :machine_action_reload) do |hook|
|
data/vagrant-goodhosts.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = 'vagrant-goodhosts'
|
7
7
|
s.version = VagrantPlugins::GoodHosts::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.required_ruby_version = '>= 2.
|
9
|
+
s.required_ruby_version = '>= 2.2'
|
10
10
|
s.authors = ['Daniele Scasciafratte']
|
11
11
|
s.email = ['mte90net@gmail.com']
|
12
12
|
s.description = "Enables Vagrant to update hosts file on the host machine with goodhosts"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-goodhosts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniele Scasciafratte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,14 +93,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '2.
|
96
|
+
version: '2.2'
|
97
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
99
|
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
rubygems_version: 3.
|
103
|
+
rubygems_version: 3.3.15
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Enables Vagrant to update hosts file on the host machine with goodhosts
|