-
Notifications
You must be signed in to change notification settings - Fork 164
Unable to use Vagrant driver behind corporate http proxy #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
Comments
Can you show me more about your http_proxy vars? I'm sure it's options I'm missing. |
Sure, these are set in my env:
And this is in my knife.rb:
I know it's working to some degree because without then no_proxy 127.0.0.1 I'm unable to connect to chef-zero and it bombs out way earlier.
And these are my recipes:
|
@ndobson From the information it looks like you're running chef-zero with vagrant all on the same machine. If that's the case, what are the proxy settings for? |
I am confused by the http_proxy setting with the stars ... the http_proxy variable in chef metal fog appears to be looking for the actual IP of the proxy server. Do you have a variable that indicates that? Setting http_proxy to that in knife.rb might be the right thing. |
@jkeiser I substituted the stars for the actual ip address I'm using cause i didn't want to post that here :-) |
Oh! Ha, ok |
I think the issue is the http at the front. For better or worse, the person who added gateway support assumed the scheme would not be on there. Is that a standard format? You can see the documentation I happened to add just today at https://github.com/opscode/chef-metal/blob/master/lib/chef_metal/transport/ssh.rb . If your format is a standard let's get a patch in there to recognize both! Regardless, you might want to try to try removing the scheme and the colon slash slash just to see if it works. |
@jkeiser I don't think this issue has to do with ssh gateways, please see my pull request which handles proxying for the metadata download and fixes my issue. |
@ndobson odd--it still looks like https://github.com/opscode/chef-metal/blob/master/lib/chef_metal/transport/ssh.rb#L247-249 won't parse your proxy right though ... |
@jkeiser I'm a little confused by your comment, I'm using the vagrant driver connecting to localhost so I don't need an ssh gateway to connect to my cluster nodes. I only need an http_proxy to connect out to the internet. |
ah, so this is about configuring chef so it can download the client? I'd still like to know if yours is a kind of standard format for proxy so we can support it in gateways, but thanks for sorting me out on your context :) |
You're using Ruby 1.9.3 which doesn't automatically honor the http_proxy environment variable, 2.0+ will automatically use that environment variable when making Net::HTTP calls So, this fix will make 1.9.3 work - another fix is to use 2.0+ |
Yeah that is definitely standard format for defining an http_proxy https://docs.getchef.com/config_rb_client.html @johnewart Ahhhhh yeah that makes sense, I saw in the Net:HTTP doc that it's supposed to automatically use it but I was wondering why that wasn't happening, thanks! Either way merging this pull request shouldn't break anything, it'll just fix functionality for ruby 1.9.3. |
I agree that it won't break anything, but it potentially means we have proxy support in one place in 1.9 but not in others so it might make sense to throw together a quick wrapper for reuse and be thorough. Also, any idea if this will this support an HTTPS proxy in 1.9? |
My http_proxy env vars are set properly but unless I'm missing some Vagrant driver specific config, I'm unable to setup a basic vagrant machine. It fails on getting the machine metadata. Please see the stacktrace below:
The text was updated successfully, but these errors were encountered: