-
Notifications
You must be signed in to change notification settings - Fork 74
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
Ensure the proxies are configured before vagrant-omnibus etc. #13
Conversation
After trying to understand how the things really work, this seems to be quite complicated. :/ We are now hooking to the The only solution (besides renaming the plugin) that I can think of, is to hook to all @mitchellh, sorry to poke you, but would you have any better ideas? |
e.g. something like this:
|
Sure, but then we will need more and more logic for other (combinations) of plugins that need the proxy configurations to be set. OK, I admit that at the moment I know none that download something on the guest, but with the future of thin boxes I guess it gets more common. Maybe we could just ask (via a PR) @schisamo to hook vagrant-omnibus before the [...] Sigh, after testing that a bit it seems that for some reason the configuration is not loaded even if the shell should be So yet another option. What if Vagrant offered plugins a way to inject environment variable settings in all commands in the SSH communicator plugin, similar to TERM? Then we wouldn't be so dependent on the execution order as we could configure those in a much earlier phase. /cc @mitchellh @fgrehm |
Ugh, stupid me. I didn't set https proxy when testing. So vagrant-omnibus uses the profile.d settings as expected. Sorry. =) |
I created chef-boneyard/vagrant-omnibus#34. |
And closed it too. Of course it doesn't work correctly, as it would wait for the whole So the options seem to be to hook to either VM creation actions or to the omnibus action. I don't like much either one. (Quite epic chat with myself. Hope you have popcorn.) |
@tmatilai I'm in favor of adding the 80% solution by hooking to the omnibus action, unless @mitchellh or @fgrehm have some better ideas how to do this in a more generic way. It's the same arguments for hooking to the btw: +1 for so much transparency by chatting with yourself (no popcorn but pizza is in the oven now ;-)) |
Yeah, lets start with that and change later if we get better ideas, or if Vagrant starts to supports injecting env vars for the commands. I hope to get #14 and this done in the next couple of days, and at least an RC release out right after that. Lets see if the kids and life agree. ;) |
@tmatilai 👍 that woud be awesome :-) |
Ensure the proxies are configured before vagrant-omnibus etc.
Ok folks, I just released v0.4.0.rc1. Can be installed with command:
All testing appreciated. =) |
Thanks @tmatilai! It works as expected, but unfortunately the env proxy settings are not honored with the latest 1.1.0 release of vagrant-omnibus. The culprit lies in this line where the environment is not preserved in the sudo context (it's not However, the latest version in master now omits the anyways unecessary As soon as the next version of vagrant-omnibus is released the proxy settings should take effect. I have created chef-boneyard/vagrant-omnibus#35 requesting an 1.1.1 release -- should be coming out soon (thanks @schisamo!) |
Ah, might be that I tested with the master version only... |
Afaik the bevaviour of env vars when using sudo can be configured in '/etc/sudoers' only (via 'env_reset' and 'env_keep'), at least on Ubuntu. But now that vagrant-omnibus does not pipe to 'sudo bash' anymore it's not an issue anymore. Not sure if there are shell settings for this as well... Anyways, great work 👍,thanks! |
Ah. Now I understand. Yes, I 'm wondering too why /etc/profile.d was not read when 'sudo bash' was called. That's probably a '.profile' or '.bashrc' thing... |
Try to kick in before other plugins so that the proxy settings would take effect for them, too. This would be especially useful with #6 and e.g. vagrant-omnibus plugin.
Thanks to @tknerr for the idea.