-
Notifications
You must be signed in to change notification settings - Fork 848
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
Automate adding hosts entries #140
Comments
At first glance, I like something like Vagrant DNS more… so the DNS works on the host machine and the Vagrant. |
This is true. I use Puppet personally, which has a Reasons for hostupdater over Vagrant DNS:
Reasons for Vagrant DNS over hostsupdater:
|
We're planning to use hostsupdater + a bit of Ruby to populate the array based on the contents of the |
Big +1 for hostsupdater. I think the only barrier with VVV is streamlining the process with which the plugin is installed. We could consider making it a required installation step, but it'd be really slick to quietly skip over it if not available. I'm sure there has to be an Also +1 for the Salty way. I'm sure there's a way to read a config file, possibly one that goes hand in hand with #100. If we have to edit @simonwheatley - I've thought about using some kind of internal DNS setup because it is appealing. I think there are too many wildcards for what domains could be setup for testing (I hardly use |
There's Bindler, a plugin for managing plugin dependencies. This would be fantastic if it didn't become a dependency of its own. :) |
Working with this right now and it appears to work. Will have something to test soon. if defined? VagrantPlugins::HostsUpdater config.hostsupdater.aliases = ["hithere.com"] end |
If the hostsupdater plugin is installed, we add the domains used by VVV to the local machine's hosts file. If the hostsupdater plugin is not installed, no hosts file changes are made and no errors are thrown. In the near term we'll want to work on a way to pull these aliases in from some kind of config file that can be maintained locally so that Vagrantfile can be updated with ease. For now - if you'd like to add more aliases and don't want to worry about merging new commits from the master repo, the best bet may be to maintain a Customfile with an additional config line for `config.hostsupdater.aliases`. Addresses #140, may likely fix it. I was too lazy to make a pull request, I'm sorry. :)
Thanks for the prod, @rmccue, this is lovely. ✨ |
At first glance, I like something like Vagrant DNS more… so the DNS works on the host machine and the Vagrant. I think we can accomplish this once we have a local config file containing the aliases. It can be parsed via script inside |
Sounds great. @danielbachhuber's comment above about populating from some |
My concern here is..... do any of these solutions work on Windows? |
My concern here is..... do any of these solutions work on Windows? Yup, Vagrant Hostsupdater is cross platform. Definitely need some Windows users to test it though. Working great on OSX so far. |
Excellent - would love to hear from a Windows user who could test this! |
Ping @westonruter or @ericmann - you guys up for testing this out? |
I am _NOT_ on Windows ❗❗❗ |
ROFL |
Woops. :) How about @rclilly? |
Part of me wants to ping Linus on this thread just to see what would happen... |
@ericmann is out of town for the next 2 weeks - he is usually my go-to |
@jeremyfelt @TheLastCicada Yes, I am on Windows! I'll look this over and give it a go and report back. |
The vagrant-hostupdater gets a "Permission denied" error and creation of the VM fails. Here are the steps I took and the results:
Relevant excerpt from the bash window: "Provisioning complete in 2420 seconds I followed this with An unrelated error which occurred is: If you're seeing this message, either a Gruntfile wasn't found or grunt |
I am also a Windows user. :) Since Windows doesn't have sudo or similar, you have to make your hosts file world-writable. Once that's done, it works perfectly. |
Update: opened the bash window/command prompt with "Run as Administrator" and did Maybe we need to update the instructions for Windows users to always make sure the command prompt/bash window is opened with elevated privileges? @rmccue How does one make the hosts file world-writable in Windows? |
Update to the update: Verified that the entries to the hosts file are removed upon |
@rclilly Actually, I didn't make it world-writable, but I gave my user the permissions to edit it without being admin. The easiest way to do it is: Properties -> Security -> Edit -> Add -> [your user] -> Full Control. Note that when running via Cygwin using PuTTY, you can't run as an administrator, so you need this. For normal users though, running as admin should be fine. |
Seems like we're good to go here, so I'm going to close this out. |
A note for handling this in the future... Vagrant 1.3.0 will have |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Step 7 of The First Vagrant Up says:
This sucks. 👎
On the other hand, vagrant hostsupdater:
This does not suck. ✨
You can even specify more than one:
Although interestingly, Vagrant does error if you don't have the plugin installed.⚠️ (I'm still investigating how to have this not happen; if anyone has any ideas, please let me know.)
Verdict?
The text was updated successfully, but these errors were encountered: