hmm I get the concept of the wrapper script, though I'm not too sure how/where to implement within Vagrant. I haven't had much luck on the Vagrant forums, so instead I've decided to simply run a Vagrant reload after it fails the first time (that gives puppet the chance to update bashrc with the proxy, subsequent runs work just fine as you'd expect.
I believe puppet not honouring the http_proxy_host option it has is the real issue, though with this workaround in place, I can live with it. On Tuesday, October 2, 2012 12:59:56 AM UTC+10, jcbollinger wrote: > > > > On Sunday, September 30, 2012 11:40:42 PM UTC-5, drew khoury wrote: >> >> May have spoken too soon. >> >> If I set the env variable, and I'm manually logged, then I run puppet all >> is good. >> >> I'm still not clear on how I set the env variable when puppet is invoked >> from Vagrant (this might end up being a question for Vagrant not puppet?). >> > > > Yes, that would be a Vagrant question. You could, however, have Vagrant > invoke a wrapper script that sets the desired variable instead of invoking > "puppet apply" directly. I'm not sure how that differs from what you tried > but it should work. Something like this: > > #!/bin/bash > export http_proxy=my.proxy > puppet apply "$@" > > > >> >> Setting the env variable in a bash script invoked via the puppet manifest >> proved to be useless, as it doesn't have any scope OUTSIDE the bash script. >> > > > Indeed not. That's why you need to put the Puppet invocation inside the > script. > > > >> >> I've tried a combination of setting the variable in /home/vagrant/.bashrc >> AND keeping the env via env_keep in sudoers but I'm not sure I'm >> understanding how Vagrant is invoking Puppet. >> > > > Command runners typically are very careful and selective about the > environment they provide to commands they run. Puppet is a good example, > and likely Vagrant is, too. Such programs normally have a way to configure > the environment for each command along with the command itself, and they > usually provide little or nothing else in those environments. In > particular, they normally do not pass on their own environment to commands. > > > John > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/9JTtpL-CwUIJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.