Closed jperville closed 9 years ago
Thanks, this really seems like a bug. I don't use multi-vm setups so it never hit me. Are you willing to try to fix this? =)
HI @tmatilai, I'd love to help fix that issue; it looks doable even for someone with limited experience of Vagrant plugins like me. I should have some free time around Christmas and will look into it.
For the moment I work around the issue with a chef.custom_config_path
containing the following:
http_proxy ENV['http_proxy'] unless String(ENV['http_proxy']).empty?
https_proxy ENV['https_proxy'] unless String(ENV['https_proxy']).empty?
ftp_proxy ENV['ftp_proxy'] unless String(ENV['ftp_proxy']).empty?
no_proxy ENV['no_proxy'] unless String(ENV['no_proxy']).empty?
@jperville great! Feel free to ping if you have questions.
I have submitted a very modest PR (#103), which should do the trick. I can't believe that it was as easy as detecting the chef provisioners on the type
attribute rather than on the name
one.
I have done some investigation and it seems that:
I updated my fix to detect the chef provisioner using the type method (if responds_to?), with fallback to the name method). I also reported the issue to Vagrant (mitchellh/vagrant#5069).
It seems that the chef proxy settings are not applied when the Vagrantfile defines more than one VM.
When the Vagrantfile defines a single VM (with
config.vm.provision :chef_solo
etc) I can find the expected*_proxy
entries in/tmp/vagrant-chef-2/solo.rb
.However, when the Vagrantfile defines several VMs (as below), all the
*_proxies
entries in/tmp/vagrant-chef-2/solo.rb
are set to nil.I believe the reason lies in https://github.com/tmatilai/vagrant-proxyconf/blob/master/lib/vagrant-proxyconf/action/configure_chef_proxy.rb#L46 where the
chef_provisioners
method only scans 'config.vm.provisionners' and not the per-VM provisionners.I found out about the issue because it my 'remote_file' resources suddenly broke while I was refactoring a huge VM into several smaller ones (my firewall blocks non-proxied http requests).