-
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
Provision falsely claim to add domain to hosts file #917
Comments
So did a bit more digging and found that the output from
|
The hosts logic in the provisioning script adds hosts to the internal hosts file (the guest). The hostsupdater plugin, which adds hosts entries to the external (the host) machine, runs prior to provisioning. The only way to add hosts via the hostsupdater if you create the vvv-hosts file during provisioning is to run This is generally why there are tools like vv or my generator-vvv which work to create those files outside the VM before running vagrant commands or provisioning scripts. |
@lkwdwrd Thanks for some clarification.. Is there a reason why it would need to run before the provision script? If it's only task is to add entries to the external machine it seems it could just as well run after the provision script. I'm not really keen on piling on more tools to a workflow that already works great for us just for this caveat. We've also customized the provisioning to work for us with composer loading in private repos etc. |
I don't think it's necessarily a requirement, but hostsupdater is a vagrant plugin and I'm not much of a rubyist, nor have I dug into the depths of vagrant to see if there is a later hook available. The hostsupdater plugin is also somewhat abandoned at this point, one of the reasons I'd like to see us replace it with Vagrant Ghost - a more updated fork of the plugin. That still runs on the same hook, though, not after provisioning. |
Also, to be it clear -- Vagrant Hostsupdater and Vagrant Ghost are separate projects from VVV, so it's not really something this project can change. |
Yeah. Sorry if I sounded snarky :) I know they're separate projects but like you I'm not much of a rubyist so I figured I throw out the question. Now I got your two cents and it sounds like I'll be keeping the vvv-hosts file. No biggie! |
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. |
Hey!
Been experimenting with dynamically creating the necessary files for nginx and hostsupdater.
Creating the nginx conf file works great!
However creating the
vvv-hosts
file causes trouble.The file is created and it seems to be located BUT even tho the output claims that it's being added to the hosts file on my local mac it is not. I have to run
vagrant reload
for it to actually get written.So while the output from doing a
vagrant provision
says:==> default: * Added testing.wordpress.dev from /srv/www/projects/testing/vvv-hosts
it does not. If I immediately after the provision run a
vagrant reload
this is output:==> default: adding to (/etc/hosts) : 192.168.50.4 testing.wordpress.dev # VAGRANT: fc2950b8c4cf1501bfc5aecbd3f2c632 (default) / 58fec294-5584-4dfd-bf5a-9878f76900b8
and it actually gets added.
I figure this must be something in either VVV or the hostsupdater plugin? To me it sounds like the actual update of /etc/hosts happens before the file is created and then the output to the terminal happens after the file is created?
Anyone with any ideas on this? Would love to be able to create the vvv-hosts file dynamically as well.. then it would just be the .sh file (and our own composer file) for each new project.
thanks!
The text was updated successfully, but these errors were encountered: