tmatilai / vagrant-proxyconf

Vagrant plugin that configures the virtual machine to use proxies
MIT License
531 stars 74 forks source link

Proxy setting not removed from yum.conf properly #146

Closed bertramn closed 7 years ago

bertramn commented 8 years ago

Hi there,

I have been using the proxy plugin recently but noticed that it does fail to remove the proxy settings from the yum.conf file properly. The configuration in my Vagrantfile is pretty straight forward:

if ENV['PROXY_ENABLED'] == 'true'
  config.proxy.enabled = { apt: false, chef: false, docker: false, git: false, npm: false, pear: false, svn: false}
  config.proxy.http     = "http://proxy:3128"
  config.proxy.https    = "http://proxy:3128"
else
  config.proxy.enabled = false
  config.proxy.http     = ""
  config.proxy.https    = ""
end

So when my environment variable is not true, it should clear out the /etc/yum.conf file but instead of removing or blanking out the proxy variable it sets the proxy property to _none_.

...
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
proxy=_none_
proxy_username=
proxy_password=

This is with an Oracle Linux 6 basic image from boxcutter. Looks to me like a bug in the module responsible to configure the yum.conf file. Any thoughts or suggestions?

Cheers, Niels

tmatilai commented 8 years ago

Hi,

Setting config.proxy.enabled to false disables the whole plugin, so it should not do anything. Could you paste the output that happening?

And that _none_ really is the way to unset the proxy setting according to yum man page on CentOS. Does it not work for you?

bertramn commented 7 years ago

Confirmed that setting config.proxy.http = "" will result in disabling the proxy for yum. Answer https://superuser.com/a/434255 confirms that yum will not use environment variables. Another issue one might face is that /etc/sysconfig/rhn/up2date also needs updating if someone is using a spacewalk server through a proxy. But that's a different conversation.