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

No access to global settings #20

Closed
schlamar opened this issue Sep 6, 2013 · 3 comments
Closed

No access to global settings #20

schlamar opened this issue Sep 6, 2013 · 3 comments

Comments

@schlamar
Copy link

schlamar commented Sep 6, 2013

I'm setting my proxy in ~/.vagrant.d/Vagrantfile

Vagrant.configure("2") do |config|
  config.proxy.http     = "http://10.10.1.1:4128/"
  config.proxy.https    = "http://10.10.1.1:4128/"
  config.proxy.no_proxy = "localhost,127.0.0.1,.ag.hermle.de"
end

No I want to workaround #19 by reading config.proxy.http in my local Vagrantfile but this returns Object....

How can I read my global proxy configuration in a local Vagrantfile?

@tmatilai
Copy link
Owner

tmatilai commented Sep 6, 2013

Hi Marc,

Unfortunately there is no easy way to access them. Each Vagrantfile is evaluated in a special context and the config objects are merged only at a later phase.

But you can use environment variable. The easiest would be to use the ones vagrant-proxyconf supports. I.e. set

export VAGRANT_HTTP_PROXY="http://10.10.1.1:4128/"

in your shell's rc file or

ENV['VAGRANT_HTTP_PROXY'] = "http://10.10.1.1:4128/"

in your global Vagrantfile. Then in the project specific Vagrantfile you can use for example:

chef.http_proxy = ENV['VAGRANT_HTTP_PROXY']

@tmatilai
Copy link
Owner

tmatilai commented Sep 8, 2013

@schlamar, I'm closing this as this is more of a Vagrant than a plugin issue. Feel free to continue the discussion though. Is the env var approach applicable for you?

@tmatilai tmatilai closed this as completed Sep 8, 2013
@schlamar
Copy link
Author

schlamar commented Sep 8, 2013

@tmatilai I guess with env vars it would work, but I probably don't need it anymore with #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants