Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
16 changes: 16 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.: '^(?<hostname>.*\.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.
Expand Down Expand Up @@ -212,6 +222,7 @@
$host = '',
$api_key = 'your_API_key',
$collect_ec2_tags = false,
$collect_gce_tags = false,
$collect_instance_metadata = true,
$tags = [],
$integrations = {},
Expand All @@ -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 = '',
Expand Down Expand Up @@ -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)
Expand All @@ -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*$')
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 7 additions & 3 deletions manifests/integrations/cacti.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions manifests/integrations/cassandra.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/ceph.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/consul.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/directory.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/disk.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/dns_check.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions manifests/integrations/docker_daemon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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"
}
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/elasticsearch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/fluentd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/generic.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/haproxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/http_check.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/jenkins.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/jmx.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/kafka.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions manifests/integrations/kong.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading