vagrant-vmware-dhcp 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23aa2463797ac8ab504cb0f4495de5231272e3fd
4
- data.tar.gz: 5279cdddee8dc659ddd83b1be484f0e30521e0a8
3
+ metadata.gz: 41b94ee9258152c1f4876cd69480f2f5aaf86d34
4
+ data.tar.gz: 9ca0e66e7f97bb066277bad8dccda536c8f2bf07
5
5
  SHA512:
6
- metadata.gz: 7b1b8c1f8db66515829cf6599ce3871748d5768f198fc1d8d68971e1365a7deef0b8eec973bf4b7556547fd38fe1084fc8f7ebff8f7f9310ba332618d99e268b
7
- data.tar.gz: 417eac593215670c8f9e90e337b4bd78152af4941d5bb81d171c34af95cd32446c193702dd89e4adb278dd7fc27bee04d4ee63fc32e4f9d7e5620c88b820b16e
6
+ metadata.gz: 669af463443c20509ea29e71cf05e1e904815e5fea53965da20741598754099188283c27d639723202f8a3500cd851be974002772dee726456bcedd508466c59
7
+ data.tar.gz: c581d528b41c80c62f9523b3f3fe850abf62d700bbbe52a26062adad0a0ffce1e51945f45d75565f078fa61b68ffd55eb7f35f45a8c3f668d06b2045011cc92f
@@ -18,8 +18,7 @@ module VagrantPlugins
18
18
  if @env[:machine]
19
19
  @logger.debug("In config_dhcp provider_name is #{@env[:machine].provider_name}")
20
20
 
21
- # or env[:machine].provider_name == :vmware_workstation
22
- if @env[:machine].provider_name == :vmware_fusion or @env[:machine].provider_name == :vmware_workstation
21
+ if (@env[:machine].provider_name == :vmware_fusion or @env[:machine].provider_name == :vmware_workstation) and @env[:machine].config.control_dhcp
23
22
  configure_dhcp
24
23
  end
25
24
  end
@@ -14,10 +14,12 @@ module VagrantPlugins
14
14
  def call(env)
15
15
  @env = env
16
16
 
17
- machine = env[:machine]
17
+ if @env[:machine]
18
+ machine = @env[:machine]
18
19
 
19
- if machine
20
- set_mac_address(env)
20
+ if (@env[:machine].provider_name == :vmware_fusion or @env[:machine].provider_name == :vmware_workstation) and @env[:machine].config.control_dhcp
21
+ set_mac_address(@env)
22
+ end
21
23
  end
22
24
 
23
25
  @app.call(@env)
@@ -0,0 +1,19 @@
1
+ require_relative "action"
2
+
3
+ module VagrantPlugins
4
+ module VagrantVmwareDhcp
5
+ class Config < Vagrant.plugin(2, :config)
6
+ attr_accessor :enable
7
+
8
+ def initialize
9
+ @enable = false
10
+ end
11
+
12
+ def finalize!
13
+ if @enable != true
14
+ @enable = false
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -9,23 +9,27 @@ module VagrantPlugins
9
9
  Especially nice on multi-vm environments with Windows.
10
10
  DESC
11
11
 
12
+ config(:control_dhcp) do
13
+ Config
14
+ end
15
+
12
16
  action_hook('DA VMWare Network: Configure MAC addresses') do |hook|
13
17
  action = Vagrant::Action::Builtin::ConfigValidate
14
18
  hook.before(action, VagrantVmwareDhcp::Action::SetMac)
15
19
  end
16
20
 
17
- if Vagrant::Util::Platform.windows?
18
- ConfigDhcpClass = VagrantVmwareDhcp::Action::ConfigDhcpWindows
19
- ActionClass = HashiCorp::VagrantVMwaredesktop::Action::Network
20
- elsif Vagrant::Util::Platform.linux?
21
- ConfigDhcpClass = VagrantVmwareDhcp::Action::ConfigDhcpLinux
22
- ActionClass = HashiCorp::VagrantVMwaredesktop::Action::Network
23
- elsif Vagrant::Util::Platform.darwin?
24
- ConfigDhcpClass = VagrantVmwareDhcp::Action::ConfigDhcpDarwin
25
- ActionClass = HashiCorp::VagrantVMwarefusion::Action::Network
26
- end
27
-
28
21
  action_hook('DA VMWare Network: Configure dhcp.conf') do |hook|
22
+ if Vagrant::Util::Platform.windows?
23
+ ConfigDhcpClass = VagrantVmwareDhcp::Action::ConfigDhcpWindows
24
+ ActionClass = HashiCorp::VagrantVMwaredesktop::Action::Network
25
+ elsif Vagrant::Util::Platform.linux?
26
+ ConfigDhcpClass = VagrantVmwareDhcp::Action::ConfigDhcpLinux
27
+ ActionClass = HashiCorp::VagrantVMwaredesktop::Action::Network
28
+ elsif Vagrant::Util::Platform.darwin?
29
+ ConfigDhcpClass = VagrantVmwareDhcp::Action::ConfigDhcpDarwin
30
+ ActionClass = HashiCorp::VagrantVMwarefusion::Action::Network
31
+ end
32
+
29
33
  hook.after(ActionClass, ConfigDhcpClass)
30
34
  end
31
35
 
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module VagrantVmwareDhcp
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
5
  end
@@ -5,6 +5,7 @@ module VagrantPlugins
5
5
  module VagrantVmwareDhcp
6
6
  lib_path = Pathname.new(File.expand_path("../vagrant-vmware-dhcp", __FILE__))
7
7
  autoload :Action, lib_path.join("action")
8
+ autoload :Config, lib_path.join("config")
8
9
 
9
10
  def self.source_root
10
11
  @source_root ||= Pathname.new(File.expand_path("../../", __FILE__))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vmware-dhcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Israel Shirk
@@ -58,6 +58,7 @@ files:
58
58
  - lib/vagrant-vmware-dhcp/action/config_dhcp_linux.rb
59
59
  - lib/vagrant-vmware-dhcp/action/config_dhcp_windows.rb
60
60
  - lib/vagrant-vmware-dhcp/action/set_mac.rb
61
+ - lib/vagrant-vmware-dhcp/config.rb
61
62
  - lib/vagrant-vmware-dhcp/plugin.rb
62
63
  - lib/vagrant-vmware-dhcp/version.rb
63
64
  - locales/en.yml