I'm trying to run a puppet manifest which depends on the target machine having proxy settings to access the Internet.

I haven't been able to pass http_proxy_host as Puppet suggests (I believe its a bug?).

I've tried to update .bashrc on my Debian box (through the puppet manifest) though I'm not sure how to get the settings to take the first time round.

Instead I believe a solution would be to set/pass the env var http_proxy however I'm not sure how/where to do this with Vagrant.

https://groups.google.com/d/msg/puppet-users/2aivOoYHwZ0/rjRkJx1zdjQJ suggests using a wrapper like so...

export http_proxy=my.proxy
puppet apply "$@"

I'm not 100% sure where to do this, or if this is the best solution.

Surely I'm not the only one trying to use Vagrant/Puppet & Proxies?

3 Answers 3


try setting your proxy like this:

export http_proxy=http://my.proxy:3128
puppet apply "$@"

I use a shell provisioner in my Vagrantfile before the Puppet provisioner:

config.vm.provision :shell, :inline => "echo 'export http_proxy=http://proxy.company.com:3128' >> /etc/profile.d/proxy.sh"

I'm a bit biased, but I would recommend using vagrant-proxyconf plugin. To configure all Vagrant machines, you can use $HOME/.vagrant.d/Vagrantfile or environment variables. This way you don't need to modify all project specific Vagrantfiles.


Vagrant.configure("2") do |config|
  config.proxy.http  = "http://my.proxy:3128"
  config.proxy.https = "http://my.proxy:3128"
  # other configuration...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.