-
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
Add support for yum proxy configuration #4
Conversation
Seems that https://github.com/opscode-cookbooks/yum/blob/master/templates/default/yum-rhel5.conf.erb#L32 Maybe related? http://lists.centos.org/pipermail/centos/2007-July/041648.html |
I might be wrong, but all I read about yum.conf.d was that it should contain repo configurations. If we can add thing to the |
I am an EL guy. Adding proxy to YUM is as simple as |
Hi Mike, Thanks for the confirmation. Ensuring the |
Definitely would use it.It's a killer for me right now as I'm behind a corporate proxy. |
@imavroukakis Thanks for letting me know. I have a working spike but will need to clean up the code. So it is really coming on some point. =) Do you have just a yum proxy or a generic http proxy? In the latter case you probably want to configure all the box to use the proxy, i.e. use |
Isn't config.proxy dependant upon vagrant-proxyconf? The issue here is that On 23 October 2013 12:56, Teemu Matilainen notifications@github.com wrote:
|
@imavroukakis, here is a long reply which doesn't mean that I wouldn't implement this feature. Just trying to help and understand. =)
vagrant-proxyconf only ever configures the virtual machines, so it won't help you here even if it installed. Vagrant plugins are gems. And Vagrant uses its own custom configuration for Rubygems, so you can't use ~/.gemrc. But you can set the http_proxy="http://my.proxy:8080" vagrant plugin install vagrant-proxyconf Another option is to download the plugin/gem manually from https://rubygems.org/gems/vagrant-proxyconf and install with: vagrant plugin install path/to/vagrant-proxyconf-0.6.0.gem
How is yum invoked? Via a provisioner (chef/puppet/shell?), or after SSH'ing to the box? Is /etc/profile.d/proxy generated correctly? Does |
Not at all, thanks for the tip about Rubygems! Unfortunately I am on a very restricted windows environment, would vagrant look for http_proxy as a windows env var? |
Yes it should work just the same. And in the case of plugins it is not Vagrant but Rubygems. You should be able to set the env var with:
I think @tknerr has more experience here if you can't get it to work. |
Thanks Teemu I'll give it a try. |
@imavroukakis I have had my fun with proxies as well ;-) The differentiation between setting the proxy on the host and on the guest is essential, you can find my notes about it here in the README (note: this was without vagrant-proxyconf at that time) @tmatilai btw there is still value in supporting yum proxy configuration: a colleague recently mentioned that even though yum itself respects the |
@tknerr And another use case is that someone has only a yum cacher proxy (e.g. apt-cacher-ng) that can not be used as a generic http proxy. So definitely I'll hack this up. Just advancing slowly as spare time is limited and I always seem to get stuck with other issues or with IRC. ;) |
Finally I have a seemingly working branch. I would really appreciate all testing, reviewing and comments. For testing you have to install the plugin from source: git clone https://github.com/tmatilai/vagrant-proxyconf.git
cd vagrant-proxyconf
git checkout yum-proxy
<VAGRANT_DIR>/embedded/bin/rake build # or just `rake build` if you have ruby installed
vagrant plugin install pkg/vagrant-proxyconf-0.6.1.dev.gem I'll merge and make a pre-release version soonish unless we find bugs. |
Add support for yum proxy configuration
All right, folks! Now you can test the feature easily by installing a pre-release version:
|
@tknerr by the way, the fastestmirror plugin in CentOS 6.4 seemed to use the env vars just fine on my testing. Maybe your colleague is using some older release? Would be great if you could ask him to test the pre-release version and report back. |
I'm not much of an EL distro guy, but it seems that for yum the proxy configuration goes to /etc/yum.conf.
The tricky part is that in the same conf there are lots of other settings too. So we need for example some ugly sed magic to inject our settings in.