Class: VagrantPlugins::Skytap::SetupHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-skytap/setup_helper.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, environment) ⇒ SetupHelper

Returns a new instance of SetupHelper.


17
18
19
20
21
22
23
24
25
26
27
# File 'lib/vagrant-skytap/setup_helper.rb', line 17

def initialize(env, environment)
  @env = env
  @logger = Log4r::Logger.new("vagrant_skytap::setup_helper")
  @environment = environment
  @machine = env[:machine]
  @provider_config = env[:machine].provider_config
  @username = @machine.config.ssh.username
  @password = @machine.config.ssh.password
  @host = @machine.config.ssh.host
  @port = @machine.config.ssh.port || Net::SSH::Transport::Session::DEFAULT_PORT
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env


10
11
12
# File 'lib/vagrant-skytap/setup_helper.rb', line 10

def env
  @env
end

#environmentObject (readonly)

Returns the value of attribute environment


10
11
12
# File 'lib/vagrant-skytap/setup_helper.rb', line 10

def environment
  @environment
end

#hostObject (readonly)

Returns the value of attribute host


11
12
13
# File 'lib/vagrant-skytap/setup_helper.rb', line 11

def host
  @host
end

#machineObject (readonly)

Returns the value of attribute machine


10
11
12
# File 'lib/vagrant-skytap/setup_helper.rb', line 10

def machine
  @machine
end

#passwordObject (readonly)

Returns the value of attribute password


11
12
13
# File 'lib/vagrant-skytap/setup_helper.rb', line 11

def password
  @password
end

#portObject (readonly)

Returns the value of attribute port


11
12
13
# File 'lib/vagrant-skytap/setup_helper.rb', line 11

def port
  @port
end

#provider_configObject (readonly)

Returns the value of attribute provider_config


10
11
12
# File 'lib/vagrant-skytap/setup_helper.rb', line 10

def provider_config
  @provider_config
end

#usernameObject (readonly)

Returns the value of attribute username


11
12
13
# File 'lib/vagrant-skytap/setup_helper.rb', line 11

def username
  @username
end

Class Method Details

.run!(env, environment) ⇒ Object


13
14
15
# File 'lib/vagrant-skytap/setup_helper.rb', line 13

def self.run!(env, environment)
  new(env, environment).run!
end

Instance Method Details

#current_vmObject


29
30
31
# File 'lib/vagrant-skytap/setup_helper.rb', line 29

def current_vm
  environment.current_vm
end

#run!Object


33
34
35
36
37
# File 'lib/vagrant-skytap/setup_helper.rb', line 33

def run!
  ask_routing
  ask_credentials
  write_properties
end