Class: VagrantPlugins::CORL::Action::LinkNetwork

Inherits:
BaseAction
  • Object
show all
Defined in:
lib/core/vagrant/actions/link_network.rb

Instance Attribute Summary

Attributes inherited from BaseAction

#network, #node, #vm

Instance Method Summary collapse

Methods inherited from BaseAction

#initialize

Constructor Details

This class inherits a constructor from VagrantPlugins::CORL::BaseAction

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/core/vagrant/actions/link_network.rb', line 7

def call(env)
  super do
    env[:ui].info I18n.t("corl.vagrant.actions.link_network.start")
    
    vm.communicate.tap do |comm|
      # TODO: Figure out a better solution for remote network path.
      # Needs to work before facter and corl are installed
      # Local searches of remote configurations in the project perhaps?
      network_path = ::CORL::Config.fact(:corl_network)
      
      # Make sure the CORL network directory is properly set up
      # Vagrant root (project) directory is shared by default
      comm.sudo("rm -Rf #{network_path}")
      comm.sudo("ln -s /vagrant #{network_path}")
    end
    @app.call env
  end
end