|
69 | 69 | # $log_to_syslog
|
70 | 70 | # Set value of 'log_to_syslog' variable. Default is true -> yes as in dd-agent.
|
71 | 71 | # Valid values here are: true or false.
|
72 |
| -# $dogstatsd_port |
73 |
| -# Set value of the 'dogstatsd_port' variable. Defaultis 8125. |
74 | 72 | # $report_fact_tags
|
75 | 73 | # Sets tags for report events sent to Datadog from specified facts
|
76 | 74 | # $report_trusted_fact_tags
|
77 | 75 | # Sets tags for report events sent to Datadog from specified trusted facts
|
78 | 76 | # $statsd_forward_host
|
79 | 77 | # Set the value of the statsd_forward_host varable. Used to forward all
|
80 | 78 | # statsd metrics to another host.
|
81 |
| -# $statsd_forward_port |
82 |
| -# Set the value of the statsd_forward_port varable. Used to forward all |
83 |
| -# statsd metrics to another host. |
84 | 79 | # $manage_repo
|
85 | 80 | # Deprecated. Only works for RPM. Install datadog-agent manually and then set
|
86 | 81 | # manage_install=false to achieve the same behaviour as setting this to false.
|
|
131 | 126 | # String. Default: empty
|
132 | 127 | # $dogstatsd_port
|
133 | 128 | # Specifies the port to be used by dogstatsd. Must have use_dogstatsd set
|
134 |
| -# String. Default: empty |
| 129 | +# String. Default: 8125 |
135 | 130 | # $dogstatsd_target
|
136 | 131 | # Change the target to be used by dogstatsd. Must have use_dogstatsd set
|
137 | 132 | # set
|
|
146 | 141 | # Enables forwarding of statsd packetsto host. Must have use_dogstatsd set
|
147 | 142 | # String. Default: empty
|
148 | 143 | # $statsd_forward_port
|
149 |
| -# Specifis port for $statsd_forward_host. Must have use_dogstatsd set |
150 |
| -# String. Default: empty |
| 144 | +# Specifies port for $statsd_forward_host. Must have use_dogstatsd set String. |
| 145 | +# Used to forward all statsd metrics to another host. |
| 146 | +# Default: empty |
151 | 147 | # $device_blacklist_re
|
152 | 148 | # Specifies pattern for device blacklisting.
|
153 | 149 | # String. Default: empty
|
|
288 | 284 | Boolean $manage_install = true,
|
289 | 285 | $hostname_extraction_regex = undef,
|
290 | 286 | Boolean $hostname_fqdn = false,
|
291 |
| - $dogstatsd_port = 8125, |
| 287 | + Variant[Stdlib::Port, Pattern[/^\d*$/]] $dogstatsd_port = 8125, |
292 | 288 | $dogstatsd_socket = '',
|
293 | 289 | Array $report_fact_tags = [],
|
294 | 290 | Array $report_trusted_fact_tags = [],
|
295 | 291 | String $statsd_forward_host = '',
|
296 |
| - $statsd_forward_port = '', |
| 292 | + Variant[Stdlib::Port, Pattern[/^\d*$/]] $statsd_forward_port = '', |
297 | 293 | String $statsd_histogram_percentiles = '0.95',
|
298 | 294 | Optional[String] $proxy_host = undef,
|
299 | 295 | Optional[Variant[Integer, Pattern[/^\d*$/]]] $proxy_port = undef,
|
300 | 296 | Optional[String] $proxy_user = undef,
|
301 | 297 | Optional[String] $proxy_password = undef,
|
302 |
| - $graphite_listen_port = '', |
| 298 | + Variant[Stdlib::Port, Pattern[/^\d*$/]] $graphite_listen_port = '', |
303 | 299 | String $extra_template = '',
|
304 | 300 | String $ganglia_host = '',
|
305 | 301 | $ganglia_port = 8651,
|
306 | 302 | Boolean $skip_ssl_validation = false,
|
307 | 303 | Boolean $skip_apt_key_trusting = false,
|
308 | 304 | Boolean $use_curl_http_client = false,
|
309 | 305 | String $recent_point_threshold = '',
|
310 |
| - $listen_port = '', |
| 306 | + Variant[Stdlib::Port, Pattern[/^\d*$/]] $listen_port = '', |
311 | 307 | Optional[String] $additional_checksd = undef,
|
312 | 308 | String $bind_host = '',
|
313 | 309 | Boolean $use_pup = false,
|
314 |
| - $pup_port = '', |
| 310 | + Variant[Stdlib::Port, Pattern[/^\d*$/]] $pup_port = '', |
315 | 311 | String $pup_interface = '',
|
316 | 312 | String $pup_url = '',
|
317 | 313 | Boolean $use_dogstatsd = true,
|
|
326 | 322 | String $dogstatsd_log_file = '',
|
327 | 323 | String $pup_log_file = '',
|
328 | 324 | String $syslog_host = '',
|
329 |
| - $syslog_port = '', |
| 325 | + Variant[Stdlib::Port, Pattern[/^\d*$/]] $syslog_port = '', |
330 | 326 | String $service_discovery_backend = '',
|
331 | 327 | String $sd_config_backend = '',
|
332 | 328 | String $sd_backend_host = '',
|
|
391 | 387 | $dd_user = $datadog_agent::params::dd_user
|
392 | 388 | }
|
393 | 389 |
|
394 |
| - # Allow ports to be passed as integers or strings. |
395 |
| - # lint:ignore:only_variable_string |
396 |
| - $_dogstatsd_port = "${dogstatsd_port}" |
397 |
| - $_statsd_forward_port = "${statsd_forward_port}" |
398 |
| - $_graphite_listen_port = "${graphite_listen_port}" |
399 |
| - $_listen_port = "${listen_port}" |
400 |
| - $_pup_port = "${pup_port}" |
401 |
| - $_syslog_port = "${syslog_port}" |
402 |
| - # lint:endignore |
403 |
| - |
404 |
| - validate_legacy(String, 'validate_re', $_dogstatsd_port, '^\d*$') |
405 |
| - validate_legacy(String, 'validate_re', $_statsd_forward_port, '^\d*$') |
406 |
| - validate_legacy(String, 'validate_re', $_graphite_listen_port, '^\d*$') |
407 |
| - validate_legacy(String, 'validate_re', $_listen_port, '^\d*$') |
408 |
| - validate_legacy(String, 'validate_re', $_pup_port, '^\d*$') |
409 |
| - validate_legacy(String, 'validate_re', $_syslog_port, '^\d*$') |
410 |
| - |
411 | 390 | if $conf_dir == undef {
|
412 | 391 | if $_agent_major_version == 5 {
|
413 | 392 | $_conf_dir = $datadog_agent::params::legacy_conf_dir
|
|
571 | 550 | require => File['/etc/dd-agent'],
|
572 | 551 | }
|
573 | 552 |
|
574 |
| - if ($dd_url == '') { |
| 553 | + if $dd_url.empty { |
575 | 554 | $_dd_url = 'https://app.datadoghq.com'
|
576 | 555 | } else {
|
577 | 556 | $_dd_url = $dd_url
|
|
599 | 578 | order => '05',
|
600 | 579 | }
|
601 | 580 |
|
602 |
| - if ($extra_template != '') { |
| 581 | + unless $extra_template.empty { |
603 | 582 | concat::fragment{ 'datadog extra_template footer':
|
604 | 583 | target => '/etc/dd-agent/datadog.conf',
|
605 | 584 | content => template($extra_template),
|
|
677 | 656 | },
|
678 | 657 | }
|
679 | 658 | }
|
680 |
| - if $host != '' { |
| 659 | + if $host.empty { |
| 660 | + $host_config = {} |
| 661 | + } else { |
681 | 662 | $host_config = {
|
682 | 663 | 'hostname' => $host,
|
683 | 664 | }
|
684 |
| - } else { |
685 |
| - $host_config = {} |
686 | 665 | }
|
687 | 666 |
|
688 | 667 | if $apm_analyzed_spans {
|
|
705 | 684 | $apm_obfuscation_config = {}
|
706 | 685 | }
|
707 | 686 |
|
708 |
| - if $statsd_forward_host != '' { |
709 |
| - if $_statsd_forward_port != '' { |
| 687 | + if $statsd_forward_host.empty { |
| 688 | + $statsd_forward_config = {} |
| 689 | + } else { |
| 690 | + if String($statsd_forward_port).empty { |
710 | 691 | $statsd_forward_config = {
|
711 | 692 | 'statsd_forward_host' => $statsd_forward_host,
|
712 |
| - 'statsd_forward_port' => $statsd_forward_port, |
713 | 693 | }
|
714 | 694 | } else {
|
715 | 695 | $statsd_forward_config = {
|
716 | 696 | 'statsd_forward_host' => $statsd_forward_host,
|
| 697 | + 'statsd_forward_port' => $statsd_forward_port, |
717 | 698 | }
|
718 | 699 | }
|
719 |
| - } else { |
720 |
| - $statsd_forward_config = {} |
721 | 700 | }
|
722 | 701 |
|
723 | 702 | if $additional_checksd {
|
|
0 commit comments