chef-datadog
chef-datadog copied to clipboard
http_proxy settings not propagated to apt-key
The recipe installs the datadog repository with key. The apt_repository resource takes a key_proxy
option that causes it to set http_proxy
for the call to apt-key
. Since datadog already supports http proxy, it would be nice to pass the option along.
As a workaround, I can do this before running the datadog recipe:
apt_repository("datadog") do
key_proxy "http://#{node['datadog']['web_proxy'].values_at('host', 'port').join(':')}"
keyserver 'hkp://keyserver.ubuntu.com:80'
key 'C7A7DA52'
uri node['datadog']['aptrepo']
distribution node['datadog']['aptrepo_dist']
components ['main']
action :add
end
Thanks for your feedback @pmahoney!
The key_proxy
attribute has been added in version 2.8.0
of the apt
cookbook (see https://github.com/chef-cookbooks/apt/pull/135). It's possible to set a proxy in earlier (and later) versions of apt
by setting the node['apt']['key_proxy']
attribure, so that's probably what I would recommend. Have you tried setting that node attribute?
If we wanted to add the attribute to apt_repository
we should add a check like if respond_to?(:key_proxy)
to only add the attribute on compatible versions of the resource.