run puppet client behind a Internetproxy with authentification

88 views
Skip to first unread message

Rico Steinitz

unread,
Jun 5, 2015, 5:05:04 PM6/5/15
to puppet...@googlegroups.com
I have some PCs in other Networks. The Puppet Client reach the Puppet-Master only over a internetproxy (proxy server squid) with authentification.
The masterport is 443 (HTTPS)
(Puppet client v3.7.5 (OS: Windows 7/2008/2012); Puppet Master 3.7.5 (Debian), Foreman 1.7.5)

i have no problems to communicate over a Proxy without Authentification.
I set the two variables in the puppet.conf on the client:
http_proxy_host=PROXY-IP-ADRESSE
http_proxy_port=8080

But i don't find something about the authentification variables.
I have a workaround. I edit the file:
C:\Program Files\Puppet Labs\Puppet\puppet\lib\puppet\network\http\factory.rb

I added the authentification variables in the function: def create_connection(site)
Original without authentification: (line: 29)
args << Puppet[:http_proxy_host] << Puppet[:http_proxy_port]
NEW with authentification: (line: 29)
args << Puppet[:http_proxy_host] << Puppet[:http_proxy_port] << Puppet[:http_proxy_user] << Puppet[:http_proxy_password]


Is there any other way than to edit the file factory.rb?

Josh Cooper

unread,
Jun 6, 2015, 12:46:59 AM6/6/15
to puppet...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/a633c633-33ba-4b14-99a4-0f0273a3b9dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

This is filed as https://tickets.puppetlabs.com/browse/PUP-4470. It should be pretty easy to modify the factory to do something along the lines of:

  def create_connection(site)
    Puppet.debug("Creating new connection for #{site}")

    http = Puppet::Util::Proxy.proxy(site)
    http.use_ssl = site.use_ssl?
    http.read_timeout = Puppet[:http_read_timeout]
    http.open_timeout = Puppet[:http_connect_timeout]

Josh

--
Josh Cooper
Developer, Puppet Labs

PuppetConf 2015 is coming to Portland, Oregon! Join us October 5-9.
Register now to take advantage of the Early Adopter discount save $349!
Reply all
Reply to author
Forward
0 new messages