Adds support for optional params in ntp integration
diff --git a/manifests/integrations/ntp.pp b/manifests/integrations/ntp.pp index 0ec8a28..bf8bcfd 100644 --- a/manifests/integrations/ntp.pp +++ b/manifests/integrations/ntp.pp
@@ -6,15 +6,29 @@ # $offset_threshold: # Offset threshold for a critical alert. Defaults to 600. # +# $host: +# ntp server to use for ntp check +# +# $port +# +# $version +# +# $timeout +# # Sample Usage: # # class { 'datadog_agent::integrations::ntp' : # offset_threshold => 60, +# host => 'pool.ntp.org', # } # class datadog_agent::integrations::ntp( $offset_threshold = 60, + $host = undef, + $port = undef, + $version = undef, + $timeout = undef, ) inherits datadog_agent::params { file { "${datadog_agent::params::conf_dir}/ntp.yaml":
diff --git a/templates/agent-conf.d/ntp.yaml.erb b/templates/agent-conf.d/ntp.yaml.erb index bc351ce..285fd4f 100644 --- a/templates/agent-conf.d/ntp.yaml.erb +++ b/templates/agent-conf.d/ntp.yaml.erb
@@ -6,11 +6,21 @@ instances: - offset_threshold: <%= @offset_threshold %> - +<% if @host -%> + - host: <%= @host %> +<% end -%> +<% if @port -%> + - port: <%= @port %> +<% end -%> +<% if @version -%> + - version: <%= @version %> +<% end -%> +<% if @timeout -%> + - timeout: <%= @timeout %> +<% end -%> # Optional params: # # host: pool.ntp.org # port: ntp # version: 3 # timeout: 5 -