When set only in puppet.conf, and nothing in the environment, it connect fine.
[root ~]# printenv | grep -i proxy |
[root ~]# grep proxy /etc/puppetlabs/puppet/puppet.conf |
http_proxy_host = webproxy.example.com |
http_proxy_port = 3128 |
no_proxy = 10.0.0.0/8,local,*.local,127.0.0.1,localhost,*.example.com,example.com,master1,master2 |
[root ~]# puppet agent --test --server_list master1 --noop --verbose --http_debug opening connection to master1:8140... |
opened |
starting SSL for master1:8140... |
SSL established |
<- "GET /status/v1/simple/master HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Puppet/6.8.0 Ruby/2.5.3-p105 (x86_64-linux)\r\nHost: master1:8140\r\n\r\n" |
-> "HTTP/1.1 200 OK\r\n" |
-> "Date: Wed, 04 Sep 2019 14:11:21 GMT\r\n" |
-> "Content-Type: text/plain;charset=utf-8\r\n" |
-> "Vary: Accept-Encoding, User-Agent\r\n" |
-> "Content-Length: 7\r\n" |
-> "\r\n" |
reading 7 bytes...
|
When http_proxy env var is set, but no_proxy env var is not set, I expect it to still work, because no_proxy is in the config file, and has not been overridden, but it does not. I don't think your test case above covered this combination:
[root ~]# env http_proxy=http://webproxy.example.com:3128 puppet agent --test --server_list master1 --noop --verbose --http_debug |
opening connection to webproxy.example.com:3128... |
opened |
<- "CONNECT master1:8140 HTTP/1.1\r\nHost: master1:8140\r\n\r\n" |
-> "HTTP/1.0 403 Forbidden\r\n" |
-> "Server: squid\r\n" |
-> "Mime-Version: 1.0\r\n" |
-> "Date: Wed, 04 Sep 2019 14:09:26 GMT\r\n" |
-> "Content-Type: text/html\r\n" |
-> "Content-Length: 3094\r\n" |
-> "X-Squid-Error: ERR_ACCESS_DENIED 0\r\n" |
-> "Vary: Accept-Language\r\n" |
-> "Content-Language: en\r\n" |
-> "X-Cache: MISS from squid1\r\n" |
-> "X-Cache-Lookup: NONE from squid1:3128\r\n" |
-> "Via: 1.0 squid1 (squid)\r\n" |
-> "Connection: keep-alive\r\n" |
-> "\r\n" |
Conn close because of connect error 403 "Forbidden" |
Error: Could not run Puppet configuration client: Could not select a functional puppet master from server_list: 'master1'
|
If I set both the http_proxy and no_proxy env vars, it works again:
|