Skip to content

Commit

Permalink
Merge pull request DataDog#545 from DataDog/albertvaka/fix-empty-checksd
Browse files Browse the repository at this point in the history
Do not include additional_checksd if not set
  • Loading branch information
albertvaka authored Jul 10, 2019
2 parents 4681d8f + 76be17f commit fe888f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
# String. Default: empty (port 17123 in dd-agent)
# $additional_checksd
# Additional directory to look for datadog checks in
# String. Default: empty
# String. Default: undef
# $bind_host
# The loopback address the forwarder and Dogstatsd will bind.
# String. Default: empty
Expand Down Expand Up @@ -263,7 +263,7 @@
$use_curl_http_client = false,
$recent_point_threshold = '',
$listen_port = '',
$additional_checksd = '',
$additional_checksd = undef,
$bind_host = '',
$use_pup = false,
$pup_port = '',
Expand Down Expand Up @@ -642,12 +642,22 @@
} else {
$statsd_forward_config = {}
}

if $additional_checksd {
$additional_checksd_config = {
'additional_checksd' => $additional_checksd,
}
} else {
$additional_checksd_config = {}
}

$extra_config = deep_merge(
$base_extra_config,
$agent6_extra_options,
$apm_analyzed_span_config,
$statsd_forward_config,
$host_config)
$host_config,
$additional_checksd_config)

file { $conf6_dir:
ensure => directory,
Expand Down Expand Up @@ -678,7 +688,6 @@
'log_file' => $agent6_log_file,
'log_level' => $log_level,
'tags' => unique(flatten(union($_local_tags, $_facts_tags))),
'additional_checksd' => $additional_checksd,
}

$agent_config = deep_merge($_agent_config, $extra_config)
Expand Down
2 changes: 1 addition & 1 deletion templates/datadog_footer.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ graphite_listen_port: <%= @_graphite_listen_port %>
<% end -%>

# Additional directory to look for Datadog checks
<% if @additional_checksd.empty? -%>
<% if @additional_checksd.nil? -%>
# additional_checksd: /etc/dd-agent/checks.d/
<% else -%>
additional_checksd: <%= @additional_checksd %>
Expand Down

0 comments on commit fe888f7

Please sign in to comment.