Last modified: 2014-09-09 20:23:21 UTC
Ram and port forwarding broke again for me this afternoon so I decided to do a from scratch setup - clone mediawiki-vagrant and follow the instructions and everything. I created the machine, added the cirrus role, reprovisioned it, and the port forward and ram change are not taking effect no matter how many times I `vagrant provision` or `vagrant reload`.
Nik clarified on irc that the settings he's not seeing take effect are the ones set by the cirrussearch role.
I added a bunch of logging to my mediawiki-vagrant plugin to try and debug this. Unfortunately I can't recreate the problem. For me, settings in .settings.yaml made with `vagrant configure vagrant_ram N` work. Settings in vagrant.d/10-cirrussearch.yaml also work. Note that `vagrant config --get vagrant_ram` will not show values which are set via vagrant.d/*.yaml as it only reads data from .settings.yaml.
Created attachment 16232 [details] Hacky debug logging patch for lib/mediawiki-vagrant/settings.rb Apply patch and run `./setup.sh` to activate. You should get a lot of messages to stdout describing the activity of settings resolution.
Looking at the coercion of vagrant_ram and the order in which settings files are loaded (vagrant.d/*.yaml then .settings.yaml), a setting in the latter will always take precedence. We can either: 1) change the order so that entries from vagrant.d override those from .settings.yaml; or 2) change the coercion for vagrant_ram to take the greater of the old or new value—currently, it takes the greater of the new and _default_ value. Keep in mind that option 2 introduces the side effect that one can't lower vagrant_ram; it can only go up! I'm not sure why forward_ports would break in this same way but I'll take a closer look.
(In reply to Dan Duvall from comment #4) > 2) change the coercion for vagrant_ram to take the greater of the old > or new value—currently, it takes the greater of the new and _default_ > value. Keep in mind that option 2 introduces the side > effect that one can't lower vagrant_ram; it can only go up! I'm pretty sure that this was my original logic (take the largest value found anywhere). Who wants less ram? :)
Easy enough! I'll submit a patch. FWICT, foward_ports in .settings.yaml _is_ being merged correctly with the hash in vagrant.d/10-cirrussearch.yaml.
Change 154975 had a related patch set uploaded by Dduvall: Use the largest of all configured vagrant_ram values https://gerrit.wikimedia.org/r/154975
So I just checked .settings.yml and now it has the right stuff in it - 2GB of ram and the port forwarding. I don't know what it had before but _something_ put the right stuff in it now. And reloading the vm added the ram and set up the port forwarding. I really have no idea why it wasn't taking before.
Change 154975 merged by jenkins-bot: Use the largest of all configured vagrant_ram values https://gerrit.wikimedia.org/r/154975