Fix yum_package[gnupg] resource being declared more than once
On RHEL OSes, the datadog::repository recipe declared yum_package[gnupg]
once for each GPG key causing deprecation warnings on Chef 12.
MODIFY
recipes/repository.rb
recipes/repository.rb
@@ -98,16 +98,16 @@ when 'debian'
end
when 'rhel', 'fedora', 'amazon'
- # Import new RPM key
- rpm_gpg_keys.each do |rpm_gpg_key|
- next unless node['datadog']["yumrepo_gpgkey_new_#{rpm_gpg_key[rpm_gpg_keys_short_fingerprint]}"]
-
# gnupg is required to check the downloaded key's fingerprint
package 'gnupg' do
action :install
only_if { node['packages']['gnupg2'].nil? }
end
+ # Import new RPM key
+ rpm_gpg_keys.each do |rpm_gpg_key|
+ next unless node['datadog']["yumrepo_gpgkey_new_#{rpm_gpg_key[rpm_gpg_keys_short_fingerprint]}"]
+
# Download new RPM key
key_local_path = ::File.join(Chef::Config[:file_cache_path], rpm_gpg_key[rpm_gpg_keys_name])
remote_file "remote_file_#{rpm_gpg_key[rpm_gpg_keys_name]}" do

Fix yum_package[gnupg] resource being declared more than once (#772)

On RHEL OSes, the datadog::repository recipe declared yum_package[gnupg]
once for each GPG key causing deprecation warnings on Chef 12.