Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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...

#!/bin/bash
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?

share|improve this question
add comment

3 Answers

try setting your proxy like this:

#!/bin/bash
export http_proxy=http://my.proxy:3128
puppet apply "$@"
share|improve this answer
add comment

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.

Example:

Vagrant.configure("2") do |config|
  config.proxy.http  = "http://my.proxy:3128"
  config.proxy.https = "http://my.proxy:3128"
  # other configuration...
end
share|improve this answer
add comment

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"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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