diff --git a/Gemfile b/Gemfile index 2c3a19d2..125f02c6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ source "https://rubygems.org" group :test do + gem "rb-inotify", '< 0.10.0' if RUBY_VERSION < '2.2.0' gem "public_suffix", "~> 3.0.0" gem "listen", "~> 3.0.0" gem "puppet", ENV['PUPPET_VERSION'] || '~> 4.2.0' diff --git a/manifests/init.pp b/manifests/init.pp index 5210b584..3697d9e3 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -11,11 +11,15 @@ # set to 'datadoghq.eu' to send data to the EU site. # This option is only available with agent version >= 6.6.0. # $host: +# Force the hostname to whatever you want. (default: auto-detected) # $api_key: # Your DataDog API Key. Please replace with your key value. # $collect_ec2_tags # Collect AWS EC2 custom tags as agent tags. # Boolean. Default: false +# $collect_gce_tags +# Collect Google Cloud Engine metadata as agent tags. +# Boolean. Default: false # $collect_instance_metadata # The Agent will try to collect instance metadata for EC2 and GCE instances. # Boolean. Default: true @@ -45,6 +49,12 @@ # Instead of reporting the puppet nodename, use this regex to extract the named # 'hostname' captured group to report the run in Datadog. # ex.: '^(?.*\.datadoghq\.com)(\.i-\w{8}\..*)?$' +# $hostname_fqdn +# Make the agent use "hostname -f" on unix-based systems as a last resort +# way of determining the hostname instead of Golang "os.Hostname()" +# This will be enabled by default in version 6.6 +# More information at https://dtdg.co/flag-hostname-fqdn +# Optional: Valid values here are: true or false. # $log_to_syslog # Set value of 'log_to_syslog' variable. Default is true -> yes as in dd-agent. # Valid values here are: true or false. @@ -212,6 +222,7 @@ $host = '', $api_key = 'your_API_key', $collect_ec2_tags = false, + $collect_gce_tags = false, $collect_instance_metadata = true, $tags = [], $integrations = {}, @@ -228,6 +239,7 @@ $service_enable = true, $manage_repo = true, $hostname_extraction_regex = nil, + $hostname_fqdn = false, $dogstatsd_port = 8125, $dogstatsd_socket = '', $statsd_forward_host = '', @@ -315,6 +327,7 @@ validate_legacy(String, 'validate_string', $dd_url) validate_legacy(String, 'validate_string', $datadog_site) validate_legacy(String, 'validate_string', $host) + validate_legacy(Boolean, 'validate_bool', $hostname_fqdn) validate_legacy(String, 'validate_string', $api_key) validate_legacy(Array, 'validate_array', $tags) validate_legacy(Boolean, 'validate_bool', $hiera_tags) @@ -341,6 +354,7 @@ validate_legacy(Boolean, 'validate_bool', $skip_apt_key_trusting) validate_legacy(Boolean, 'validate_bool', $use_curl_http_client) validate_legacy(Boolean, 'validate_bool', $collect_ec2_tags) + validate_legacy(Boolean, 'validate_bool', $collect_gce_tags) validate_legacy(Boolean, 'validate_bool', $collect_instance_metadata) validate_legacy(String, 'validate_string', $recent_point_threshold) validate_legacy(String, 'validate_re', $_listen_port, '^\d*$') @@ -636,7 +650,9 @@ 'dd_url' => $dd_url, 'site' => $datadog_site, 'cmd_port' => $cmd_port, + 'hostname_fqdn' => $hostname_fqdn, 'collect_ec2_tags' => $collect_ec2_tags, + 'collect_gce_tags' => $collect_gce_tags, 'conf_path' => $datadog_agent::params::conf6_dir, 'enable_metadata_collection' => $collect_instance_metadata, 'dogstatsd_port' => $dogstatsd_port, diff --git a/manifests/integrations/apache.pp b/manifests/integrations/apache.pp index 964ce689..6a4b87a8 100644 --- a/manifests/integrations/apache.pp +++ b/manifests/integrations/apache.pp @@ -39,10 +39,14 @@ validate_legacy('Array', 'validate_array', $tags) validate_legacy('Boolean', 'validate_bool', $disable_ssl_validation) + $legacy_dst = "${datadog_agent::conf_dir}/apache.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/apache.yaml" + $dst = "${datadog_agent::conf6_dir}/apache.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/apache.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/cacti.pp b/manifests/integrations/cacti.pp index 032ab03b..1e1dda10 100644 --- a/manifests/integrations/cacti.pp +++ b/manifests/integrations/cacti.pp @@ -6,7 +6,7 @@ # $host: # The host cacti MySQL db is running on # $user -# The cacti MySQL password +# The cacti MySQL password # $password # The cacti MySQL sb port. # $path @@ -20,10 +20,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/cacti.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/cacti.yaml" + $dst = "${datadog_agent::conf6_dir}/cacti.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/cacti.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/cassandra.pp b/manifests/integrations/cassandra.pp index 4e87b732..d367e563 100644 --- a/manifests/integrations/cassandra.pp +++ b/manifests/integrations/cassandra.pp @@ -36,10 +36,15 @@ validate_legacy(Optional[Hash], 'validate_hash', $tags) + $legacy_dst = "${datadog_agent::conf_dir}/cassandra.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/cassandra.yaml" + $dst = "${datadog_agent::conf6_dir}/cassandra.d/conf.yaml" + + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/cassandra.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/ceph.pp b/manifests/integrations/ceph.pp index 63224aa2..ffa1c4b2 100644 --- a/manifests/integrations/ceph.pp +++ b/manifests/integrations/ceph.pp @@ -26,10 +26,14 @@ content => "# This file is required for dd ceph \ndd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph\n" } + $legacy_dst = "${datadog_agent::conf_dir}/ceph.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/ceph.yaml" + $dst = "${datadog_agent::conf6_dir}/ceph.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/ceph.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/consul.pp b/manifests/integrations/consul.pp index fb8fa46d..253c7bb6 100644 --- a/manifests/integrations/consul.pp +++ b/manifests/integrations/consul.pp @@ -40,10 +40,14 @@ validate_legacy('Boolean', 'validate_bool', $new_leader_checks) validate_legacy('Optional[Array]', 'validate_array', $service_whitelist) + $legacy_dst = "${datadog_agent::conf_dir}/consul.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/consul.yaml" + $dst = "${datadog_agent::conf6_dir}/consul.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/consul.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/directory.pp b/manifests/integrations/directory.pp index e70609a9..4d7dc372 100644 --- a/manifests/integrations/directory.pp +++ b/manifests/integrations/directory.pp @@ -93,10 +93,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/directory.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/directory.yaml" + $dst = "${datadog_agent::conf6_dir}/directory.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/directory.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/disk.pp b/manifests/integrations/disk.pp index 342e7171..09f96a1b 100644 --- a/manifests/integrations/disk.pp +++ b/manifests/integrations/disk.pp @@ -48,10 +48,14 @@ fail('error during compilation') } + $legacy_dst = "${datadog_agent::conf_dir}/disk.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/disk.yaml" + $dst = "${datadog_agent::conf6_dir}/disk.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/disk.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/dns_check.pp b/manifests/integrations/dns_check.pp index 796cbe07..a7502207 100644 --- a/manifests/integrations/dns_check.pp +++ b/manifests/integrations/dns_check.pp @@ -37,10 +37,14 @@ validate_legacy('Array', 'validate_array', $checks) + $legacy_dst = "${datadog_agent::conf_dir}/dns_check.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/dns_check.yaml" + $dst = "${datadog_agent::conf6_dir}/dns_check.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/dns_check.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/docker_daemon.pp b/manifests/integrations/docker_daemon.pp index da38abc6..7eab627c 100644 --- a/manifests/integrations/docker_daemon.pp +++ b/manifests/integrations/docker_daemon.pp @@ -65,7 +65,7 @@ } if !$::datadog_agent::agent5_enable { - $legacy_conf = "${datadog_agent::conf6_dir}/docker_daemon.yaml" + $legacy_conf = "${datadog_agent::conf6_dir}/docker_daemon.d/conf.yaml" } else { $legacy_conf = "${datadog_agent::conf_dir}/docker.yaml" } @@ -75,7 +75,7 @@ } if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/docker.yaml" + $dst = "${datadog_agent::conf6_dir}/docker.d/conf.yaml" } else { $dst = "${datadog_agent::conf_dir}/docker_daemon.yaml" } diff --git a/manifests/integrations/elasticsearch.pp b/manifests/integrations/elasticsearch.pp index 26a6c7c6..5230fee6 100644 --- a/manifests/integrations/elasticsearch.pp +++ b/manifests/integrations/elasticsearch.pp @@ -74,10 +74,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/elastic.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/elastic.yaml" + $dst = "${datadog_agent::conf6_dir}/elastic.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/elastic.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/fluentd.pp b/manifests/integrations/fluentd.pp index c7b3bf5a..227cdc31 100644 --- a/manifests/integrations/fluentd.pp +++ b/manifests/integrations/fluentd.pp @@ -25,10 +25,14 @@ validate_legacy('Optional[Array]', 'validate_array', $plugin_ids) + $legacy_dst = "${datadog_agent::conf_dir}/fluentd.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/fluentd.yaml" + $dst = "${datadog_agent::conf6_dir}/fluentd.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/fluentd.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/generic.pp b/manifests/integrations/generic.pp index ac17c0ec..7a254c09 100644 --- a/manifests/integrations/generic.pp +++ b/manifests/integrations/generic.pp @@ -25,10 +25,14 @@ validate_legacy('Optional[String]', 'validate_string', $integration_name) validate_legacy('Optional[String]', 'validate_string', $integration_contents) + $legacy_dst = "${datadog_agent::conf_dir}/${integration_name}.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/${integration_name}.yaml" + $dst = "${datadog_agent::conf6_dir}/${integration_name}.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/${integration_name}.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/haproxy.pp b/manifests/integrations/haproxy.pp index 350cf3fc..5f0c69e7 100644 --- a/manifests/integrations/haproxy.pp +++ b/manifests/integrations/haproxy.pp @@ -36,10 +36,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/haproxy.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/haproxy.yaml" + $dst = "${datadog_agent::conf6_dir}/haproxy.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/haproxy.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index 1cfcc8f6..16d6730f 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -206,10 +206,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/http_check.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/http_check.yaml" + $dst = "${datadog_agent::conf6_dir}/http_check.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/http_check.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/jenkins.pp b/manifests/integrations/jenkins.pp index 8913db8c..bebc2507 100644 --- a/manifests/integrations/jenkins.pp +++ b/manifests/integrations/jenkins.pp @@ -18,10 +18,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/jenkins.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/jenkins.yaml" + $dst = "${datadog_agent::conf6_dir}/jenkins.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/jenkins.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/jmx.pp b/manifests/integrations/jmx.pp index 88a3b888..b86c03e4 100644 --- a/manifests/integrations/jmx.pp +++ b/manifests/integrations/jmx.pp @@ -67,10 +67,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/jmx.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/jmx.yaml" + $dst = "${datadog_agent::conf6_dir}/jmx.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/jmx.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/kafka.pp b/manifests/integrations/kafka.pp index 894fe10f..0ab1f2b7 100644 --- a/manifests/integrations/kafka.pp +++ b/manifests/integrations/kafka.pp @@ -86,10 +86,14 @@ $servers = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/kafka.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/kafka.yaml" + $dst = "${datadog_agent::conf6_dir}/kafka.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/kafka.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/kong.pp b/manifests/integrations/kong.pp index 06f6880c..d4ddabd8 100644 --- a/manifests/integrations/kong.pp +++ b/manifests/integrations/kong.pp @@ -34,10 +34,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/kong.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/kong.yaml" + $dst = "${datadog_agent::conf6_dir}/kong.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/kong.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/kubernetes.pp b/manifests/integrations/kubernetes.pp index aed36f5e..20790852 100644 --- a/manifests/integrations/kubernetes.pp +++ b/manifests/integrations/kubernetes.pp @@ -32,10 +32,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/kubernetes.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/kubernetes.yaml" + $dst = "${datadog_agent::conf6_dir}/kubernetes.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/kubernetes.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/kubernetes_state.pp b/manifests/integrations/kubernetes_state.pp index a16c037e..f3dbd8b8 100644 --- a/manifests/integrations/kubernetes_state.pp +++ b/manifests/integrations/kubernetes_state.pp @@ -4,7 +4,7 @@ # # Parameters: # $url: -# The URL for kubernetes metrics +# The URL for kubernetes metrics # # $tags: # optional array of tags @@ -24,10 +24,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/kubernetes_state.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/kubernetes_state.yaml" + $dst = "${datadog_agent::conf6_dir}/kubernetes_state.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/kubernetes_state.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/linux_proc_extras.pp b/manifests/integrations/linux_proc_extras.pp index 75390ad6..5395d9db 100644 --- a/manifests/integrations/linux_proc_extras.pp +++ b/manifests/integrations/linux_proc_extras.pp @@ -18,10 +18,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/linux_proc_extras.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/linux_proc_extras.yaml" + $dst = "${datadog_agent::conf6_dir}/linux_proc_extras.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/linux_proc_extras.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/marathon.pp b/manifests/integrations/marathon.pp index 92c7f4ce..e9737414 100644 --- a/manifests/integrations/marathon.pp +++ b/manifests/integrations/marathon.pp @@ -18,10 +18,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/marathon.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/marathon.yaml" + $dst = "${datadog_agent::conf6_dir}/marathon.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/marathon.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/memcache.pp b/manifests/integrations/memcache.pp index 0bab94f5..ec5a00e8 100644 --- a/manifests/integrations/memcache.pp +++ b/manifests/integrations/memcache.pp @@ -57,10 +57,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/mcache.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/mcache.yaml" + $dst = "${datadog_agent::conf6_dir}/mcache.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/mcache.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/mesos_master.pp b/manifests/integrations/mesos_master.pp index 3b0a7004..d4d870e8 100644 --- a/manifests/integrations/mesos_master.pp +++ b/manifests/integrations/mesos_master.pp @@ -19,7 +19,7 @@ include datadog_agent if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/mesos.yaml" + $dst = "${datadog_agent::conf6_dir}/mesos.d/conf.yaml" } else { $dst = "${datadog_agent::conf_dir}/mesos.yaml" } @@ -28,10 +28,14 @@ ensure => 'absent' } + $legacy_dst_master = "${datadog_agent::conf_dir}/mesos_master.yaml" if !$::datadog_agent::agent5_enable { - $dst_master = "${datadog_agent::conf6_dir}/mesos_master.yaml" + $dst_master = "${datadog_agent::conf6_dir}/mesos_master.d/conf.yaml" + file { $legacy_dst_master: + ensure => 'absent' + } } else { - $dst_master = "${datadog_agent::conf_dir}/mesos_master.yaml" + $dst_master = $legacy_dst_master } file { $dst_master: diff --git a/manifests/integrations/mesos_slave.pp b/manifests/integrations/mesos_slave.pp index 0f9d2ba3..a51cd8dc 100644 --- a/manifests/integrations/mesos_slave.pp +++ b/manifests/integrations/mesos_slave.pp @@ -17,10 +17,14 @@ $url = 'http://localhost:5051' ) inherits datadog_agent::params { + $legacy_dst = "${datadog_agent::conf_dir}/mesos_slave.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/mesos_slave.yaml" + $dst = "${datadog_agent::conf6_dir}/mesos_slave.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/mesos_slave.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/mongo.pp b/manifests/integrations/mongo.pp index 9a1c7041..5c70f5b1 100644 --- a/manifests/integrations/mongo.pp +++ b/manifests/integrations/mongo.pp @@ -64,10 +64,14 @@ validate_legacy('Array', 'validate_array', $servers) + $legacy_dst = "${datadog_agent::conf_dir}/mongo.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/mongo.yaml" + $dst = "${datadog_agent::conf6_dir}/mongo.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/mongo.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/mysql.pp b/manifests/integrations/mysql.pp index 9856b49c..5b185558 100644 --- a/manifests/integrations/mysql.pp +++ b/manifests/integrations/mysql.pp @@ -49,7 +49,7 @@ # extra_status_metrics => 'true', # extra_innodb_metrics => 'true', # extra_performance_metrics => 'true', -# schema_size_metrics => 'true', +# schema_size_metrics => 'true', # disable_innodb_metrics => 'false', # queries => [ # { @@ -113,10 +113,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/mysql.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/mysql.yaml" + $dst = "${datadog_agent::conf6_dir}/mysql.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/mysql.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/network.pp b/manifests/integrations/network.pp index bf0e62ef..6ba89b60 100644 --- a/manifests/integrations/network.pp +++ b/manifests/integrations/network.pp @@ -31,10 +31,14 @@ validate_legacy('Array', 'validate_array', $excluded_interfaces) + $legacy_dst = "${datadog_agent::conf_dir}/network.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/network.yaml" + $dst = "${datadog_agent::conf6_dir}/network.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/network.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/nginx.pp b/manifests/integrations/nginx.pp index 9507f58b..ce5d6144 100644 --- a/manifests/integrations/nginx.pp +++ b/manifests/integrations/nginx.pp @@ -29,10 +29,14 @@ validate_legacy('Array', 'validate_array', $instances) + $legacy_dst = "${datadog_agent::conf_dir}/nginx.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/nginx.yaml" + $dst = "${datadog_agent::conf6_dir}/nginx.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/nginx.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/ntp.pp b/manifests/integrations/ntp.pp index 35d3ebb3..6da3227e 100644 --- a/manifests/integrations/ntp.pp +++ b/manifests/integrations/ntp.pp @@ -32,10 +32,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/ntp.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/ntp.yaml" + $dst = "${datadog_agent::conf6_dir}/ntp.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/ntp.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/pgbouncer.pp b/manifests/integrations/pgbouncer.pp index 307053ae..aacc8e39 100644 --- a/manifests/integrations/pgbouncer.pp +++ b/manifests/integrations/pgbouncer.pp @@ -56,10 +56,14 @@ validate_legacy('Array', 'validate_array', $tags) validate_legacy('Array', 'validate_array', $pgbouncers) + $legacy_dst = "${datadog_agent::conf_dir}/pgbouncer.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/pgbouncer.yaml" + $dst = "${datadog_agent::conf6_dir}/pgbouncer.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/pgbouncer.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/php_fpm.pp b/manifests/integrations/php_fpm.pp index 13006128..ad44d8b2 100644 --- a/manifests/integrations/php_fpm.pp +++ b/manifests/integrations/php_fpm.pp @@ -45,10 +45,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/php_fpm.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/php_fpm.yaml" + $dst = "${datadog_agent::conf6_dir}/php_fpm.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/php_fpm.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/postfix.pp b/manifests/integrations/postfix.pp index 9cc1227a..35f118f5 100644 --- a/manifests/integrations/postfix.pp +++ b/manifests/integrations/postfix.pp @@ -52,10 +52,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/postfix.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/postfix.yaml" + $dst = "${datadog_agent::conf6_dir}/postfix.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/postfix.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/postgres.pp b/manifests/integrations/postgres.pp index 5f898018..4dcb8a24 100644 --- a/manifests/integrations/postgres.pp +++ b/manifests/integrations/postgres.pp @@ -73,10 +73,14 @@ validate_legacy('Array[String]', 'validate_array', $tables) validate_legacy('Boolean', 'validate_bool', $use_psycopg2) + $legacy_dst = "${datadog_agent::conf_dir}/postgres.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/postgres.yaml" + $dst = "${datadog_agent::conf6_dir}/postgres.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/postgres.yaml" + $dst = $legacy_dst } if !$instances and $host { diff --git a/manifests/integrations/process.pp b/manifests/integrations/process.pp index 69de9f09..93fb7655 100644 --- a/manifests/integrations/process.pp +++ b/manifests/integrations/process.pp @@ -50,15 +50,19 @@ validate_legacy('Array', 'validate_array', $processes) if $hiera_processes { - $local_processes = lookup({ 'name' => 'datadog_agent::integrations::process::processes', 'default_value' => []}) + $local_processes = lookup({ 'name' => 'datadog_agent::integrations::process::processes', 'merge' => 'unique', 'default_value' => $processes }) } else { $local_processes = $processes } + $legacy_dst = "${datadog_agent::conf_dir}/process.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/process.yaml" + $dst = "${datadog_agent::conf6_dir}/process.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/process.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/rabbitmq.pp b/manifests/integrations/rabbitmq.pp index 1f9adc21..6457bf06 100644 --- a/manifests/integrations/rabbitmq.pp +++ b/manifests/integrations/rabbitmq.pp @@ -14,8 +14,8 @@ # $tag_families # Tag queues "families" based on regex match # $ssl_verify -# Skip verification of the RabbitMQ management web endpoint -# SSL certificate +# Skip verification of the RabbitMQ management web endpoint +# SSL certificate # $nodes # $nodes_regexes # Specify the nodes to collect metrics on (up to 100 nodes). @@ -70,10 +70,14 @@ validate_legacy('Array', 'validate_array', $vhosts) include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/rabbitmq.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/rabbitmq.yaml" + $dst = "${datadog_agent::conf6_dir}/rabbitmq.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/rabbitmq.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/redis.pp b/manifests/integrations/redis.pp index b33dd247..0a27b9c2 100644 --- a/manifests/integrations/redis.pp +++ b/manifests/integrations/redis.pp @@ -55,10 +55,14 @@ validate_legacy('Array', 'validate_array', $_ports) + $legacy_dst = "${datadog_agent::conf_dir}/redisdb.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/redisdb.yaml" + $dst = "${datadog_agent::conf6_dir}/redisdb.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/redisdb.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/riak.pp b/manifests/integrations/riak.pp index ac65375c..e82f43a1 100644 --- a/manifests/integrations/riak.pp +++ b/manifests/integrations/riak.pp @@ -27,10 +27,14 @@ validate_legacy('String', 'validate_string', $url) validate_legacy('Array', 'validate_array', $tags) + $legacy_dst = "${datadog_agent::conf_dir}/riak.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/riak.yaml" + $dst = "${datadog_agent::conf6_dir}/riak.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/riak.yaml" + $dst = $legacy_dst } file { diff --git a/manifests/integrations/snmp.pp b/manifests/integrations/snmp.pp index cdf20f57..4767f9df 100755 --- a/manifests/integrations/snmp.pp +++ b/manifests/integrations/snmp.pp @@ -69,7 +69,17 @@ 3 => $snmp_v3_instances, } - file { "${datadog_agent::params::conf_dir}/snmp.yaml": + $legacy_dst = "${datadog_agent::conf_dir}/snmp.yaml" + if !$::datadog_agent::agent5_enable { + $dst = "${datadog_agent::conf6_dir}/snmp.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } + } else { + $dst = $legacy_dst + } + + file { $dst: ensure => file, owner => $datadog_agent::params::dd_user, group => $datadog_agent::params::dd_group, diff --git a/manifests/integrations/solr.pp b/manifests/integrations/solr.pp index 7f537d76..5df893d5 100644 --- a/manifests/integrations/solr.pp +++ b/manifests/integrations/solr.pp @@ -38,10 +38,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/solr.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/solr.yaml" + $dst = "${datadog_agent::conf6_dir}/solr.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/solr.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/ssh.pp b/manifests/integrations/ssh.pp index fcbdf209..57857b7a 100644 --- a/manifests/integrations/ssh.pp +++ b/manifests/integrations/ssh.pp @@ -37,10 +37,14 @@ ) inherits datadog_agent::params { include ::datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/ssh.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/ssh.yaml" + $dst = "${datadog_agent::conf6_dir}/ssh.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/ssh.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/supervisord.pp b/manifests/integrations/supervisord.pp index 2cebee18..2c347aef 100644 --- a/manifests/integrations/supervisord.pp +++ b/manifests/integrations/supervisord.pp @@ -5,9 +5,9 @@ # Parameters: # servername # socket -# Optional. The socket on which supervisor listen for HTTP/XML-RPC requests. +# Optional. The socket on which supervisor listen for HTTP/XML-RPC requests. # hostname -# Optional. The host where supervisord server is running. +# Optional. The host where supervisord server is running. # port # Optional. The port number. # username @@ -16,7 +16,7 @@ # specify a username and password that will be used in the check. # proc_names # Optional. The process to monitor within this supervisord instance. -# If not specified, the check will monitor all processes. +# If not specified, the check will monitor all processes. # server_check # Optional. Service check for connections to supervisord server. # @@ -46,10 +46,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/supervisord.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/supervisord.yaml" + $dst = "${datadog_agent::conf6_dir}/supervisord.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/supervisord.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/system_core.pp b/manifests/integrations/system_core.pp index 69005b4d..f01f4b83 100644 --- a/manifests/integrations/system_core.pp +++ b/manifests/integrations/system_core.pp @@ -9,8 +9,17 @@ class datadog_agent::integrations::system_core inherits datadog_agent::params { include datadog_agent - file { - "${datadog_agent::params::conf_dir}/system_core.yaml": + $legacy_dst = "${datadog_agent::conf_dir}/system_core.yaml" + if !$::datadog_agent::agent5_enable { + $dst = "${datadog_agent::conf6_dir}/system_core.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } + } else { + $dst = $legacy_dst + } + + file { $dst: ensure => file, owner => $datadog_agent::params::dd_user, group => $datadog_agent::params::dd_group, diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index eeda1755..3bc74f0a 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -4,31 +4,31 @@ # # Parameters: # name -# (Required) - Name of the service. +# (Required) - Name of the service. # This will be included as a tag: instance:. # # host -# (Required) - Host to be checked. +# (Required) - Host to be checked. # This will be included as a tag: url::. # # port -# (Required) - Port to be checked. +# (Required) - Port to be checked. # This will be included as a tag: url::. # # timeout # (Optional) - Timeout for the check. Defaults to 10 seconds. # # threshold -# (Optional) - Used in conjunction with window. An alert will +# (Optional) - Used in conjunction with window. An alert will # trigger if the check fails times in attempts. # # window # (Optional) - Refer to threshold. # # collect_response_time -# (Optional) - Defaults to false. If this is not set to true, no -# response time metric will be collected. If it is set to true, the -# metric returned is network.tcp.response_time. +# (Optional) - Defaults to false. If this is not set to true, no +# response time metric will be collected. If it is set to true, the +# metric returned is network.tcp.response_time. # # skip_event # The (optional) skip_event parameter will instruct the check to not @@ -117,10 +117,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/tcp_check.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/tcp_check.yaml" + $dst = "${datadog_agent::conf6_dir}/tcp_check.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/tcp_check.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/tomcat.pp b/manifests/integrations/tomcat.pp index 48ae4916..f5bdc698 100644 --- a/manifests/integrations/tomcat.pp +++ b/manifests/integrations/tomcat.pp @@ -39,10 +39,14 @@ include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/tomcat.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/tomcat.yaml" + $dst = "${datadog_agent::conf6_dir}/tomcat.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/tomcat.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/twemproxy.pp b/manifests/integrations/twemproxy.pp index 0f8e2f84..f38b46fd 100644 --- a/manifests/integrations/twemproxy.pp +++ b/manifests/integrations/twemproxy.pp @@ -41,10 +41,14 @@ $_instances = $instances } + $legacy_dst = "${datadog_agent::conf_dir}/twemproxy.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/twemproxy.yaml" + $dst = "${datadog_agent::conf6_dir}/twemproxy.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/twemproxy.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/varnish.pp b/manifests/integrations/varnish.pp index 5d6d8111..723473ed 100644 --- a/manifests/integrations/varnish.pp +++ b/manifests/integrations/varnish.pp @@ -28,10 +28,14 @@ ) inherits datadog_agent::params { include datadog_agent + $legacy_dst = "${datadog_agent::conf_dir}/varnish.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/varnish.yaml" + $dst = "${datadog_agent::conf6_dir}/varnish.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/varnish.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/integrations/zk.pp b/manifests/integrations/zk.pp index 4adb94d3..c110b008 100644 --- a/manifests/integrations/zk.pp +++ b/manifests/integrations/zk.pp @@ -34,10 +34,14 @@ validate_legacy('Array', 'validate_array', $servers) + $legacy_dst = "${datadog_agent::conf_dir}/zk.yaml" if !$::datadog_agent::agent5_enable { - $dst = "${datadog_agent::conf6_dir}/zk.yaml" + $dst = "${datadog_agent::conf6_dir}/zk.d/conf.yaml" + file { $legacy_dst: + ensure => 'absent' + } } else { - $dst = "${datadog_agent::conf_dir}/zk.yaml" + $dst = $legacy_dst } file { $dst: diff --git a/manifests/params.pp b/manifests/params.pp index 6d659604..d4062dcb 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -3,10 +3,6 @@ # This class contains the parameters for the Datadog module # # Parameters: -# $api_key: -# Your DataDog API Key. Please replace with your key value -# $dd_url -# The URL to the DataDog application. # # Actions: # diff --git a/spec/classes/datadog_agent_integrations_apache_spec.rb b/spec/classes/datadog_agent_integrations_apache_spec.rb index 42c86629..2e185f71 100644 --- a/spec/classes/datadog_agent_integrations_apache_spec.rb +++ b/spec/classes/datadog_agent_integrations_apache_spec.rb @@ -15,7 +15,11 @@ let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } let(:agent5_enable) { enabled } - let(:conf_file) { "#{conf_dir}/apache.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/apache.yaml" } + else + let(:conf_file) { "#{conf_dir}/apache.d/conf.yaml" } + end it { should compile.with_all_deps } diff --git a/spec/classes/datadog_agent_integrations_cacti_spec.rb b/spec/classes/datadog_agent_integrations_cacti_spec.rb index 11c15fd7..9c239ace 100644 --- a/spec/classes/datadog_agent_integrations_cacti_spec.rb +++ b/spec/classes/datadog_agent_integrations_cacti_spec.rb @@ -18,7 +18,11 @@ let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } let(:agent5_enable) { enabled } - let(:conf_file) { "#{conf_dir}/cacti.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/cacti.yaml" } + else + let(:conf_file) { "#{conf_dir}/cacti.d/conf.yaml" } + end context 'with default parameters' do it { should compile } diff --git a/spec/classes/datadog_agent_integrations_cassandra_spec.rb b/spec/classes/datadog_agent_integrations_cassandra_spec.rb index 949bb1e3..a620ee06 100644 --- a/spec/classes/datadog_agent_integrations_cassandra_spec.rb +++ b/spec/classes/datadog_agent_integrations_cassandra_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/cassandra.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/cassandra.yaml" } + else + let(:conf_file) { "#{conf_dir}/cassandra.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_class('datadog_agent') } diff --git a/spec/classes/datadog_agent_integrations_ceph_spec.rb b/spec/classes/datadog_agent_integrations_ceph_spec.rb index 079194c6..11f9c1f0 100644 --- a/spec/classes/datadog_agent_integrations_ceph_spec.rb +++ b/spec/classes/datadog_agent_integrations_ceph_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/ceph.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/ceph.yaml" } + else + let(:conf_file) { "#{conf_dir}/ceph.d/conf.yaml" } + end let(:sudo_conf_file) { '/etc/sudoers.d/datadog_ceph' } it { should compile.with_all_deps } diff --git a/spec/classes/datadog_agent_integrations_consul_spec.rb b/spec/classes/datadog_agent_integrations_consul_spec.rb index 27f05e03..453f5893 100644 --- a/spec/classes/datadog_agent_integrations_consul_spec.rb +++ b/spec/classes/datadog_agent_integrations_consul_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/consul.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/consul.yaml" } + else + let(:conf_file) { "#{conf_dir}/consul.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_directory_spec.rb b/spec/classes/datadog_agent_integrations_directory_spec.rb index b411a3f9..3538fee5 100644 --- a/spec/classes/datadog_agent_integrations_directory_spec.rb +++ b/spec/classes/datadog_agent_integrations_directory_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/directory.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/directory.yaml" } + else + let(:conf_file) { "#{conf_dir}/directory.d/conf.yaml" } + end context 'with default parameters' do it { should_not compile } diff --git a/spec/classes/datadog_agent_integrations_disk_spec.rb b/spec/classes/datadog_agent_integrations_disk_spec.rb index 43c2a216..370bf36b 100644 --- a/spec/classes/datadog_agent_integrations_disk_spec.rb +++ b/spec/classes/datadog_agent_integrations_disk_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/disk.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/disk.yaml" } + else + let(:conf_file) { "#{conf_dir}/disk.d/conf.yaml" } + end it { is_expected.to compile.with_all_deps } it { is_expected.to contain_file(conf_file).with_content( @@ -49,6 +53,8 @@ }} let(:yaml_conf) { <<-HEREDOC +### MANAGED BY PUPPET + init_config: instances: diff --git a/spec/classes/datadog_agent_integrations_dns_check_spec.rb b/spec/classes/datadog_agent_integrations_dns_check_spec.rb index d6e93534..3a12fa33 100644 --- a/spec/classes/datadog_agent_integrations_dns_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_dns_check_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/dns_check.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/dns_check.yaml" } + else + let(:conf_file) { "#{conf_dir}/dns_check.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb b/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb index 80285d87..66301441 100644 --- a/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb +++ b/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb @@ -20,7 +20,7 @@ if enabled let(:conf_file) { "#{conf_dir}/docker_daemon.yaml" } else - let(:conf_file) { "#{conf_dir}/docker.yaml" } + let(:conf_file) { "#{conf_dir}/docker.d/conf.yaml" } end it { should compile.with_all_deps } diff --git a/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb b/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb index e39ca5d1..c6bd032b 100644 --- a/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb +++ b/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/elastic.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/elastic.yaml" } + else + let(:conf_file) { "#{conf_dir}/elastic.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_fluentd_spec.rb b/spec/classes/datadog_agent_integrations_fluentd_spec.rb index d790c9a8..361c0fa6 100644 --- a/spec/classes/datadog_agent_integrations_fluentd_spec.rb +++ b/spec/classes/datadog_agent_integrations_fluentd_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/fluentd.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/fluentd.yaml" } + else + let(:conf_file) { "#{conf_dir}/fluentd.d/conf.yaml" } + end context 'with default parameters' do it { should compile } diff --git a/spec/classes/datadog_agent_integrations_haproxy_spec.rb b/spec/classes/datadog_agent_integrations_haproxy_spec.rb index d61bbcd4..2d300081 100644 --- a/spec/classes/datadog_agent_integrations_haproxy_spec.rb +++ b/spec/classes/datadog_agent_integrations_haproxy_spec.rb @@ -18,7 +18,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/haproxy.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/haproxy.yaml" } + else + let(:conf_file) { "#{conf_dir}/haproxy.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_http_check_spec.rb b/spec/classes/datadog_agent_integrations_http_check_spec.rb index ec2276c7..09d2f6bf 100644 --- a/spec/classes/datadog_agent_integrations_http_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_http_check_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/http_check.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/http_check.yaml" } + else + let(:conf_file) { "#{conf_dir}/http_check.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_jenkins_spec.rb b/spec/classes/datadog_agent_integrations_jenkins_spec.rb index 2f1342fe..25337aa8 100644 --- a/spec/classes/datadog_agent_integrations_jenkins_spec.rb +++ b/spec/classes/datadog_agent_integrations_jenkins_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/jenkins.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/jenkins.yaml" } + else + let(:conf_file) { "#{conf_dir}/jenkins.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_jmx_spec.rb b/spec/classes/datadog_agent_integrations_jmx_spec.rb index 423cf7a0..838b5f1c 100644 --- a/spec/classes/datadog_agent_integrations_jmx_spec.rb +++ b/spec/classes/datadog_agent_integrations_jmx_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/jmx.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/jmx.yaml" } + else + let(:conf_file) { "#{conf_dir}/jmx.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_kafka_spec.rb b/spec/classes/datadog_agent_integrations_kafka_spec.rb index a937ca5f..3adb24d5 100644 --- a/spec/classes/datadog_agent_integrations_kafka_spec.rb +++ b/spec/classes/datadog_agent_integrations_kafka_spec.rb @@ -18,7 +18,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/kafka.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/kafka.yaml" } + else + let(:conf_file) { "#{conf_dir}/kafka.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_kong_spec.rb b/spec/classes/datadog_agent_integrations_kong_spec.rb index 49914449..ee6a1237 100644 --- a/spec/classes/datadog_agent_integrations_kong_spec.rb +++ b/spec/classes/datadog_agent_integrations_kong_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/kong.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/kong.yaml" } + else + let(:conf_file) { "#{conf_dir}/kong.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_kubernetes_spec.rb b/spec/classes/datadog_agent_integrations_kubernetes_spec.rb index de164bd4..2f8257fd 100644 --- a/spec/classes/datadog_agent_integrations_kubernetes_spec.rb +++ b/spec/classes/datadog_agent_integrations_kubernetes_spec.rb @@ -20,7 +20,7 @@ if enabled let(:conf_file) { "#{conf_dir}/kubernetes.yaml" } else - let(:conf_file) { "#{conf_dir}/kubernetes.yaml" } + let(:conf_file) { "#{conf_dir}/kubernetes.d/conf.yaml" } end it { should compile.with_all_deps } diff --git a/spec/classes/datadog_agent_integrations_kubernetes_state_spec.rb b/spec/classes/datadog_agent_integrations_kubernetes_state_spec.rb index 474d911d..7b05c17c 100644 --- a/spec/classes/datadog_agent_integrations_kubernetes_state_spec.rb +++ b/spec/classes/datadog_agent_integrations_kubernetes_state_spec.rb @@ -20,7 +20,7 @@ if enabled let(:conf_file) { "#{conf_dir}/kubernetes_state.yaml" } else - let(:conf_file) { "#{conf_dir}/kubernetes_state.yaml" } + let(:conf_file) { "#{conf_dir}/kubernetes_state.d/conf.yaml" } end it { should compile.with_all_deps } diff --git a/spec/classes/datadog_agent_integrations_marathon_spec.rb b/spec/classes/datadog_agent_integrations_marathon_spec.rb index 7818a60a..c854f427 100644 --- a/spec/classes/datadog_agent_integrations_marathon_spec.rb +++ b/spec/classes/datadog_agent_integrations_marathon_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/marathon.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/marathon.yaml" } + else + let(:conf_file) { "#{conf_dir}/marathon.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_memcache_spec.rb b/spec/classes/datadog_agent_integrations_memcache_spec.rb index 5713c064..e31948ea 100644 --- a/spec/classes/datadog_agent_integrations_memcache_spec.rb +++ b/spec/classes/datadog_agent_integrations_memcache_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/mcache.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/mcache.yaml" } + else + let(:conf_file) { "#{conf_dir}/mcache.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_mesos_master_spec.rb b/spec/classes/datadog_agent_integrations_mesos_master_spec.rb index f79a26ce..461e7b59 100644 --- a/spec/classes/datadog_agent_integrations_mesos_master_spec.rb +++ b/spec/classes/datadog_agent_integrations_mesos_master_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/mesos_master.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/mesos_master.yaml" } + else + let(:conf_file) { "#{conf_dir}/mesos_master.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_mongo_spec.rb b/spec/classes/datadog_agent_integrations_mongo_spec.rb index bb624f3f..5f673ffb 100644 --- a/spec/classes/datadog_agent_integrations_mongo_spec.rb +++ b/spec/classes/datadog_agent_integrations_mongo_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/mongo.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/mongo.yaml" } + else + let(:conf_file) { "#{conf_dir}/mongo.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_mysql_spec.rb b/spec/classes/datadog_agent_integrations_mysql_spec.rb index 92ac95cf..631cc29d 100644 --- a/spec/classes/datadog_agent_integrations_mysql_spec.rb +++ b/spec/classes/datadog_agent_integrations_mysql_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/mysql.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/mysql.yaml" } + else + let(:conf_file) { "#{conf_dir}/mysql.d/conf.yaml" } + end context 'with default parameters' do it { should compile } diff --git a/spec/classes/datadog_agent_integrations_nginx_spec.rb b/spec/classes/datadog_agent_integrations_nginx_spec.rb index c3865fff..e54dd448 100644 --- a/spec/classes/datadog_agent_integrations_nginx_spec.rb +++ b/spec/classes/datadog_agent_integrations_nginx_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/nginx.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/nginx.yaml" } + else + let(:conf_file) { "#{conf_dir}/nginx.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_ntp_spec.rb b/spec/classes/datadog_agent_integrations_ntp_spec.rb index 70d80d36..632d2d97 100644 --- a/spec/classes/datadog_agent_integrations_ntp_spec.rb +++ b/spec/classes/datadog_agent_integrations_ntp_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/ntp.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/ntp.yaml" } + else + let(:conf_file) { "#{conf_dir}/ntp.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_pgbouncer_spec.rb b/spec/classes/datadog_agent_integrations_pgbouncer_spec.rb index e1ac878c..c785464e 100644 --- a/spec/classes/datadog_agent_integrations_pgbouncer_spec.rb +++ b/spec/classes/datadog_agent_integrations_pgbouncer_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/pgbouncer.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/pgbouncer.yaml" } + else + let(:conf_file) { "#{conf_dir}/pgbouncer.d/conf.yaml" } + end context 'with default parameters' do diff --git a/spec/classes/datadog_agent_integrations_php_fpm_spec.rb b/spec/classes/datadog_agent_integrations_php_fpm_spec.rb index 13ae8c4b..3a144b79 100644 --- a/spec/classes/datadog_agent_integrations_php_fpm_spec.rb +++ b/spec/classes/datadog_agent_integrations_php_fpm_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/php_fpm.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/php_fpm.yaml" } + else + let(:conf_file) { "#{conf_dir}/php_fpm.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_postfix_spec.rb b/spec/classes/datadog_agent_integrations_postfix_spec.rb index 48045f1e..1263f493 100644 --- a/spec/classes/datadog_agent_integrations_postfix_spec.rb +++ b/spec/classes/datadog_agent_integrations_postfix_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/postfix.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/postfix.yaml" } + else + let(:conf_file) { "#{conf_dir}/postfix.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_postgres_spec.rb b/spec/classes/datadog_agent_integrations_postgres_spec.rb index 2aa9e749..e28b35b7 100644 --- a/spec/classes/datadog_agent_integrations_postgres_spec.rb +++ b/spec/classes/datadog_agent_integrations_postgres_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/postgres.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/postgres.yaml" } + else + let(:conf_file) { "#{conf_dir}/postgres.d/conf.yaml" } + end context 'with default parameters' do it { should_not compile } diff --git a/spec/classes/datadog_agent_integrations_process_spec.rb b/spec/classes/datadog_agent_integrations_process_spec.rb index e92155a4..5ea0cc40 100644 --- a/spec/classes/datadog_agent_integrations_process_spec.rb +++ b/spec/classes/datadog_agent_integrations_process_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/process.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/process.yaml" } + else + let(:conf_file) { "#{conf_dir}/process.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_rabbitmq_spec.rb b/spec/classes/datadog_agent_integrations_rabbitmq_spec.rb index 8bc8ccc0..d1114bce 100644 --- a/spec/classes/datadog_agent_integrations_rabbitmq_spec.rb +++ b/spec/classes/datadog_agent_integrations_rabbitmq_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/rabbitmq.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/rabbitmq.yaml" } + else + let(:conf_file) { "#{conf_dir}/rabbitmq.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_redis_spec.rb b/spec/classes/datadog_agent_integrations_redis_spec.rb index 255dd153..81068011 100644 --- a/spec/classes/datadog_agent_integrations_redis_spec.rb +++ b/spec/classes/datadog_agent_integrations_redis_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/redisdb.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/redisdb.yaml" } + else + let(:conf_file) { "#{conf_dir}/redisdb.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_riak_spec.rb b/spec/classes/datadog_agent_integrations_riak_spec.rb index 9be05acd..879b8be5 100644 --- a/spec/classes/datadog_agent_integrations_riak_spec.rb +++ b/spec/classes/datadog_agent_integrations_riak_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/riak.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/riak.yaml" } + else + let(:conf_file) { "#{conf_dir}/riak.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_snmp_spec.rb b/spec/classes/datadog_agent_integrations_snmp_spec.rb index 5ae83687..cf3d5691 100644 --- a/spec/classes/datadog_agent_integrations_snmp_spec.rb +++ b/spec/classes/datadog_agent_integrations_snmp_spec.rb @@ -1,30 +1,43 @@ require 'spec_helper' describe 'datadog_agent::integrations::snmp' do - let(:conf_dir) { '/etc/dd-agent/conf.d' } - let(:dd_user) { 'dd-agent' } - let(:dd_group) { 'root' } - let(:dd_package) { 'datadog-agent' } - let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/snmp.yaml" } + context 'supported agents - v5 and v6' do + agents = { '5' => true, '6' => false } + agents.each do |_, enabled| + if enabled + let(:conf_dir) { '/etc/dd-agent/conf.d' } + else + let(:conf_dir) { '/etc/datadog-agent/conf.d' } + end + let(:dd_user) { 'dd-agent' } + let(:dd_group) { 'root' } + let(:dd_package) { 'datadog-agent' } + let(:dd_service) { 'datadog-agent' } + if enabled + let(:conf_file) { "#{conf_dir}/snmp.yaml" } + else + let(:conf_file) { "#{conf_dir}/snmp.d/conf.yaml" } + end - it { should compile.with_all_deps } - it {should contain_file(conf_file).with( - owner: dd_user, - group: dd_group, - mode: '0600', - )} - it { should contain_file(conf_file).that_requires("Package[#{dd_package}]") } - it { should contain_file(conf_file).that_notifies("Service[#{dd_service}]") } + it { should compile.with_all_deps } + it {should contain_file(conf_file).with( + owner: dd_user, + group: dd_group, + mode: '0600', + )} + it { should contain_file(conf_file).that_requires("Package[#{dd_package}]") } + it { should contain_file(conf_file).that_notifies("Service[#{dd_service}]") } - context 'with default parameters' do - it { should contain_file(conf_file).without_content(/ignore_nonincreasing_oid/) } - end + context 'with default parameters' do + it { should contain_file(conf_file).without_content(/ignore_nonincreasing_oid/) } + end - context 'with parameters set' do - let(:params) {{ - ignore_nonincreasing_oid: true, - }} - it { should contain_file(conf_file).with_content(/ignore_nonincreasing_oid: true/) } + context 'with parameters set' do + let(:params) {{ + ignore_nonincreasing_oid: true, + }} + it { should contain_file(conf_file).with_content(/ignore_nonincreasing_oid: true/) } + end + end end end diff --git a/spec/classes/datadog_agent_integrations_solr_spec.rb b/spec/classes/datadog_agent_integrations_solr_spec.rb index f927faf8..b8fdeb84 100644 --- a/spec/classes/datadog_agent_integrations_solr_spec.rb +++ b/spec/classes/datadog_agent_integrations_solr_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/solr.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/solr.yaml" } + else + let(:conf_file) { "#{conf_dir}/solr.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_ssh_spec.rb b/spec/classes/datadog_agent_integrations_ssh_spec.rb index b4545e26..269ddbdf 100644 --- a/spec/classes/datadog_agent_integrations_ssh_spec.rb +++ b/spec/classes/datadog_agent_integrations_ssh_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/ssh.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/ssh.yaml" } + else + let(:conf_file) { "#{conf_dir}/ssh.d/conf.yaml" } + end context 'with default parameters' do it { should compile } diff --git a/spec/classes/datadog_agent_integrations_supervisrd_spec.rb b/spec/classes/datadog_agent_integrations_supervisrd_spec.rb index 55680068..0e6e437d 100644 --- a/spec/classes/datadog_agent_integrations_supervisrd_spec.rb +++ b/spec/classes/datadog_agent_integrations_supervisrd_spec.rb @@ -19,7 +19,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/supervisord.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/supervisord.yaml" } + else + let(:conf_file) { "#{conf_dir}/supervisord.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_system_core_spec.rb b/spec/classes/datadog_agent_integrations_system_core_spec.rb index db6af86e..f5818d05 100644 --- a/spec/classes/datadog_agent_integrations_system_core_spec.rb +++ b/spec/classes/datadog_agent_integrations_system_core_spec.rb @@ -1,27 +1,42 @@ require 'spec_helper' describe 'datadog_agent::integrations::system_core' do - let(:facts) {{ - operatingsystem: 'Ubuntu', - }} - let(:conf_dir) { '/etc/dd-agent/conf.d' } - let(:dd_user) { 'dd-agent' } - let(:dd_group) { 'root' } - let(:dd_package) { 'datadog-agent' } - let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/system_core.yaml" } + context 'supported agents - v5 and v6' do + agents = { '5' => true, '6' => false } + agents.each do |_, enabled| + let(:pre_condition) { "class {'::datadog_agent': agent5_enable => #{enabled}}" } + if enabled + let(:conf_dir) { '/etc/dd-agent/conf.d' } + else + let(:conf_dir) { '/etc/datadog-agent/conf.d' } + end - it { should compile.with_all_deps } - it { should contain_file(conf_file).with( - owner: dd_user, - group: dd_group, - mode: '0644', - )} - it { should contain_file(conf_file).that_requires("Package[#{dd_package}]") } - it { should contain_file(conf_file).that_notifies("Service[#{dd_service}]") } + let(:facts) {{ + operatingsystem: 'Ubuntu', + }} + let(:dd_user) { 'dd-agent' } + let(:dd_group) { 'root' } + let(:dd_package) { 'datadog-agent' } + let(:dd_service) { 'datadog-agent' } + if enabled + let(:conf_file) { "#{conf_dir}/system_core.yaml" } + else + let(:conf_file) { "#{conf_dir}/system_core.d/conf.yaml" } + end - context 'with default parameters' do - it { should contain_file(conf_file).with_content(%r{instances:}) } - it { should contain_file(conf_file).with_content(%r{ - foo: bar}) } + it { should compile.with_all_deps } + it { should contain_file(conf_file).with( + owner: dd_user, + group: dd_group, + mode: '0644', + )} + it { should contain_file(conf_file).that_requires("Package[#{dd_package}]") } + it { should contain_file(conf_file).that_notifies("Service[#{dd_service}]") } + + context 'with default parameters' do + it { should contain_file(conf_file).with_content(%r{instances:}) } + it { should contain_file(conf_file).with_content(%r{ - foo: bar}) } + end + end end end diff --git a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb index 55cf5169..6948878c 100644 --- a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/tcp_check.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/tcp_check.yaml" } + else + let(:conf_file) { "#{conf_dir}/tcp_check.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_tomcat_spec.rb b/spec/classes/datadog_agent_integrations_tomcat_spec.rb index 38a40198..89043965 100644 --- a/spec/classes/datadog_agent_integrations_tomcat_spec.rb +++ b/spec/classes/datadog_agent_integrations_tomcat_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/tomcat.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/tomcat.yaml" } + else + let(:conf_file) { "#{conf_dir}/tomcat.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_twemproxy_spec.rb b/spec/classes/datadog_agent_integrations_twemproxy_spec.rb index f8eacdcd..9f33108f 100644 --- a/spec/classes/datadog_agent_integrations_twemproxy_spec.rb +++ b/spec/classes/datadog_agent_integrations_twemproxy_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/twemproxy.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/twemproxy.yaml" } + else + let(:conf_file) { "#{conf_dir}/twemproxy.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_varnish_spec.rb b/spec/classes/datadog_agent_integrations_varnish_spec.rb index 0028fe91..d7a6e15f 100644 --- a/spec/classes/datadog_agent_integrations_varnish_spec.rb +++ b/spec/classes/datadog_agent_integrations_varnish_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/varnish.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/varnish.yaml" } + else + let(:conf_file) { "#{conf_dir}/varnish.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_integrations_zk_spec.rb b/spec/classes/datadog_agent_integrations_zk_spec.rb index be50ef2e..8e44cd10 100644 --- a/spec/classes/datadog_agent_integrations_zk_spec.rb +++ b/spec/classes/datadog_agent_integrations_zk_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/zk.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/zk.yaml" } + else + let(:conf_file) { "#{conf_dir}/zk.d/conf.yaml" } + end it { should compile.with_all_deps } it { should contain_file(conf_file).with( diff --git a/spec/classes/datadog_agent_intergrations_network_spec.rb b/spec/classes/datadog_agent_intergrations_network_spec.rb index f6aba4c6..60650f7d 100644 --- a/spec/classes/datadog_agent_intergrations_network_spec.rb +++ b/spec/classes/datadog_agent_intergrations_network_spec.rb @@ -17,7 +17,11 @@ let(:dd_group) { 'root' } let(:dd_package) { 'datadog-agent' } let(:dd_service) { 'datadog-agent' } - let(:conf_file) { "#{conf_dir}/network.yaml" } + if enabled + let(:conf_file) { "#{conf_dir}/network.yaml" } + else + let(:conf_file) { "#{conf_dir}/network.d/conf.yaml" } + end context 'with default parameters' do it { should compile } diff --git a/templates/agent-conf.d/apache.yaml.erb b/templates/agent-conf.d/apache.yaml.erb index f73f04ea..93afc187 100644 --- a/templates/agent-conf.d/apache.yaml.erb +++ b/templates/agent-conf.d/apache.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: instances: diff --git a/templates/agent-conf.d/cacti.yaml.erb b/templates/agent-conf.d/cacti.yaml.erb index 75533dc0..5aa2a6f9 100644 --- a/templates/agent-conf.d/cacti.yaml.erb +++ b/templates/agent-conf.d/cacti.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/cassandra.yaml.erb b/templates/agent-conf.d/cassandra.yaml.erb index 38cf4965..b35e2b38 100644 --- a/templates/agent-conf.d/cassandra.yaml.erb +++ b/templates/agent-conf.d/cassandra.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET instances: - host: <%= @host %> @@ -52,7 +50,7 @@ init_config: domain: org.apache.cassandra.metrics type: ColumnFamily bean_regex: - - .*keyspace=.* + - .*keyspace=.* name: - TotalDiskSpaceUsed - BloomFilterDiskSpaceUsed diff --git a/templates/agent-conf.d/ceph.yaml.erb b/templates/agent-conf.d/ceph.yaml.erb index 52f94595..c9b8b05a 100644 --- a/templates/agent-conf.d/ceph.yaml.erb +++ b/templates/agent-conf.d/ceph.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: instances: diff --git a/templates/agent-conf.d/consul.yaml.erb b/templates/agent-conf.d/consul.yaml.erb index 56333806..98818b5b 100644 --- a/templates/agent-conf.d/consul.yaml.erb +++ b/templates/agent-conf.d/consul.yaml.erb @@ -1,3 +1,4 @@ +### MANAGED BY PUPPET # This check takes no init_config init_config: diff --git a/templates/agent-conf.d/disk.yaml.erb b/templates/agent-conf.d/disk.yaml.erb index 184bd1eb..bb76c4ff 100644 --- a/templates/agent-conf.d/disk.yaml.erb +++ b/templates/agent-conf.d/disk.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: instances: diff --git a/templates/agent-conf.d/dns_check.yaml.erb b/templates/agent-conf.d/dns_check.yaml.erb index 6e578c8d..5d85f24c 100644 --- a/templates/agent-conf.d/dns_check.yaml.erb +++ b/templates/agent-conf.d/dns_check.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: default_timeout: 4 diff --git a/templates/agent-conf.d/docker_daemon.yaml.erb b/templates/agent-conf.d/docker_daemon.yaml.erb index f7d6c32d..b284f7ef 100644 --- a/templates/agent-conf.d/docker_daemon.yaml.erb +++ b/templates/agent-conf.d/docker_daemon.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: # Change the root directory to look at to get cgroup statistics. Useful when running inside a # container with host directories mounted on a different folder. Default: /. diff --git a/templates/agent-conf.d/elastic.yaml.erb b/templates/agent-conf.d/elastic.yaml.erb index 1f917f41..9389ac46 100644 --- a/templates/agent-conf.d/elastic.yaml.erb +++ b/templates/agent-conf.d/elastic.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/fluentd.yaml.erb b/templates/agent-conf.d/fluentd.yaml.erb index 6d0379f9..a5e2392b 100644 --- a/templates/agent-conf.d/fluentd.yaml.erb +++ b/templates/agent-conf.d/fluentd.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/haproxy.yaml.erb b/templates/agent-conf.d/haproxy.yaml.erb index 1d07c663..ed275b98 100644 --- a/templates/agent-conf.d/haproxy.yaml.erb +++ b/templates/agent-conf.d/haproxy.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/jenkins.yaml.erb b/templates/agent-conf.d/jenkins.yaml.erb index 4bbeac39..2b39d863 100644 --- a/templates/agent-conf.d/jenkins.yaml.erb +++ b/templates/agent-conf.d/jenkins.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/jmx.yaml.erb b/templates/agent-conf.d/jmx.yaml.erb index 382e17f7..c1adfa07 100644 --- a/templates/agent-conf.d/jmx.yaml.erb +++ b/templates/agent-conf.d/jmx.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + <% require 'yaml' %> diff --git a/templates/agent-conf.d/kafka.yaml.erb b/templates/agent-conf.d/kafka.yaml.erb index 3d496308..47c0c871 100644 --- a/templates/agent-conf.d/kafka.yaml.erb +++ b/templates/agent-conf.d/kafka.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET ########## # WARNING diff --git a/templates/agent-conf.d/kong.yaml.erb b/templates/agent-conf.d/kong.yaml.erb index af34a3c3..0a4224a8 100644 --- a/templates/agent-conf.d/kong.yaml.erb +++ b/templates/agent-conf.d/kong.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/kubernetes.yaml.erb b/templates/agent-conf.d/kubernetes.yaml.erb index be524268..7e437af4 100644 --- a/templates/agent-conf.d/kubernetes.yaml.erb +++ b/templates/agent-conf.d/kubernetes.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: # Initialization retries # diff --git a/templates/agent-conf.d/kubernetes_state.yaml.erb b/templates/agent-conf.d/kubernetes_state.yaml.erb index 92ddc863..a7e6d0b8 100644 --- a/templates/agent-conf.d/kubernetes_state.yaml.erb +++ b/templates/agent-conf.d/kubernetes_state.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: # Custom tags can be added to all metrics reported by this integration <% if @tags and ! @tags.empty? -%> diff --git a/templates/agent-conf.d/logs.yaml.erb b/templates/agent-conf.d/logs.yaml.erb index 7e93638c..ac8940b2 100644 --- a/templates/agent-conf.d/logs.yaml.erb +++ b/templates/agent-conf.d/logs.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + <% require 'yaml' %> diff --git a/templates/agent-conf.d/marathon.yaml.erb b/templates/agent-conf.d/marathon.yaml.erb index 39035046..df773325 100644 --- a/templates/agent-conf.d/marathon.yaml.erb +++ b/templates/agent-conf.d/marathon.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: default_timeout: <%= @marathon_timeout %> diff --git a/templates/agent-conf.d/mcache.yaml.erb b/templates/agent-conf.d/mcache.yaml.erb index 1f6002d1..ef32b975 100644 --- a/templates/agent-conf.d/mcache.yaml.erb +++ b/templates/agent-conf.d/mcache.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/mesos_master.yaml.erb b/templates/agent-conf.d/mesos_master.yaml.erb index bb67c598..f5c79aa5 100644 --- a/templates/agent-conf.d/mesos_master.yaml.erb +++ b/templates/agent-conf.d/mesos_master.yaml.erb @@ -1,3 +1,4 @@ +### MANAGED BY PUPPET init_config: default_timeout: <%= @mesos_timeout %> diff --git a/templates/agent-conf.d/mesos_slave.yaml.erb b/templates/agent-conf.d/mesos_slave.yaml.erb index 17c2e594..7ad1be09 100644 --- a/templates/agent-conf.d/mesos_slave.yaml.erb +++ b/templates/agent-conf.d/mesos_slave.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: default_timeout: <%= @mesos_timeout %> diff --git a/templates/agent-conf.d/mongo.yaml.erb b/templates/agent-conf.d/mongo.yaml.erb index 1354b1f6..4e353974 100644 --- a/templates/agent-conf.d/mongo.yaml.erb +++ b/templates/agent-conf.d/mongo.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/mysql.yaml.erb b/templates/agent-conf.d/mysql.yaml.erb index bea6461d..63b7d1b5 100644 --- a/templates/agent-conf.d/mysql.yaml.erb +++ b/templates/agent-conf.d/mysql.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/network.yaml.erb b/templates/agent-conf.d/network.yaml.erb index a027015b..d224b458 100644 --- a/templates/agent-conf.d/network.yaml.erb +++ b/templates/agent-conf.d/network.yaml.erb @@ -1,6 +1,5 @@ -# # -# MANAGED BY PUPPET # -# # +### MANAGED BY PUPPET + init_config: instances: diff --git a/templates/agent-conf.d/nginx.yaml.erb b/templates/agent-conf.d/nginx.yaml.erb index d5c1ee15..ac6f7364 100644 --- a/templates/agent-conf.d/nginx.yaml.erb +++ b/templates/agent-conf.d/nginx.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET # init_config: diff --git a/templates/agent-conf.d/pgbouncer.yaml.erb b/templates/agent-conf.d/pgbouncer.yaml.erb index a96dd134..2d095b30 100644 --- a/templates/agent-conf.d/pgbouncer.yaml.erb +++ b/templates/agent-conf.d/pgbouncer.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + <% require 'yaml' %> diff --git a/templates/agent-conf.d/php_fpm.yaml.erb b/templates/agent-conf.d/php_fpm.yaml.erb index e748aa30..51806689 100644 --- a/templates/agent-conf.d/php_fpm.yaml.erb +++ b/templates/agent-conf.d/php_fpm.yaml.erb @@ -1,6 +1,5 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET + init_config: instances: diff --git a/templates/agent-conf.d/postfix.yaml.erb b/templates/agent-conf.d/postfix.yaml.erb index 0821186c..bc251ec9 100644 --- a/templates/agent-conf.d/postfix.yaml.erb +++ b/templates/agent-conf.d/postfix.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/postgres.yaml.erb b/templates/agent-conf.d/postgres.yaml.erb index 2f344bef..aa545e4b 100644 --- a/templates/agent-conf.d/postgres.yaml.erb +++ b/templates/agent-conf.d/postgres.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: instances: diff --git a/templates/agent-conf.d/process.yaml.erb b/templates/agent-conf.d/process.yaml.erb index 349ac047..7c33a693 100644 --- a/templates/agent-conf.d/process.yaml.erb +++ b/templates/agent-conf.d/process.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET # init_config: # the check will refresh the matching pid list every X seconds diff --git a/templates/agent-conf.d/rabbitmq.yaml.erb b/templates/agent-conf.d/rabbitmq.yaml.erb index 71d51dcc..ebd5491e 100644 --- a/templates/agent-conf.d/rabbitmq.yaml.erb +++ b/templates/agent-conf.d/rabbitmq.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: instances: diff --git a/templates/agent-conf.d/redisdb.yaml.erb b/templates/agent-conf.d/redisdb.yaml.erb index c522c45e..26081278 100644 --- a/templates/agent-conf.d/redisdb.yaml.erb +++ b/templates/agent-conf.d/redisdb.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/riak.yaml.erb b/templates/agent-conf.d/riak.yaml.erb index 169fc4ae..a1c82df5 100644 --- a/templates/agent-conf.d/riak.yaml.erb +++ b/templates/agent-conf.d/riak.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: instances: diff --git a/templates/agent-conf.d/snmp.yaml.erb b/templates/agent-conf.d/snmp.yaml.erb index d9809d57..ef2199d2 100755 --- a/templates/agent-conf.d/snmp.yaml.erb +++ b/templates/agent-conf.d/snmp.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: <% if @mibs_folder -%> mibs_folder: <%= @mibs_folder %><% end -%> diff --git a/templates/agent-conf.d/solr.yaml.erb b/templates/agent-conf.d/solr.yaml.erb index 4fe6e651..353d0f00 100644 --- a/templates/agent-conf.d/solr.yaml.erb +++ b/templates/agent-conf.d/solr.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + instances: - host: <%= @hostname %> port: <%= @port %> diff --git a/templates/agent-conf.d/ssh.yaml.erb b/templates/agent-conf.d/ssh.yaml.erb index 6be72e59..19beff67 100644 --- a/templates/agent-conf.d/ssh.yaml.erb +++ b/templates/agent-conf.d/ssh.yaml.erb @@ -1,6 +1,4 @@ -# -# Managed by Puppet -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/system_core.yaml.erb b/templates/agent-conf.d/system_core.yaml.erb index 618f5add..096f1f43 100644 --- a/templates/agent-conf.d/system_core.yaml.erb +++ b/templates/agent-conf.d/system_core.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/tomcat.yaml.erb b/templates/agent-conf.d/tomcat.yaml.erb index 0c76be4a..1b11c996 100644 --- a/templates/agent-conf.d/tomcat.yaml.erb +++ b/templates/agent-conf.d/tomcat.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + instances: - host: <%= @hostname %> port: <%= @port %> diff --git a/templates/agent-conf.d/twemproxy.yaml.erb b/templates/agent-conf.d/twemproxy.yaml.erb index 9c4fdaa0..a0158ff1 100644 --- a/templates/agent-conf.d/twemproxy.yaml.erb +++ b/templates/agent-conf.d/twemproxy.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/agent-conf.d/varnish.yaml.erb b/templates/agent-conf.d/varnish.yaml.erb index 3098e608..00f89bfc 100644 --- a/templates/agent-conf.d/varnish.yaml.erb +++ b/templates/agent-conf.d/varnish.yaml.erb @@ -1,3 +1,5 @@ +### MANAGED BY PUPPET + init_config: instances: diff --git a/templates/agent-conf.d/zk.yaml.erb b/templates/agent-conf.d/zk.yaml.erb index ea970c04..5031b1e9 100644 --- a/templates/agent-conf.d/zk.yaml.erb +++ b/templates/agent-conf.d/zk.yaml.erb @@ -1,6 +1,4 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET init_config: diff --git a/templates/datadog-reports.yaml.erb b/templates/datadog-reports.yaml.erb index 52f1aef0..a09a40df 100644 --- a/templates/datadog-reports.yaml.erb +++ b/templates/datadog-reports.yaml.erb @@ -1,6 +1,5 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET + --- :datadog_api_key: '<%= @api_key %>' :api_url: api.<%= @datadog_site %> diff --git a/templates/datadog6.yaml.erb b/templates/datadog6.yaml.erb index 44c16790..b243d355 100644 --- a/templates/datadog6.yaml.erb +++ b/templates/datadog6.yaml.erb @@ -1,7 +1,6 @@ +### MANAGED BY PUPPET + <% require 'yaml' %> -# -# MANAGED BY PUPPET -# <%= @agent_config.to_yaml %> diff --git a/templates/datadog_header.conf.erb b/templates/datadog_header.conf.erb index 1b7a4783..d49c249b 100644 --- a/templates/datadog_header.conf.erb +++ b/templates/datadog_header.conf.erb @@ -1,6 +1,5 @@ -# -# MANAGED BY PUPPET -# +### MANAGED BY PUPPET + [Main] # The host of the Datadog intake server to send agent data to diff --git a/templates/datadog_tags.conf.erb b/templates/datadog_tags.conf.erb deleted file mode 100644 index e69de29b..00000000