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

Update host's /etc/hosts file too #4

Open
kindkid opened this issue May 28, 2013 · 11 comments
Open

Update host's /etc/hosts file too #4

kindkid opened this issue May 28, 2013 · 11 comments

Comments

@kindkid
Copy link

kindkid commented May 28, 2013

It'd be nice if this gem also updated the host machine's /etc/hosts file too. It may be worth looking at ghost ( https://github.com/bjeanes/ghost ) for integration/inspiration.

@adrienthebo
Copy link
Member

👍 for this behavior. I was thinking of that initially when I worked on this, and I started building out a primitive driver layer so that hosts could be provisioned with the same code as guests.

However, writing to /etc/hosts is going to require superuser permission. How would you like to see that handled? On a VM it's easy to do since you can just sudo automatically, but gaining privileges on the host seems more ungainly.

@nickchappell
Copy link

Handling it the same way NFS mounts are done (asking for it when the VM is being brought up) would be fine with me. Since it doesn't take very long to bring up VMs, if NFS asks for sudo creds first, they'll probably still be cached when you go to edit the host's /etc/hosts.

@reidmv
Copy link
Contributor

reidmv commented Sep 16, 2013

Implement it as a command, seems the sanest. Makes it available when needed/wanted without otherwise getting in the way.

@metcalfc
Copy link
Contributor

I'd be fine with a command that just echo'd the lines al la vagrant ssh-config.

@reidmv
Copy link
Contributor

reidmv commented Oct 30, 2013

...optionally in Puppet syntax? vagrant hosts puppetize | sudo puppet apply :-)

@metcalfc
Copy link
Contributor

That was my plan. I'm working on this now.

vagrant hosts and vagrant hosts puppetize

@metcalfc
Copy link
Contributor

Submited a pr in #18. Adds the basic support for this. Probably could expand on this to be smarter. But this is a start.

@adrienthebo
Copy link
Member

Since GH-18 is merged this is partially solved. The next steps will be automatically updating the host with this information.

@matthewbarr
Copy link

Might be interesting to look at https://github.com/smdahlen/vagrant-hostmanager , since this does similar things.

@denizdogan
Copy link

I just found this plugin after having problems with vagrant-hostmanager and I guess we could just copy the method that that plugin uses to implement this. The only reason I use a plugin like this in the first place is to update /etc/hosts on my host machine so that I can use easy-to-remember hostnames for accessing my VMs.

@utrotzek
Copy link

That feature would be nice! Especially because vagrant-hostmanager does not support IP to hostname mapping for multiple IP's on the same host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants