Skip to content

Commit

Permalink
Merge branch 'main' into asenci/instances-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
asenci committed Feb 2, 2022
2 parents 76a7c3f + 0070680 commit 0e1ec57
Show file tree
Hide file tree
Showing 55 changed files with 83 additions and 54 deletions.
22 changes: 21 additions & 1 deletion environments/etc/manifests/site.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
node default {

class { 'datadog_agent':
api_key => 'somenonnullapikeythats32charlong',
api_key => 'somenonnullapikeythats32charlong',
agent_extra_options => {
use_http => true,
},
facts_to_tags => ['osfamily'],
integrations => {
'ntp' => {
init_config => {},
instances => [{
offset_threshold => 30,
}],
},
},
}

class { 'datadog_agent::integrations::apache':
url => 'http://example.com/server-status?auto',
username => 'status',
password => 'hunter1',
}

}
6 changes: 5 additions & 1 deletion kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ platforms:
- mkdir /home/kitchen/puppet
- printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile

- gem install bundler -v '= 1.17.3'
- gem install r10k -v 2.6.7
- cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules

Expand All @@ -45,6 +46,7 @@ platforms:
- mkdir /home/kitchen/puppet
- printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile

- gem install bundler -v '= 1.17.3'
- gem install r10k -v 2.6.7
- cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules

Expand All @@ -64,6 +66,7 @@ platforms:
- mkdir /home/kitchen/puppet
- printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile

- gem install bundler -v '= 1.17.3'
- gem install r10k -v 2.6.7
- cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules

