Skip to content

Commit f442dbc

Browse files
committed
Merge pull request DataDog#139 from MartinDelta/add-optional-ntp-params-support
Adds support for optional params in ntp integration
2 parents 532b657 + f6d594b commit f442dbc

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

manifests/integrations/ntp.pp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,29 @@
66
# $offset_threshold:
77
# Offset threshold for a critical alert. Defaults to 600.
88
#
9+
# $host:
10+
# ntp server to use for ntp check
11+
#
12+
# $port
13+
#
14+
# $version
15+
#
16+
# $timeout
17+
#
918
# Sample Usage:
1019
#
1120
# class { 'datadog_agent::integrations::ntp' :
1221
# offset_threshold => 60,
22+
# host => 'pool.ntp.org',
1323
# }
1424
#
1525

1626
class datadog_agent::integrations::ntp(
1727
$offset_threshold = 60,
28+
$host = undef,
29+
$port = undef,
30+
$version = undef,
31+
$timeout = undef,
1832
) inherits datadog_agent::params {
1933

2034
file { "${datadog_agent::params::conf_dir}/ntp.yaml":

templates/agent-conf.d/ntp.yaml.erb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@ init_config:
66

77
instances:
88
- offset_threshold: <%= @offset_threshold %>
9-
9+
<% if @host -%>
10+
- host: <%= @host %>
11+
<% end -%>
12+
<% if @port -%>
13+
- port: <%= @port %>
14+
<% end -%>
15+
<% if @version -%>
16+
- version: <%= @version %>
17+
<% end -%>
18+
<% if @timeout -%>
19+
- timeout: <%= @timeout %>
20+
<% end -%>
1021
# Optional params:
1122
#
1223
# host: pool.ntp.org
1324
# port: ntp
1425
# version: 3
1526
# timeout: 5
16-

0 commit comments

Comments
 (0)