Class: VagrantPlugins::Skytap::SetupHelper
- Defined in:
- lib/vagrant-skytap/setup_helper.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#host_vm ⇒ Object
readonly
Returns the value of attribute host_vm.
-
#machine ⇒ Object
readonly
Returns the value of attribute machine.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#provider_config ⇒ Object
readonly
Returns the value of attribute provider_config.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
- #current_vm ⇒ Object
-
#initialize(env, environment) ⇒ SetupHelper
constructor
A new instance of SetupHelper.
- #run! ⇒ Object
- #running_in_skytap_vm? ⇒ Boolean
Constructor Details
#initialize(env, environment) ⇒ SetupHelper
Returns a new instance of SetupHelper.
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 39 def initialize(env, environment) @env = env @logger = Log4r::Logger.new("vagrant_skytap::setup_helper") @environment = environment @host_vm = env[:vagrant_host_vm] @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
#env ⇒ Object (readonly)
Returns the value of attribute env.
32 33 34 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 32 def env @env end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
32 33 34 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 32 def environment @environment end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
33 34 35 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 33 def host @host end |
#host_vm ⇒ Object (readonly)
Returns the value of attribute host_vm.
32 33 34 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 32 def host_vm @host_vm end |
#machine ⇒ Object (readonly)
Returns the value of attribute machine.
32 33 34 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 32 def machine @machine end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
33 34 35 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 33 def password @password end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
33 34 35 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 33 def port @port end |
#provider_config ⇒ Object (readonly)
Returns the value of attribute provider_config.
32 33 34 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 32 def provider_config @provider_config end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
33 34 35 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 33 def username @username end |
Class Method Details
.run!(env, environment) ⇒ Object
35 36 37 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 35 def self.run!(env, environment) new(env, environment).run! end |
Instance Method Details
#current_vm ⇒ Object
52 53 54 55 56 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 52 def current_vm if @environment && @machine @environment.get_vms_by_id([@machine.id]).first end end |
#run! ⇒ Object
62 63 64 65 66 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 62 def run! ask_routing ask_credentials write_properties end |
#running_in_skytap_vm? ⇒ Boolean
58 59 60 |
# File 'lib/vagrant-skytap/setup_helper.rb', line 58 def running_in_skytap_vm? !!host_vm end |