mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Merge pull request #1036 from zakame/public_address-provider-capability
Add public_address provider capability
This commit is contained in:
commit
f1b0c9a460
16
lib/vagrant-libvirt/cap/public_address.rb
Normal file
16
lib/vagrant-libvirt/cap/public_address.rb
Normal file
@ -0,0 +1,16 @@
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Cap
|
||||
class PublicAddress
|
||||
def self.public_address(machine)
|
||||
# This does not need to be a globally routable address, it
|
||||
# only needs to be accessible from the machine running
|
||||
# Vagrant.
|
||||
ssh_info = machine.ssh_info
|
||||
return nil if !ssh_info
|
||||
ssh_info[:host]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -39,6 +39,11 @@ module VagrantPlugins
|
||||
Cap::NicMacAddresses
|
||||
end
|
||||
|
||||
provider_capability(:libvirt, :public_address) do
|
||||
require_relative 'cap/public_address'
|
||||
Cap::PublicAddress
|
||||
end
|
||||
|
||||
# lower priority than nfs or rsync
|
||||
# https://github.com/vagrant-libvirt/vagrant-libvirt/pull/170
|
||||
synced_folder('9p', 4) do
|
||||
|
Loading…
Reference in New Issue
Block a user