Skip to content
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

HTTP/HTTPS proxy support? #201

Closed
iancward opened this issue Apr 21, 2017 · 7 comments
Closed

HTTP/HTTPS proxy support? #201

iancward opened this issue Apr 21, 2017 · 7 comments
Labels
Type: Enhancement Adds new functionality.

Comments

@iancward
Copy link

iancward commented Apr 21, 2017

Hello,
I support infrastructure that is behind a firewall which does not allow direct access to the internet. However, we do have HTTP proxies available, and I'm attempting to use Mixlib::Install via pry to make sure it actually works.
Unfortunately, it doesn't not appear to actually work.

[18] pry(main)> options = {
[18] pry(main)*   channel: :stable,
[18] pry(main)*   product_name: 'chef',
[18] pry(main)*   http_proxy: 'http://my.proxy.com:8080',
[18] pry(main)*   https_proxy: 'http://my.proxy.com:8080'
[18] pry(main)* }  
=> {:channel=>:stable,
 :product_name=>"chef",
 :http_proxy=>"http://my.proxy.com:8080",
 :https_proxy=>"http://my.proxy.com:8080"}
[20] pry(main)> mi = Mixlib::Install.new(options).detect_platform
=> #<Mixlib::Install:0x0000000272b350
 @options=
  #<Mixlib::Install::Options:0x0000000272b328
   @errors=[],
   @options=
    {:channel=>:stable,
     :product_name=>"chef",
     :http_proxy=>"http://my.proxy.com:8080",
     :https_proxy=>"http://my.proxy.com:8080",
     :platform_version_compatibility_mode=>true,
     :platform=>"el",
     :platform_version=>"7",
     :architecture=>"x86_64"},
   @original_platform_version=nil>>
[21] pry(main)> mi.available_versions
Errno::ETIMEDOUT: Connection timed out - connect(2) for "packages.chef.io" port 443
from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:879:in `initialize'

My ultimate hope here is that this gem will support http/s proxy and that the chef_client_updater cookbook can be configured to use mixlib::install with a proxy. That way, we can avoid having to use a yum repository mirror of packages.chef.io and have our servers install chef (somewhat) directly via omnitruck.

@wrightp
Copy link

wrightp commented Apr 21, 2017

http_proxy is currently only supported for powershell scripts. This was originally added as a feature for Test Kitchen. I'll add this an enhancement.

@iancward
Copy link
Author

iancward commented May 9, 2017

@wrightp if this is something that I can assist with, please let me know. I'd be happy to see this move along, as installing chef client behind a firewall has never really been easy and the value this feature would provide is beyond measure.

@wrightp
Copy link

wrightp commented May 9, 2017

@iancward I have some time this week to start a PR. Proxy support is a required feature for some work coinciding with Kitchen changes. I'll dig in and see the best way to approach this and I'll mention you on the PR.

@rlaveycal
Copy link
Contributor

As described in the referenced chef_client_updater issue proxy support in the powershell script is broken in that it overrides any environment variable with blank if no value is provided in the options hash 😦

@iancward
Copy link
Author

iancward commented Apr 3, 2018

https://github.com/chef-cookbooks/chef_client_updater/blob/master/CHANGELOG.md#320-2018-01-22 claims that version 3.9.0 of this gem provides proxy support. Is that accurate? I don't see proxy support anywhere in this repository's changelog.

@iancward
Copy link
Author

iancward commented Apr 3, 2018

@wrightp it looks like I accidentally un-assigned you or that my comment changed something with the assignment.

@tas50 tas50 added Type: Enhancement Adds new functionality. and removed enhancement labels Nov 2, 2018
@dheerajd-msys
Copy link

@tas50 @lamont-granquist, It looks like proxy support is added in PR #242 . We may need to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests

6 participants