Hi, I''ve been trying to pass the http_proxy_host option to puppet but it''s not taking. I have tried the following: sudo puppet apply --debug --verbose --http_proxy_host user:pass@fqdn.com.au --modulepath ''/tmp/vagrant-puppet/modules-0'' /tmp/vagrant-puppet/manifests/default.pp sudo puppet apply --debug --verbose --http_proxy_host=user:pass@fqdn.com.au --modulepath ''/tmp/vagrant-puppet/modules-0'' /tmp/vagrant-puppet/manifests/default.pp sudo puppet apply --debug --verbose --http_proxy_host="user:pass@fqdn.com.au" --modulepath ''/tmp/vagrant-puppet/modules-0'' /tmp/vagrant-puppet/manifests/default.pp Do I have a problem with my syntax? Can anyone offer me a proper solution for how to successfully pass the http_proxy_host option to puppet? I''ve checked and the settings dont look like they''ve taken: # DEBUG # --------------------------------------------------------------- vagrant@vagrant-debian-squeeze:~$ puppet --configprint all | grep proxy http_proxy_host = none http_proxy_port = 3128 # --------------------------------------------------------------- # INFO # --------------------------------------------------------------- vagrant@vagrant-debian-squeeze:/tmp/vagrant-puppet/manifests$ sudo apt-show-versions | grep puppet puppet/squeeze uptodate 2.6.2-5+squeeze6 puppet-common/squeeze uptodate 2.6.2-5+squeeze6 # --------------------------------------------------------------- I should say I originally tried to do this with Vagrant (see here for more info groups.google.com/forum/?fromgroups=#!topic/vagrant-up/IW97AZbxdVc ) although I eventually realised I couldn''t even do this through puppet so I''m keen on trying to solve both issues. Thanks, Drew. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit groups.google.com/d/msg/puppet-users/-/pJflxk94Y2kJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/puppet-users?hl=en.
Also I tried upgrading puppet and got the same results. vagrant@vagrant-debian-squeeze:/tmp/vagrant-puppet/manifests$ sudo apt-show-versions | grep puppet facter/squeeze uptodate 1.6.12-1puppetlabs2 puppet/squeeze uptodate 2.7.19-1puppetlabs2 puppet-common/squeeze uptodate 2.7.19-1puppetlabs2 puppetlabs-release/squeeze uptodate 1.0-5 On Monday, October 1, 2012 10:18:25 AM UTC+10, drew khoury wrote:> > Hi, > > I''ve been trying to pass the http_proxy_host option to puppet but it''s not > taking. > > I have tried the following: > sudo puppet apply --debug --verbose --http_proxy_host > user:pass@fqdn.com.au --modulepath ''/tmp/vagrant-puppet/modules-0'' > /tmp/vagrant-puppet/manifests/default.pp > sudo puppet apply --debug --verbose --http_proxy_host> user:pass@fqdn.com.au --modulepath ''/tmp/vagrant-puppet/modules-0'' > /tmp/vagrant-puppet/manifests/default.pp > sudo puppet apply --debug --verbose --http_proxy_host=" > user:pass@fqdn.com.au" --modulepath > ''/tmp/vagrant-puppet/modules-0'' /tmp/vagrant-puppet/manifests/default.pp > > Do I have a problem with my syntax? Can anyone offer me a proper solution > for how to successfully pass the http_proxy_host option to puppet? > > I''ve checked and the settings dont look like they''ve taken: > > # DEBUG > # --------------------------------------------------------------- > vagrant@vagrant-debian-squeeze:~$ puppet --configprint all | grep proxy > http_proxy_host = none > http_proxy_port = 3128 > # --------------------------------------------------------------- > > # INFO > # --------------------------------------------------------------- > vagrant@vagrant-debian-squeeze:/tmp/vagrant-puppet/manifests$ sudo > apt-show-versions | grep puppet > puppet/squeeze uptodate 2.6.2-5+squeeze6 > puppet-common/squeeze uptodate 2.6.2-5+squeeze6 > # --------------------------------------------------------------- > > > I should say I originally tried to do this with Vagrant (see here for more > info > groups.google.com/forum/?fromgroups=#!topic/vagrant-up/IW97AZbxdVc) although I eventually realised I couldn''t even do this through puppet so > I''m keen on trying to solve both issues. > > Thanks, Drew. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit groups.google.com/d/msg/puppet-users/-/t21ZthYb_YoJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/puppet-users?hl=en.
Clarence Beeks
2012-Oct-01 01:03 UTC
Re: [Puppet Users] Re: Passing http_proxy_host option
On Sun, Sep 30, 2012 at 5:36 PM, drew khoury <drew.khoury@gmail.com> wrote:> Also I tried upgrading puppet and got the same results. > > vagrant@vagrant-debian-squeeze:/tmp/vagrant-puppet/manifests$ sudo > apt-show-versions | grep puppet > facter/squeeze uptodate 1.6.12-1puppetlabs2 > puppet/squeeze uptodate 2.7.19-1puppetlabs2 > puppet-common/squeeze uptodate 2.7.19-1puppetlabs2 > puppetlabs-release/squeeze uptodate 1.0-5 > >Try setting it in puppet.conf and with "export http_proxy=...." like in this thread: projects.puppetlabs.com/issues/15453 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/puppet-users?hl=en.
Setting the env variable manually does work, however I''m trying to run puppet via Vagrant, so I wonder where I have to set the http_proxy variable to get it to work when puppet is loaded via Vagrant. On Monday, October 1, 2012 11:03:25 AM UTC+10, Clarence Beeks wrote:> > On Sun, Sep 30, 2012 at 5:36 PM, drew khoury <drew....@gmail.com<javascript:> > > wrote: > >> Also I tried upgrading puppet and got the same results. >> >> vagrant@vagrant-debian-squeeze:/tmp/vagrant-puppet/manifests$ sudo >> apt-show-versions | grep puppet >> facter/squeeze uptodate 1.6.12-1puppetlabs2 >> puppet/squeeze uptodate 2.7.19-1puppetlabs2 >> puppet-common/squeeze uptodate 2.7.19-1puppetlabs2 >> puppetlabs-release/squeeze uptodate 1.0-5 >> >> > Try setting it in puppet.conf and with "export http_proxy=...." like in > this thread: > projects.puppetlabs.com/issues/15453 > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit groups.google.com/d/msg/puppet-users/-/v51_0-Alu6MJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/puppet-users?hl=en.
Looks like I was able to get it to work by executing the export command through a bash script, initiated via puppets exec logic in my puppet manifest. Not the most elegant solution but good enough to get me working. I had originally tried setting this in ~/.bashrc but with no luck. Now I''m... - doing a straight export http_proxy=... (in my bash script) as well as... - adding to /home/vagrant/.bashrc This way puppet gets the proxy at runtime & if I log in as vagrant I get proxy too. Thanks for pointing me in the right direction! On Monday, October 1, 2012 12:15:23 PM UTC+10, drew khoury wrote:> > Setting the env variable manually does work, however I''m trying to run > puppet via Vagrant, so I wonder where I have to set the http_proxy variable > to get it to work when puppet is loaded via Vagrant. > > > On Monday, October 1, 2012 11:03:25 AM UTC+10, Clarence Beeks wrote: >> >> On Sun, Sep 30, 2012 at 5:36 PM, drew khoury <drew....@gmail.com> wrote: >> >>> Also I tried upgrading puppet and got the same results. >>> >>> vagrant@vagrant-debian-squeeze:/tmp/vagrant-puppet/manifests$ sudo >>> apt-show-versions | grep puppet >>> facter/squeeze uptodate 1.6.12-1puppetlabs2 >>> puppet/squeeze uptodate 2.7.19-1puppetlabs2 >>> puppet-common/squeeze uptodate 2.7.19-1puppetlabs2 >>> puppetlabs-release/squeeze uptodate 1.0-5 >>> >>> >> Try setting it in puppet.conf and with "export http_proxy=...." like in >> this thread: >> projects.puppetlabs.com/issues/15453 >> >> >>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit groups.google.com/d/msg/puppet-users/-/9UtdF2mG5MwJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/puppet-users?hl=en.
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?). 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. 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. On Monday, October 1, 2012 12:30:35 PM UTC+10, drew khoury wrote:> > Looks like I was able to get it to work by executing the export command > through a bash script, initiated via puppets exec logic in my puppet > manifest. Not the most elegant solution but good enough to get me working. > > I had originally tried setting this in ~/.bashrc but with no luck. Now > I''m... > - doing a straight export http_proxy=... (in my bash script) > as well as... > - adding to /home/vagrant/.bashrc > > This way puppet gets the proxy at runtime & if I log in as vagrant I get > proxy too. > > Thanks for pointing me in the right direction! > > On Monday, October 1, 2012 12:15:23 PM UTC+10, drew khoury wrote: >> >> Setting the env variable manually does work, however I''m trying to run >> puppet via Vagrant, so I wonder where I have to set the http_proxy variable >> to get it to work when puppet is loaded via Vagrant. >> >> >> On Monday, October 1, 2012 11:03:25 AM UTC+10, Clarence Beeks wrote: >>> >>> On Sun, Sep 30, 2012 at 5:36 PM, drew khoury <drew....@gmail.com> wrote: >>> >>>> Also I tried upgrading puppet and got the same results. >>>> >>>> vagrant@vagrant-debian-squeeze:/tmp/vagrant-puppet/manifests$ sudo >>>> apt-show-versions | grep puppet >>>> facter/squeeze uptodate 1.6.12-1puppetlabs2 >>>> puppet/squeeze uptodate 2.7.19-1puppetlabs2 >>>> puppet-common/squeeze uptodate 2.7.19-1puppetlabs2 >>>> puppetlabs-release/squeeze uptodate 1.0-5 >>>> >>>> >>> Try setting it in puppet.conf and with "export http_proxy=...." like in >>> this thread: >>> projects.puppetlabs.com/issues/15453 >>> >>> >>>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit groups.google.com/d/msg/puppet-users/-/KFY7rL2lVnkJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/puppet-users?hl=en.
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 groups.google.com/d/msg/puppet-users/-/rjRkJx1zdjQJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/puppet-users?hl=en.
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 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+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/puppet-users?hl=en.
Apparently Analagous Threads
- Set http_proxy environment variable for package install?
- "Could not find class drew" error message when trying to load module
- edit() doubles backslashes when keep.source=TRUE
- set up a Gluster 2 node cluster in two lines of code :)
- OSX - SSH agent functionality differing based upon CLI arguments