vagrant-vmware-dhcp 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vagrant-vmware-dhcp/action/config_dhcp.rb +8 -6
- data/lib/vagrant-vmware-dhcp/action/config_dhcp_darwin.rb +6 -0
- data/lib/vagrant-vmware-dhcp/action/config_dhcp_linux.rb +6 -0
- data/lib/vagrant-vmware-dhcp/action/config_dhcp_windows.rb +0 -1
- data/lib/vagrant-vmware-dhcp/action/set_mac.rb +4 -4
- data/lib/vagrant-vmware-dhcp/plugin.rb +5 -3
- data/lib/vagrant-vmware-dhcp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e79948a505c5fd7198d8a4e30c31a85acfceea88
|
4
|
+
data.tar.gz: 1e7815abe6fd14a1a535fe7d415cb341fc87592e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 153746f190ba6ad0fb1a71e6310f230407f8fb82f48f66fa0e4ba0c1ad8555ec89025b34e46ecdc2992cb8dd91382723bb906a953898d61103c70a7ba8e9b654
|
7
|
+
data.tar.gz: 4e9b895b4eb3a02f56d0d7efd5f2f8ab5c45dc139c2b05fea877bc55171fdd41edf28d758db886d22bf86ecdae6a528d243b91368538c4f30bbb97f6f0dbdec9
|
@@ -16,9 +16,7 @@ module VagrantPlugins
|
|
16
16
|
@env = env
|
17
17
|
|
18
18
|
if @env[:machine]
|
19
|
-
@
|
20
|
-
|
21
|
-
if (@env[:machine].provider_name == :vmware_fusion or @env[:machine].provider_name == :vmware_workstation) and @env[:machine].config.control_dhcp
|
19
|
+
if @env[:machine].provider_name == :vmware_fusion or @env[:machine].provider_name == :vmware_workstation
|
22
20
|
configure_dhcp
|
23
21
|
end
|
24
22
|
end
|
@@ -105,10 +103,14 @@ module VagrantPlugins
|
|
105
103
|
network_map.each {
|
106
104
|
|mac, network|
|
107
105
|
|
108
|
-
@
|
109
|
-
|
106
|
+
@logger.info("Pruning DHCP configuration for #{network[:ip]}")
|
110
107
|
prune_dhcpd_conf(network)
|
111
|
-
|
108
|
+
|
109
|
+
if machine.config.control_dhcp == true
|
110
|
+
@env[:ui].info("Configuring DHCP for #{network[:ip]} on #{network[:vnet]}")
|
111
|
+
|
112
|
+
write_dhcpd_conf(network)
|
113
|
+
end
|
112
114
|
}
|
113
115
|
|
114
116
|
trigger_dhcpd_update
|
@@ -25,6 +25,9 @@ module VagrantPlugins
|
|
25
25
|
|
26
26
|
mac = network[:mac]
|
27
27
|
|
28
|
+
before = File.open(conf_location).read
|
29
|
+
@logger.debug("Before altering, dhcpd.conf content is #{before}")
|
30
|
+
|
28
31
|
command = []
|
29
32
|
command << "sudo" if !File.writable?(conf_location)
|
30
33
|
command += [
|
@@ -36,6 +39,9 @@ module VagrantPlugins
|
|
36
39
|
]
|
37
40
|
|
38
41
|
system(*command)
|
42
|
+
|
43
|
+
after = File.open(conf_location).read
|
44
|
+
@logger.debug("After, dhcpd.conf content is #{after}")
|
39
45
|
end
|
40
46
|
|
41
47
|
def write_dhcpd_conf(network)
|
@@ -25,6 +25,9 @@ module VagrantPlugins
|
|
25
25
|
|
26
26
|
mac = network[:mac]
|
27
27
|
|
28
|
+
before = File.open(conf_location).read
|
29
|
+
@logger.debug("Before altering, dhcpd.conf content is #{before}")
|
30
|
+
|
28
31
|
command = []
|
29
32
|
command << "sudo" if !File.writable?(conf_location)
|
30
33
|
command += [
|
@@ -36,6 +39,9 @@ module VagrantPlugins
|
|
36
39
|
]
|
37
40
|
|
38
41
|
system(*command)
|
42
|
+
|
43
|
+
after = File.open(conf_location).read
|
44
|
+
@logger.debug("After, dhcpd.conf content is #{after}")
|
39
45
|
end
|
40
46
|
|
41
47
|
def write_dhcpd_conf(network)
|
@@ -15,9 +15,7 @@ module VagrantPlugins
|
|
15
15
|
@env = env
|
16
16
|
|
17
17
|
if @env[:machine]
|
18
|
-
machine
|
19
|
-
|
20
|
-
if (@env[:machine].provider_name == :vmware_fusion or @env[:machine].provider_name == :vmware_workstation) and @env[:machine].config.control_dhcp
|
18
|
+
if (@env[:machine].provider_name == :vmware_fusion or @env[:machine].provider_name == :vmware_workstation)
|
21
19
|
set_mac_address(@env)
|
22
20
|
end
|
23
21
|
end
|
@@ -39,7 +37,9 @@ module VagrantPlugins
|
|
39
37
|
|
40
38
|
def mac_from_ip(ip)
|
41
39
|
sha = Digest::SHA256.hexdigest ip
|
42
|
-
|
40
|
+
|
41
|
+
# VMWare doesn't like odd values for the first octet.
|
42
|
+
mac = "AA" + sha.scan(/.{10}/)[0]
|
43
43
|
|
44
44
|
mac
|
45
45
|
end
|
@@ -19,12 +19,14 @@ module VagrantPlugins
|
|
19
19
|
end
|
20
20
|
|
21
21
|
action_hook('DA VMWare Network: Configure dhcp.conf') do |hook|
|
22
|
-
if
|
22
|
+
if defined?(ActionClass) and defined?(ConfigDhcpClass)
|
23
|
+
# no-op
|
24
|
+
elsif Vagrant::Util::Platform.windows?
|
23
25
|
ConfigDhcpClass = VagrantVmwareDhcp::Action::ConfigDhcpWindows
|
24
|
-
ActionClass = HashiCorp::
|
26
|
+
ActionClass = HashiCorp::VagrantVMwareworkstation::Action::Network
|
25
27
|
elsif Vagrant::Util::Platform.linux?
|
26
28
|
ConfigDhcpClass = VagrantVmwareDhcp::Action::ConfigDhcpLinux
|
27
|
-
ActionClass = HashiCorp::
|
29
|
+
ActionClass = HashiCorp::VagrantVMwareworkstation::Action::Network
|
28
30
|
elsif Vagrant::Util::Platform.darwin?
|
29
31
|
ConfigDhcpClass = VagrantVmwareDhcp::Action::ConfigDhcpDarwin
|
30
32
|
ActionClass = HashiCorp::VagrantVMwarefusion::Action::Network
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-vmware-dhcp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Israel Shirk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|