Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added public_address provider capability #130

Merged
merged 2 commits into from
Jul 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/vSphere/cap/public_address.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module VagrantPlugins
module VSphere
module Cap
module PublicAddress
def self.public_address(machine)
return nil if machine.state.id != :running

ssh_info = machine.ssh_info
return nil unless ssh_info
ssh_info[:host]
end
end
end
end
end
5 changes: 5 additions & 0 deletions lib/vSphere/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class Plugin < Vagrant.plugin('2')
Provider
end

provider_capability('vsphere', 'public_address') do
require_relative 'cap/public_address'
Cap::PublicAddress
end

def self.setup_i18n
I18n.load_path << File.expand_path('locales/en.yml', VSphere.source_root)
I18n.reload!
Expand Down