Retry on failure when pulling the gpg key from keyserver.ubuntu.com
MODIFY
attributes/default.rb
attributes/default.rb
@@ -154,6 +154,7 @@ yum_protocol =
default['datadog']['installrepo'] = true
default['datadog']['aptrepo'] = 'http://apt.datadoghq.com'
default['datadog']['aptrepo_dist'] = 'stable'
+default['datadog']['aptrepo_retries'] = 4
default['datadog']['yumrepo'] = "#{yum_protocol}://yum.datadoghq.com/rpm/#{architecture_map[node['kernel']['machine']]}/"
default['datadog']['yumrepo_gpgkey'] = "#{yum_protocol}://yum.datadoghq.com/DATADOG_RPM_KEY.public"
default['datadog']['yumrepo_proxy'] = nil

MODIFY
recipes/repository.rb
recipes/repository.rb
@@ -29,6 +29,7 @@ when 'debian'
uri = node['datadog']['agent6'] ? node['datadog']['agent6_aptrepo'] : node['datadog']['aptrepo']
distribution = node['datadog']['agent6'] ? node['datadog']['agent6_aptrepo_dist'] : node['datadog']['aptrepo_dist']
components = node['datadog']['agent6'] ? ['main', '6'] : ['main']
+ retries = node['datadog']['aptrepo_retries']
# Add APT repository
apt_repository 'datadog' do
keyserver 'hkp://keyserver.ubuntu.com:80'
@@ -37,6 +38,7 @@ when 'debian'
distribution distribution
components components
action :add
+ retries retries
end
# Previous versions of the cookbook could create this repo file, make sure we remove it now

Retry on failure when pulling the gpg key from keyserver.ubuntu.com (#561)