vagrant-hostsupdater
vagrant-hostsupdater copied to clipboard
DHCP / Dynamic IP
Am I correct in thinking this plugin does not work for networks that use DHCP?
eg:
config.vm.network "private_network", type: "dhcp"
Seems not - have got around this by using the HostManager plugin instead as that allows us to extend the ip resolver:
if Vagrant.has_plugin?("vagrant-hostmanager")
config.hostmanager.ip_resolver = proc do |vm, resolving_vm|
if vm.id
`VBoxManage guestproperty get #{vm.id} "/VirtualBox/GuestInfo/Net/1/V4/IP"`.split()[1]
end
end
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
config.hostmanager.aliases = [ "wibble.dev" ]
end
This, of course, assumes VirtualBox as the host. See: https://github.com/smdahlen/vagrant-hostmanager/issues/86
@njt1982 I am looking at contributions to get dhcp working well with vagrant-hostsupdater
Would be great if this could be supported. For now I also recommend the solution @njt1982 suggests, thanks.
This has been open since 2015. Does host manager work better still?
This has been open since 2015. Does host manager work better still?
Nope.
Still looking for PRs or attempts at this! I haven't had time yet but feel it would be a great addition to the project.