Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make yum repo GPG key an attribute #326

Merged
merged 3 commits into from
Aug 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,19 @@
}
architecture_map.default = 'x86_64'

# Older versions of yum embed M2Crypto with SSL that doesn't support TLS1.2
yum_protocol =
if node['platform_family'] == 'rhel' && node['platform_version'].to_i < 6
'http'
else
'https'
end

default['datadog']['installrepo'] = true
default['datadog']['aptrepo'] = 'http://apt.datadoghq.com'
default['datadog']['aptrepo_dist'] = 'stable'
default['datadog']['yumrepo'] = "http://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
default['datadog']['yumrepo_proxy_username'] = nil
default['datadog']['yumrepo_proxy_password'] = nil
Expand Down
4 changes: 1 addition & 3 deletions recipes/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@
proxy node['datadog']['yumrepo_proxy']
proxy_username node['datadog']['yumrepo_proxy_username']
proxy_password node['datadog']['yumrepo_proxy_password']
# Older versions of yum embed M2Crypto with SSL that doesn't support TLS1.2
prefix = node['platform_version'].to_i < 6 ? 'http' : 'https'
gpgkey "#{prefix}://yum.datadoghq.com/DATADOG_RPM_KEY.public"
gpgkey node['datadog']['yumrepo_gpgkey']
action :add
end
end