Class: VagrantPlugins::GuestIP::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/command.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.synopsisObject



4
5
6
# File 'lib/command.rb', line 4

def self.synopsis
  'outputs IP address of a guest machine'
end

Instance Method Details

#executeObject



8
9
10
11
12
13
14
# File 'lib/command.rb', line 8

def execute
  with_target_vms(nil, {:single_target=>true}) do |machine|
    ip = machine.guest.capability(:read_ip_address)
    message = ENV['TEAMCITY_VERSION'] ? "##teamcity[setParameter name='env.VAGRANT_GUESTIP' value='#{ip}']" : ip
    @env.ui.info(message)
  end
end