-
Notifications
You must be signed in to change notification settings - Fork 2
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
Development domains don't work #2
Comments
I wasn't happy with the state of my code — very much hardcoded junk that I've just been manually changing. Here is a much better solution! |
That looks perfect—thanks so much, Mark! |
Also, it looks like Vagrant plugins are installed globally, and there is no canonical way to install them from within a Vagrantfile. So this is what I rigged up: # Install the required plugins
def require_plugin plugin
puts `cd ~/ >/dev/null && vagrant plugin install #{plugin}` unless `cd ~/ && vagrant plugin list`.chomp.split("\n").select{|x| x.include? plugin}.length > 0
end
require_plugin 'vagrant-hostsupdater' Why the |
This works a charm! config.vm.hostname = "example.com"
config.vm.network :private_network, :ip => "192.168.50.4"
config.hostsupdater.aliases = %w{www.example.com foo.example.com}
config.hostsupdater.remove_on_suspend = true Don't forget the |
Per #2. This still doesn't work (it fails with `Unknown configuration section 'hostsupdater'.`), but it's a step in the right direction.
@markjaquith I could not get the hostupdater plugin to work with Vagrant 1.3.4. Did it definitely work for you? What OS are you using? |
Definitely works. OS X. |
@markjaquith I just re-downloaded statedecoded-vagrant and ran Vagrant:
* Unknown configuration section 'hostsupdater'. Here is asciinema of it: http://asciinema.org/a/5834 |
Seems to work if I install the plugin from the host command line before running bash-3.2$ vagrant plugin install vagrant-hostsupdater
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...
Installed the plugin 'vagrant-hostsupdater (0.0.10)'!
bash-3.2$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'precise64'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
... |
Huh. Odd. That code snippet I provided should have auto-installed it if it wasn't present. |
I previously tried a variety of ways to have vagrant install the plugin from within running the file but with no luck either so far. Have you tried uninstalling the plugin on you system and then running The plugins would be awesome if Vagrant installed them while running the Vagrantfile. (And a bit odd vagrant does not considering how much automated magic it does. |
@gregelin, this might call for opening a ticket on @Cogitatio's repository for Vagrant::Hostsupdater. Getting a development domain working isn't crucial for The State Decoded, but it's surely going to be important for y'all to be able to get working reliably! |
PuPHPet insists on setting up a VirtualHost, but that necessitates editing
/etc/hosts
in order to map that virtual host properly. @markjaquith has somelocaldev
Vagrant code that will resolve that. This may, as a result, resolve #1, too.The text was updated successfully, but these errors were encountered: