Issue #16635 has been updated by Clay Caviness.

When our machines (mostly laptops) are outside the corporate network, we push 
everything through a (local, encrypted) proxy. We have a wrapper script that 
runs puppet - it determines on/off corp, and adds the `--http_proxy_host` and 
`--http_proxy_port` command-line flags as necessary.

<cite>I think in puppet 3 those environment variables won’t be passed through, 
but I’m not sure about that.
I’d rather just use the settings if they exist, as it seems less ambiguous 
(should environment win over config?).</cite>

That these command-line arguments end up as environment variables is besides 
the point - command-line flags should override the config. We use command-line 
flags to override config settings quite commonly.

If this behavior isn't going to be supported in puppet 3, where should I file 
bugs requesting it?
----------------------------------------
Bug #16635: pkgdmg provider doesn't honor http_proxy_host/http_proxy_port
https://projects.puppetlabs.com/issues/16635#change-74798

Author: Clay Caviness
Status: Needs More Information
Priority: Normal
Assignee: Clay Caviness
Category: OSX
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


The pkgdmg provider doesn't honor http_proxy_host/http_proxy_port settings. The 
actual file is downloaded using an exec to curl, no proxy information is passed:
<pre>curl "-o", cached_source, "-C", "-", "-k", "-L", "-s", "--url", 
source</pre>

I copied `http_proxy_env`, `http_proxy_host`, and `http_proxy_port` functions 
from `puppet/forge/repository.rb` and added them to `pkgdmg.rb`, and tweaked 
the call to curl in `pkgdmg.rb`:
<pre>if http_proxy_host and not http_proxy_port
  curl "-o", cached_source, "-C", "-", "-k", "-L", "-s", "--url", source, 
"--proxy", http_proxy_host
elsif http_proxy_host and http_proxy_port
  curl "-o", cached_source, "-C", "-", "-k", "-L", "-s", "--url", source, 
"--proxy", "#{http_proxy_host}:#{http_proxy_port}"
else
  curl "-o", cached_source, "-C", "-", "-k", "-L", "-s", "--url", source
end
</pre>

I attached my patched pkgdmg.rb. I don't really understand how the `commands 
:curl => "/usr/bin/curl"` and `curl 'foo', 'bar', 'baz'` stuff actually works, 
so there's probably a much smoother way to do this...


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to