Expand All @@ -81,7 +84,8 @@ platforms:
provision_command:
- zypper ar -G https://yum.puppet.com/puppet/sles/15/x86_64/ puppet-repo
- zypper install -y puppet-agent ruby=2.5
- gem install bundler serverspec rspec
- gem install bundler -v '= 1.17.3'
- gem install serverspec rspec
- ln -s /usr/bin/rspec.ruby2.5 /usr/bin/rspec
- ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet
- mkdir /home/kitchen/puppet
Expand Down
2 changes: 1 addition & 1 deletion manifests/install_integration.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Boolean $third_party = false,
){

include datadog_agent
require ::datadog_agent

if $ensure == 'present' {

Expand Down
4 changes: 3 additions & 1 deletion manifests/integration.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
Enum['present', 'absent'] $ensure = 'present',
){

include datadog_agent
# We can't `require ::datadog_agent` from here since this class is used by the
# datadog_agent class, causing a dependency cycle. If using this class
# directly, you should define datadog_agent before datadog_agent::integration.

if $::datadog_agent::_agent_major_version > 5 {
$dst_dir = "${datadog_agent::params::conf_dir}/${integration}.d"
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/activemq_xml.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
Optional[Array[String]] $detailed_subscribers = [],
Optional[Array] $instances = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/activemq_xml.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
Optional[Array] $instances = undef,
Optional[Array] $logs = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if !$instances {
$_instances = datadog_agent::clean_empty([{
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/cacti.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$mysql_password = undef,
$rrd_path = '/var/lib/cacti/rra/',
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/cacti.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/ceph.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Array $tags = [ 'name:ceph_cluster' ],
String $ceph_cmd = '/usr/bin/ceph',
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

file { '/etc/sudoers.d/datadog_ceph':
content => "# This file is required for dd ceph \ndd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph\n"
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/consul.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
Boolean $new_leader_checks = true,
Optional[Array] $service_whitelist = []
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/consul.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/directory.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
String $pattern = '',
Optional[Array] $instances = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if !$instances and $directory == '' {
fail('bad directory argument and no instances hash provided')
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/disk.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
Optional[String] $excluded_disk_re = undef, # deprecated in agent versions >6.9
Optional[String] $excluded_mountpoint_re = undef, # deprecated in agent versions >6.9
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

validate_legacy('Optional[String]', 'validate_re', $all_partitions, '^(no|yes)$')

Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/dns_check.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
]
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/dns_check.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/docker_daemon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
$collect_labels_as_tags = [],
$event_attributes_as_tags = [],
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

exec { 'dd-agent-should-be-in-docker-group':
command => "/usr/sbin/usermod -aG ${group} ${datadog_agent::params::dd_user}",
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/elasticsearch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
Optional[String] $username = undef,
Optional[Array] $instances = undef
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

# $ssl_verify can be a bool or a string
# https://github.com/DataDog/dd-agent/blob/master/checks.d/elastic.py#L454-L455
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/fluentd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$monitor_agent_url = 'http://localhost:24220/api/plugins.json',
Optional[Array] $plugin_ids = [],
) inherits datadog_agent::params {
include ::datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/fluentd.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/generic.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Optional[String] $integration_name = undef,
Optional[String] $integration_contents = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/${integration_name}.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/haproxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$options = {},
Optional[Array] $instances = undef
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if !$instances and $url {
$_instances = [{
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/http_check.pp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
Optional[Array] $logs = undef,
$ca_certs = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if !$instances and $url {
$_instances = [{
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/jenkins.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class datadog_agent::integrations::jenkins(
$path = '/var/lib/jenkins'
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/jenkins.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/jmx.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
$init_config = {},
$instances = [],
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/jmx.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/kafka.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
Optional[Hash[String[1], String[1]]] $tags = undef,
Optional[Array[Hash[String[1], Data]]] $instances = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if !$instances and $host and $port {
$servers = [{
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/kong.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
]
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kong.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/kubernetes.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$tags = [],

) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kubernetes.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/kubernetes_state.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$tags = [],

) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kubernetes_state.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/linux_proc_extras.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class datadog_agent::integrations::linux_proc_extras(
$tags = [],
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/linux_proc_extras.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/logs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Array $logs = [],
) inherits datadog_agent::params {
unless $::datadog_agent::_agent_major_version == 5 {
include datadog_agent
require ::datadog_agent

file { "${datadog_agent::params::conf_dir}/logs.yaml":
ensure => file,
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/marathon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$marathon_timeout = 5,
$url = 'http://localhost:8080'
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/marathon.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/memcache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
Variant[Boolean, String] $slabs = false,
Optional[Array] $instances = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if !$instances and $url {
$_instances = [{
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/mesos_master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$mesos_timeout = 10,
$url = 'http://localhost:5050'
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if $::datadog_agent::_agent_major_version > 5 {
$dst_dir = "${datadog_agent::params::conf_dir}/mesos.d"
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/mongo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
class datadog_agent::integrations::mongo(
Array $servers = [{'host' => 'localhost', 'port' => '27017'}]
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mongo.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
Optional[Array] $instances = undef,
Optional[Array] $logs = [],
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if ($host == undef and $sock == undef) or
($host != undef and $port == undef and $sock == undef) {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/network.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
String $excluded_interface_re = '',
Boolean $combine_connection_states = true,
) inherits datadog_agent::params {
include ::datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/network.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/nginx.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
Array $instances = [],
Optional[Array] $logs = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/nginx.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/ntp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$version = undef,
$timeout = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ntp.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/oom_kill.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class datadog_agent::integrations::oom_kill(
Array $instances = [],
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$dst_dir = "${datadog_agent::params::conf_dir}/oom_kill.d"
file { $dst_dir:
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/pgbouncer.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
Array $tags = [],
Array $pgbouncers = [],
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/pgbouncer.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/php_fpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$instances = undef,
$use_fastcgi = 'false'
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if !$instances {
$_instances = [{
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/postfix.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
Optional[Array] $tags = [],
Optional[Array] $instances = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

if !$instances and $directory {
$_instances = [{
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/postgres.pp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
Hash $custom_metrics = {},
Optional[Array] $instances = undef,
) inherits datadog_agent::params {
include datadog_agent
require ::datadog_agent

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/postgres.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down
Loading

0 comments on commit 0e1ec57

Please sign in to comment.