Skip to content
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
5 changes: 5 additions & 0 deletions manifests/integrations/http_check.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
# check to create a metric 'network.http.response_time', tagged with
# the url, reporting the response time in seconds.
#
# ca_certs
# An optional string representing the path to CA certificates.
#
# disable_ssl_validation
# The setting disable_ssl_validation parameter to true will instruct
# the http client to accept self signed, expired and otherwise
Expand Down Expand Up @@ -168,6 +171,7 @@
$tags = [],
$contact = [],
$instances = undef,
$ca_certs = undef,
) inherits datadog_agent::params {
include datadog_agent

Expand All @@ -194,6 +198,7 @@
'allow_redirects' => $allow_redirects,
'tags' => $tags,
'contact' => $contact,
'ca_certs' => $ca_certs,
}]
} elsif !$instances{
$_instances = []
Expand Down
4 changes: 3 additions & 1 deletion spec/classes/datadog_agent_integrations_http_check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
check_certificate_expiration: true,
days_warning: 14,
days_critical: 7,
allow_redirects: true
allow_redirects: true,
ca_certs: '/dev/null'
}}

it { should contain_file(conf_file).with_content(%r{name: foo.bar.baz}) }
Expand All @@ -90,6 +91,7 @@
it { should contain_file(conf_file).with_content(%r{days_warning: 14}) }
it { should contain_file(conf_file).with_content(%r{days_critical: 7}) }
it { should contain_file(conf_file).with_content(%r{allow_redirects: true}) }
it { should contain_file(conf_file).with_content(%r{ca_certs: /dev/null}) }
end

context 'with headers parameter array' do
Expand Down
3 changes: 3 additions & 0 deletions templates/agent-conf.d/http_check.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ instances:
<% unless instance['no_proxy'].nil? -%>
no_proxy: <%= instance['no_proxy'] %>
<% end -%>
<% if instance['ca_certs'] -%>
ca_certs: <%= instance['ca_certs'] %>
<% end -%>
<% unless instance['check_certificate_expiration'].nil? -%>
check_certificate_expiration: <%= instance['check_certificate_expiration'] %>
<% if instance['check_certificate_expiration'] == true -%>
Expand Down