vagrant-hostmanager
vagrant-hostmanager copied to clipboard
[Help Wanted] Possible to add a list of hostnames and IPs?
Is it possible to add a list of hostnames and IPs to my vagrant box / hostsync with vagrant-hostmanager?
Eg.
config.hostmanager.add_host '10.0.2.3', ['myotherhost.vagrantup.internal', 'myotherhost'] config.hostmanager.add_host '10.0.2.4', ['mysecondhost.vagrantup.internal', 'mysecondhost']
the attached commit allows to use:
config.hostmanager.extra_hosts = [
[
'192.168.42.41', [
'external-box.localdomain',
'subdomain.external-box.localdomain',
]
],
]
To define external hosts entries within the vagrant-hostmanager plugin
I'm very interested in this feature. I would like to test it and give you feedback. How can I install your version? Is there a command to install your version of the plugin?
Hello @utrotzek , I can think of two approaches to install the plugin:
- Download/Compile/Install locally, based on https://github.com/hashicorp/vagrant/issues/1829#issuecomment-19394678
$ git clone https://github.com/javier-lopez/vagrant-hostmanager && cd vagrant-hostmanager
$ rake build
$ vagrant plugin install pkg/vagrant-hostmanager
- Download the upstream code and copy the modified files, https://github.com/devopsgroup-io/vagrant-hostmanager/pull/248/files
@javier-lopez This patch is working for me. Would it be possible to get rid of the outer array structure?
config.hostmanager.extra_hosts = [ '172.28.128.100', ['db.dev']]
instead of
config.hostmanager.extra_hosts = [[ '172.28.128.100', ['db.dev']]]
@foozmeat done, I've also uploaded the modified version to https://rubygems.org/gems/vagrant-hostmanager-ext while (if) the changes get merged.
To test it run:
vagrant plugin uninstall vagrant-hostmanager
vagrant plugin install vagrant-hostmanager-ext
@javier-lopez sorry for the late response. Thanks for the hint and uploading to rubygems.
Unfortunately I get the following error message when running vagrant hostmanager
Vagrant failed to initialize at a very early stage:
The plugins failed to load properly. The error message given is shown below.
cannot load such file -- vagrant-hostmanager-ext
With the original plugin hostmanager v1.8.7
everything works fine.
I installed it using
vagrant plugin uninstall vagrant-hostmanager vagrant plugin install vagrant-hostmanager-ext
Do you have an idea what could be wrong? I have vagrant v1.9.2 installed.