Module: VagrantPlugins::ProviderVirtualBox::Action

Defined in:
lib/vagrant-sptsync/plugin.rb

Class Method Summary collapse

Class Method Details

.action_reloadObject

Re-ad the routes when reloading.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/vagrant-sptsync/plugin.rb', line 23

def self.action_reload
  puts "reloading routes"
  Vagrant::Action::Builder.new.tap do |b|
    b.use CheckVirtualbox
    b.use Call, Created do |env1, b2|
      if !env1[:result]
        b2.use MessageNotCreated
        next
      end

      b2.use ConfigValidate
      b2.use action_halt
      # TODO: Figure out how to get the IPs dynamically.
      system("sudo route -nv add -net 10.10.10.0/24 -interface vboxnet0")
      b2.use action_start
    end
  end
end