puppet-zabbix
puppet-zabbix copied to clipboard
Zabbix repo manifest does not support setting proxy
Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 5.5.16
- Ruby: 2.5.1
- Distribution: Ubuntu 18.04.3 LTS
- Module version: v7.0.0
How to reproduce (e.g Puppet code you use)
Attempt to install Zabbix Agent on Ubuntu behind a proxy, eg. a corporate network, with the module managing the Zabbix repo.
What are you seeing
tcpdump will show Puppet attempting to fetch the apt keys directly from repo.zabbix.com:
0:54:10.966548 IP SERVER.58970 > repo.zabbix.com.https: Flags [S], seq 902967249, win 29200, options [mss 1460,sackOK,TS val 2736438044 ecr 0,nop,wscale 7], length 0
What behaviour did you expect instead
Fetch apt keys via proxy. New functionality is needed to accomplish this as currently proxy cannot be set. One way to do this which should work:
$proxy = 'https://my.proxy.example:8080'
apt::key { 'zabbix-FBABD5F':
id => 'FBABD5FB20255ECAB22EE194D13D58E479EA5ED4',
source => 'https://repo.zabbix.com/zabbix-official-repo.key',
options => "http-proxy=\"${proxy}\"",
}
Output log
Any additional information you'd like to impart
This hasn't been a problem for us when using yum as you can configure proxy globally. But apt::key uses underlying gpg calls which don't respect proxy settings set for apt.
Ran into this again today. Turns out options => "http-proxy=\"${proxy}\"",
has no effect for the source
parameter, only keyservers with server
. Only workaround I could find was to run Puppet Agent with https_proxy set in it's environment.