From 3342f68d008e20a01590bff96984b256facbd436 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 20 Dec 2024 15:35:06 +0000 Subject: [PATCH 001/133] add parameter data types, fix whitespacing, remove legacy facts, remove legacy :: referencing. Changes for Puppet 8 --- environments/etc/manifests/site.pp | 4 +- functions/tag6.pp | 2 +- lib/puppet/reports/datadog_reports.rb | 2 +- manifests/init.pp | 184 +++++++++--------- manifests/install_integration.pp | 7 +- manifests/integration.pp | 12 +- manifests/integrations/activemq_xml.pp | 26 +-- manifests/integrations/apache.pp | 10 +- manifests/integrations/cacti.pp | 20 +- manifests/integrations/cassandra.pp | 10 +- manifests/integrations/ceph.pp | 16 +- manifests/integrations/consul.pp | 12 +- manifests/integrations/directory.pp | 28 +-- manifests/integrations/disk.pp | 10 +- manifests/integrations/dns_check.pp | 10 +- manifests/integrations/docker_daemon.pp | 80 ++++---- manifests/integrations/elasticsearch.pp | 36 ++-- manifests/integrations/fluentd.pp | 10 +- manifests/integrations/generic.pp | 12 +- manifests/integrations/haproxy.pp | 36 ++-- manifests/integrations/http_check.pp | 125 ++++++------ manifests/integrations/jenkins.pp | 14 +- manifests/integrations/jmx.pp | 17 +- manifests/integrations/kafka.pp | 34 ++-- manifests/integrations/kong.pp | 12 +- manifests/integrations/kubernetes.pp | 22 +-- manifests/integrations/kubernetes_state.pp | 14 +- manifests/integrations/linux_proc_extras.pp | 15 +- manifests/integrations/logs.pp | 8 +- manifests/integrations/marathon.pp | 16 +- manifests/integrations/memcache.pp | 22 +-- manifests/integrations/mesos_master.pp | 22 +-- manifests/integrations/mesos_slave.pp | 15 +- manifests/integrations/mongo.pp | 14 +- manifests/integrations/mysql.pp | 53 +++-- manifests/integrations/network.pp | 10 +- manifests/integrations/nginx.pp | 12 +- manifests/integrations/ntp.pp | 22 +-- manifests/integrations/oom_kill.pp | 8 +- manifests/integrations/pgbouncer.pp | 10 +- manifests/integrations/php_fpm.pp | 38 ++-- manifests/integrations/postfix.pp | 20 +- manifests/integrations/postgres.pp | 42 ++-- .../integrations/postgres_custom_metric.pp | 3 +- manifests/integrations/process.pp | 18 +- manifests/integrations/rabbitmq.pp | 9 +- manifests/integrations/redis.pp | 16 +- manifests/integrations/riak.pp | 12 +- manifests/integrations/snmp.pp | 25 ++- manifests/integrations/solr.pp | 29 ++- manifests/integrations/ssh.pp | 26 +-- manifests/integrations/supervisord.pp | 12 +- manifests/integrations/system_core.pp | 22 +-- manifests/integrations/tcp_check.pp | 47 +++-- manifests/integrations/tomcat.pp | 32 ++- manifests/integrations/twemproxy.pp | 24 +-- manifests/integrations/varnish.pp | 16 +- manifests/integrations/zk.pp | 12 +- manifests/params.pp | 3 +- manifests/redhat.pp | 23 +-- manifests/reports.pp | 41 ++-- manifests/security_agent.pp | 9 +- manifests/service.pp | 19 +- manifests/suse.pp | 22 +-- manifests/system_probe.pp | 7 +- manifests/tag5.pp | 20 +- manifests/ubuntu.pp | 13 +- manifests/ubuntu_installer.pp | 4 +- manifests/windows.pp | 31 ++- 69 files changed, 765 insertions(+), 822 deletions(-) diff --git a/environments/etc/manifests/site.pp b/environments/etc/manifests/site.pp index 78fde18db..dc594938c 100644 --- a/environments/etc/manifests/site.pp +++ b/environments/etc/manifests/site.pp @@ -1,9 +1,8 @@ node default { - class { 'datadog_agent': api_key => 'somenonnullapikeythats32charlong', agent_extra_options => { - use_http => true, + use_http => true, }, # Hostname is necessary for Agent to start up properly in container since 7.40.0 # https://github.com/DataDog/datadog-agent/issues/14152#issuecomment-1301842615 @@ -24,5 +23,4 @@ username => 'status', password => 'hunter1', } - } diff --git a/functions/tag6.pp b/functions/tag6.pp index 8e63a1c11..8c02abbfb 100644 --- a/functions/tag6.pp +++ b/functions/tag6.pp @@ -9,7 +9,7 @@ function datadog_agent::tag6( ) { if $tag_names =~ Array { $tags = $tag_names.reduce([]) |$_tags , $tag| { - concat($_tags, datadog_agent::tag6($tag, $lookup_fact, $lookup_table)) + concat($_tags, datadog_agent::tag6($tag, $lookup_fact, $lookup_table)) } } else { if $lookup_fact =~ String { diff --git a/lib/puppet/reports/datadog_reports.rb b/lib/puppet/reports/datadog_reports.rb index 56ee35288..75aefea2e 100644 --- a/lib/puppet/reports/datadog_reports.rb +++ b/lib/puppet/reports/datadog_reports.rb @@ -137,7 +137,7 @@ def process facts = Puppet::Node::Facts.indirection.find(host).values facts_tags = REPORT_FACT_TAGS.map { |name| "#{name}:#{facts.dig(*name.split('.'))}" } - trusted_facts = (Puppet.lookup(:trusted_information) { Hash.new }).to_h + trusted_facts = (Puppet.lookup(:trusted_information) { {} }).to_h trusted_fact_tags = REPORT_TRUSTED_FACT_TAGS.map { |name| "#{name}:#{trusted_facts.dig(*name.split('.'))}" } dog_tags = facts_tags + trusted_fact_tags diff --git a/manifests/init.pp b/manifests/init.pp index 0d622015d..914a1360d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -391,7 +391,6 @@ Optional[Enum['host', 'docker', 'all']] $apm_instrumentation_enabled = undef, Optional[Array[String]] $apm_instrumentation_libraries = undef, ) inherits datadog_agent::params { - #In this regex, version '1:6.15.0~rc.1-1' would match as $1='1:', $2='6', $3='15', $4='0', $5='~rc.1', $6='1' if $agent_version != 'latest' and $agent_version =~ /([0-9]+:)?([0-9]+)\.([0-9]+)\.([0-9]+)((?:~|-)[^0-9\s-]+[^-\s]*)?(?:-([0-9]+))?/ { $_agent_major_version = 0 + $2 # Cast to integer @@ -411,7 +410,7 @@ if $facts['os']['release']['full'] =~ /^6(.[0-9])?/ and $agent_version == 'latest' { notice("datadog-agent ${_agent_major_version}.51 is the last supported version on CentOS 6. Installing ${_agent_major_version}.51 now") $agent_full_version='7.51.1' - } elsif $facts['os']['release']['full'] =~ /^6(.[0-9])?/ and $_agent_minor_version != undef and $_agent_minor_version > 51 { + } elsif $facts['os']['release']['full'] =~ /^6(.[0-9])?/ and $_agent_minor_version != undef and versioncmp($_agent_minor_version, '51') > 0 { fail("datadog-agent ${_agent_major_version}.51 is the last supported version on CentOS 6.") } else { $agent_full_version = $agent_version @@ -420,7 +419,7 @@ default: { $agent_full_version = $agent_version } } - if $_agent_major_version != 5 and $_agent_major_version != 6 and $_agent_major_version != 7 { + if versioncmp($_agent_major_version, '5') != 0 and versioncmp($_agent_major_version, '6') != 0 and versioncmp($_agent_major_version, '7') != 0 { fail("agent_major_version must be either 5, 6 or 7, not ${_agent_major_version}") } @@ -431,7 +430,7 @@ } if $conf_dir == undef { - if $_agent_major_version == 5 { + if versioncmp($_agent_major_version, '5') == 0 { $_conf_dir = $datadog_agent::params::legacy_conf_dir } else { $_conf_dir = $datadog_agent::params::conf_dir @@ -441,13 +440,13 @@ } if $hiera_tags { - $local_tags = lookup({ 'name' => 'datadog_agent::tags', 'merge' => 'unique', 'default_value' => []}) + $local_tags = lookup({ 'name' => 'datadog_agent::tags', 'merge' => 'unique', 'default_value' => [] }) } else { $local_tags = $tags } if $hiera_integrations { - $local_integrations = lookup({ 'name' => 'datadog_agent::integrations', 'default_value' => {}}) + $local_integrations = lookup({ 'name' => 'datadog_agent::integrations', 'default_value' => {} }) } else { $local_integrations = $integrations } @@ -655,14 +654,13 @@ } } - if $_agent_major_version == 5 { - + if versioncmp($_agent_major_version, '5') == 0 { if ($facts['os']['name'] == 'Windows') { fail('Installation of agent 5 with puppet is not supported on Windows') } if !empty($agent_extra_options) { - notify { 'Setting agent_extra_options has no effect with Agent 5': } + notify { 'Setting agent_extra_options has no effect with Agent 5': } } file { '/etc/dd-agent': @@ -680,10 +678,10 @@ force => $conf_dir_purge, owner => $dd_user, group => $dd_group, - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } - concat {'/etc/dd-agent/datadog.conf': + concat { '/etc/dd-agent/datadog.conf': owner => $dd_user, group => $dd_group, mode => '0640', @@ -696,31 +694,31 @@ } else { $_dd_url = $dd_url } - concat::fragment{ 'datadog header': + concat::fragment { 'datadog header': target => '/etc/dd-agent/datadog.conf', content => template('datadog_agent/datadog_header.conf.erb'), order => '01', } - concat::fragment{ 'datadog tags': + concat::fragment { 'datadog tags': target => '/etc/dd-agent/datadog.conf', content => 'tags: ', order => '02', } - datadog_agent::tag5{$local_tags: } - datadog_agent::tag5{$facts_to_tags: + datadog_agent::tag5 { $local_tags: } + datadog_agent::tag5 { $facts_to_tags: lookup_fact => true, } - concat::fragment{ 'datadog footer': + concat::fragment { 'datadog footer': target => '/etc/dd-agent/datadog.conf', content => template('datadog_agent/datadog_footer.conf.erb'), order => '05', } unless $extra_template.empty { - concat::fragment{ 'datadog extra_template footer': + concat::fragment { 'datadog extra_template footer': target => '/etc/dd-agent/datadog.conf', content => template($extra_template), order => '06', @@ -728,7 +726,7 @@ } if ($apm_enabled == true) and (($apm_env != 'none') or $apm_analyzed_spans or $apm_obfuscation) { - concat::fragment{ 'datadog apm footer': + concat::fragment { 'datadog apm footer': target => '/etc/dd-agent/datadog.conf', content => template('datadog_agent/datadog_apm_footer.conf.erb'), order => '07', @@ -736,58 +734,57 @@ } if ($process_enabled == true) { - concat::fragment{ 'datadog process agent footer': + concat::fragment { 'datadog process agent footer': target => '/etc/dd-agent/datadog.conf', content => template('datadog_agent/datadog_process_footer.conf.erb'), order => '08', } } - file {'/etc/dd-agent/install_info': + file { '/etc/dd-agent/install_info': owner => $dd_user, group => $dd_group, mode => '0640', content => template('datadog_agent/install_info.erb'), require => File['/etc/dd-agent'], } - } else { #Agent 6/7 # notify of broken params on agent6/7 if !empty($proxy_host) { - notify { 'Setting proxy_host is only used with Agent 5. Please use agent_extra_options to set your proxy': } + notify { 'Setting proxy_host is only used with Agent 5. Please use agent_extra_options to set your proxy': } } if !empty($proxy_port) { - notify { 'Setting proxy_port is only used with Agent 5. Please use agent_extra_options to set your proxy': } + notify { 'Setting proxy_port is only used with Agent 5. Please use agent_extra_options to set your proxy': } } if !empty($proxy_user) { - notify { 'Setting proxy_user is only used with Agent 5. Please use agent_extra_options to set your proxy': } + notify { 'Setting proxy_user is only used with Agent 5. Please use agent_extra_options to set your proxy': } } if !empty($proxy_password) { - notify { 'Setting proxy_password is only used with Agent 5. Please use agent_extra_options to set your proxy': } + notify { 'Setting proxy_password is only used with Agent 5. Please use agent_extra_options to set your proxy': } } # lint:ignore:quoted_booleans $process_enabled_str = $process_enabled ? { true => 'true' , default => 'disabled' } # lint:endignore $base_extra_config = { - 'apm_config' => { - 'enabled' => $apm_enabled, - 'env' => $apm_env, - 'apm_non_local_traffic' => $apm_non_local_traffic - }, - 'process_config' => { - 'enabled' => $process_enabled_str, - 'scrub_args' => $scrub_args, - 'custom_sensitive_words' => $custom_sensitive_words, - }, - 'logs_enabled' => $logs_enabled, + 'apm_config' => { + 'enabled' => $apm_enabled, + 'env' => $apm_env, + 'apm_non_local_traffic' => $apm_non_local_traffic, + }, + 'process_config' => { + 'enabled' => $process_enabled_str, + 'scrub_args' => $scrub_args, + 'custom_sensitive_words' => $custom_sensitive_words, + }, + 'logs_enabled' => $logs_enabled, } if $logs_open_files_limit { $logs_base_config = { 'logs_config' => { 'container_collect_all' => $container_collect_all, - 'open_files_limit' => $logs_open_files_limit + 'open_files_limit' => $logs_open_files_limit, }, } } else { @@ -798,87 +795,88 @@ } } if $host.empty { - $host_config = {} + $host_config = {} } else { - $host_config = { - 'hostname' => $host, - } + $host_config = { + 'hostname' => $host, + } } if $apm_analyzed_spans { - $apm_analyzed_span_config = { - 'apm_config' => { - 'analyzed_spans' => $apm_analyzed_spans - } - } + $apm_analyzed_span_config = { + 'apm_config' => { + 'analyzed_spans' => $apm_analyzed_spans, + }, + } } else { - $apm_analyzed_span_config = {} + $apm_analyzed_span_config = {} } if $apm_obfuscation { - $apm_obfuscation_config = { - 'apm_config' => { - 'obfuscation' => $apm_obfuscation - } - } + $apm_obfuscation_config = { + 'apm_config' => { + 'obfuscation' => $apm_obfuscation, + }, + } } else { - $apm_obfuscation_config = {} + $apm_obfuscation_config = {} } if $apm_filter_tags { - $apm_filter_tags_config = { - 'apm_config' => { - 'filter_tags' => $apm_filter_tags - } - } + $apm_filter_tags_config = { + 'apm_config' => { + 'filter_tags' => $apm_filter_tags, + }, + } } else { - $apm_filter_tags_config = {} + $apm_filter_tags_config = {} } if $apm_filter_tags_regex { - $apm_filter_tags_regex_config = { - 'apm_config' => { - 'filter_tags_regex' => $apm_filter_tags_regex - } - } + $apm_filter_tags_regex_config = { + 'apm_config' => { + 'filter_tags_regex' => $apm_filter_tags_regex, + }, + } } else { - $apm_filter_tags_regex_config = {} + $apm_filter_tags_regex_config = {} } if $statsd_forward_host.empty { - $statsd_forward_config = {} + $statsd_forward_config = {} } else { - if String($statsd_forward_port).empty { - $statsd_forward_config = { - 'statsd_forward_host' => $statsd_forward_host, - } - } else { - $statsd_forward_config = { - 'statsd_forward_host' => $statsd_forward_host, - 'statsd_forward_port' => $statsd_forward_port, - } + if String($statsd_forward_port).empty { + $statsd_forward_config = { + 'statsd_forward_host' => $statsd_forward_host, } + } else { + $statsd_forward_config = { + 'statsd_forward_host' => $statsd_forward_host, + 'statsd_forward_port' => $statsd_forward_port, + } + } } if $additional_checksd { - $additional_checksd_config = { - 'additional_checksd' => $additional_checksd, - } + $additional_checksd_config = { + 'additional_checksd' => $additional_checksd, + } } else { - $additional_checksd_config = {} + $additional_checksd_config = {} } $extra_config = deep_merge( - $base_extra_config, - $logs_base_config, - $agent_extra_options, - $apm_analyzed_span_config, - $apm_obfuscation_config, - $apm_filter_tags_config, - $apm_filter_tags_regex_config, - $statsd_forward_config, - $host_config, - $additional_checksd_config) + $base_extra_config, + $logs_base_config, + $agent_extra_options, + $apm_analyzed_span_config, + $apm_obfuscation_config, + $apm_filter_tags_config, + $apm_filter_tags_regex_config, + $statsd_forward_config, + $host_config, + $additional_checksd_config + ) file { $_conf_dir: ensure => directory, @@ -920,10 +918,8 @@ $agent_config = deep_merge($_agent_config, $extra_config) if ($facts['os']['name'] == 'Windows') { - - file { 'C:/ProgramData/Datadog': - ensure => directory + ensure => directory, } file { 'C:/ProgramData/Datadog/datadog.yaml': @@ -943,9 +939,7 @@ content => template('datadog_agent/install_info.erb'), require => File['C:/ProgramData/Datadog'], } - } else { - file { '/etc/datadog-agent/datadog.yaml': owner => $dd_user, group => $dd_group, @@ -964,7 +958,6 @@ require => File['/etc/datadog-agent'], } } - } if $puppet_run_reports { @@ -993,5 +986,4 @@ } create_resources('datadog_agent::integration', $local_integrations) - } diff --git a/manifests/install_integration.pp b/manifests/install_integration.pp index ab661f104..ad70085dd 100644 --- a/manifests/install_integration.pp +++ b/manifests/install_integration.pp @@ -3,12 +3,10 @@ String $integration_name = undef, String $version = undef, Boolean $third_party = false, -){ - - require ::datadog_agent +) { + require datadog_agent if $ensure == 'present' { - if $third_party { $install_cmd = 'install --third-party' } else { @@ -31,5 +29,4 @@ notify => Service[$datadog_agent::params::service_name], } } - } diff --git a/manifests/integration.pp b/manifests/integration.pp index 7824c94ca..60920498d 100644 --- a/manifests/integration.pp +++ b/manifests/integration.pp @@ -5,13 +5,12 @@ String $integration = $title, String $conf_file = 'conf', Enum['present', 'absent'] $ensure = 'present', -){ - +) { # 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 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/${integration}.d" $dst = "${dst_dir}/${$conf_file}.yaml" if (! defined(File[$dst_dir])) { @@ -20,14 +19,14 @@ owner => $datadog_agent::dd_user, group => $datadog_agent::dd_group, mode => $datadog_agent::params::permissions_directory, - before => File[$dst] + before => File[$dst], } } } else { $dst = "${datadog_agent::params::legacy_conf_dir}/${integration}.yaml" } - $file_ensure = $ensure ? { default => file, 'absent' => absent } + $file_ensure = $ensure ? { default => 'file', 'absent' => absent } file { $dst: ensure => $file_ensure, @@ -35,7 +34,6 @@ group => $datadog_agent::dd_group, mode => $datadog_agent::params::permissions_file, content => to_instances_yaml($init_config, $instances, $logs), - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } - } diff --git a/manifests/integrations/activemq_xml.pp b/manifests/integrations/activemq_xml.pp index ac1ecbb1e..f3b66bc08 100644 --- a/manifests/integrations/activemq_xml.pp +++ b/manifests/integrations/activemq_xml.pp @@ -42,7 +42,7 @@ # detailed_subscribers: ['subscriber1', 'subscriber2', 'subscriber3'] # # -class datadog_agent::integrations::activemq_xml( +class datadog_agent::integrations::activemq_xml ( String $url = 'http://localhost:8161', Boolean $supress_errors = false, Optional[String] $username = undef, @@ -52,13 +52,13 @@ Optional[Array[String]] $detailed_subscribers = [], Optional[Array] $instances = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/activemq_xml.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/activemq_xml.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -67,7 +67,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -76,15 +76,15 @@ if !$instances and $url { $_instances = [{ - 'url' => $url, - 'username' => $username, - 'password' => $password, - 'supress_errors' => $supress_errors, - 'detailed_queues' => $detailed_queues, - 'detailed_topics' => $detailed_topics, - 'detailed_subscribers' => $detailed_subscribers, + 'url' => $url, + 'username' => $username, + 'password' => $password, + 'supress_errors' => $supress_errors, + 'detailed_queues' => $detailed_queues, + 'detailed_topics' => $detailed_topics, + 'detailed_subscribers' => $detailed_subscribers, }] - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances diff --git a/manifests/integrations/apache.pp b/manifests/integrations/apache.pp index b6de7fc11..1a0b64c0c 100644 --- a/manifests/integrations/apache.pp +++ b/manifests/integrations/apache.pp @@ -33,13 +33,13 @@ Array $tags = [], Boolean $disable_ssl_validation = false ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/apache.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/apache.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -48,7 +48,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -62,6 +62,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/apache.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/cacti.pp b/manifests/integrations/cacti.pp index 2f1ee0d41..367a40d55 100644 --- a/manifests/integrations/cacti.pp +++ b/manifests/integrations/cacti.pp @@ -12,19 +12,19 @@ # $path # The path to the cacti rrd directory e.g. /var/lib/cacti/rra/ # -class datadog_agent::integrations::cacti( - $mysql_host = 'localhost', - $mysql_user = 'cacti', - $mysql_password = undef, - $rrd_path = '/var/lib/cacti/rra/', +class datadog_agent::integrations::cacti ( + String $mysql_host = 'localhost', + String $mysql_user = 'cacti', + Any $mysql_password = undef, + String $rrd_path = '/var/lib/cacti/rra/', ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/cacti.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/cacti.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -33,7 +33,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -47,6 +47,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/cacti.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/cassandra.pp b/manifests/integrations/cassandra.pp index 8f5e17a4c..6e8da8051 100644 --- a/manifests/integrations/cassandra.pp +++ b/manifests/integrations/cassandra.pp @@ -28,7 +28,7 @@ # } # # -class datadog_agent::integrations::cassandra( +class datadog_agent::integrations::cassandra ( String $host = 'localhost', Integer $port = 7199, Optional[String] $user = undef, @@ -36,14 +36,14 @@ Optional[Hash] $tags = {}, Optional[Integer] $max_returned_metrics = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/cassandra.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/cassandra.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: ensure => directory, @@ -51,7 +51,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { diff --git a/manifests/integrations/ceph.pp b/manifests/integrations/ceph.pp index 174c8ba35..7363e8dde 100644 --- a/manifests/integrations/ceph.pp +++ b/manifests/integrations/ceph.pp @@ -13,21 +13,21 @@ # class { 'datadog_agent::integrations::ceph' : # } # -class datadog_agent::integrations::ceph( - Array $tags = [ 'name:ceph_cluster' ], +class datadog_agent::integrations::ceph ( + Array $tags = ['name:ceph_cluster'], String $ceph_cmd = '/usr/bin/ceph', ) inherits datadog_agent::params { - require ::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" + content => "# This file is required for dd ceph \ndd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph\n", } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ceph.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/ceph.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -36,7 +36,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -50,6 +50,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/ceph.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/consul.pp b/manifests/integrations/consul.pp index d999d0e87..18652b0f3 100644 --- a/manifests/integrations/consul.pp +++ b/manifests/integrations/consul.pp @@ -26,20 +26,20 @@ # new_leader_checks => false, # } # -class datadog_agent::integrations::consul( +class datadog_agent::integrations::consul ( String $url = 'http://localhost:8500', Boolean $catalog_checks = true, Boolean $network_latency_checks = true, Boolean $new_leader_checks = true, Optional[Array] $service_whitelist = [] ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/consul.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/consul.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -48,7 +48,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -62,6 +62,6 @@ mode => $datadog_agent::params::permissions_file, content => template('datadog_agent/agent-conf.d/consul.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/directory.pp b/manifests/integrations/directory.pp index ca1b20cff..c482210b0 100644 --- a/manifests/integrations/directory.pp +++ b/manifests/integrations/directory.pp @@ -65,7 +65,7 @@ String $pattern = '', Optional[Array] $instances = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if !$instances and $directory == '' { fail('bad directory argument and no instances hash provided') @@ -73,26 +73,26 @@ if !$instances and $directory { $_instances = [{ - 'directory' => $directory, - 'filegauges' => $filegauges, - 'recursive' => $recursive, - 'countonly' => $countonly, - 'name' => $nametag, - 'dirtagname' => $dirtagname, - 'filetagname' => $filetagname, - 'pattern' => $pattern, + 'directory' => $directory, + 'filegauges' => $filegauges, + 'recursive' => $recursive, + 'countonly' => $countonly, + 'name' => $nametag, + 'dirtagname' => $dirtagname, + 'filetagname' => $filetagname, + 'pattern' => $pattern, }] - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/directory.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/directory.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -101,7 +101,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -115,6 +115,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/directory.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/disk.pp b/manifests/integrations/disk.pp index 305657393..18985a549 100644 --- a/manifests/integrations/disk.pp +++ b/manifests/integrations/disk.pp @@ -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 { - require ::datadog_agent + require datadog_agent validate_legacy('Optional[String]', 'validate_re', $all_partitions, '^(no|yes)$') @@ -90,10 +90,10 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/disk.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/disk.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -102,7 +102,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -116,6 +116,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/disk.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/dns_check.pp b/manifests/integrations/dns_check.pp index 6b6bc7dea..d097aaadc 100644 --- a/manifests/integrations/dns_check.pp +++ b/manifests/integrations/dns_check.pp @@ -30,16 +30,16 @@ 'hostname' => 'google.com', 'nameserver' => '8.8.8.8', 'timeout' => 5, - } + }, ] ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/dns_check.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/dns_check.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -48,7 +48,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { diff --git a/manifests/integrations/docker_daemon.pp b/manifests/integrations/docker_daemon.pp index 3852b3191..1f0c67197 100644 --- a/manifests/integrations/docker_daemon.pp +++ b/manifests/integrations/docker_daemon.pp @@ -19,52 +19,52 @@ # url => 'unix://var/run/docker.sock', # } # -class datadog_agent::integrations::docker_daemon( - $group = 'docker', - $docker_root = '/', - $timeout = 10, - $api_version = 'auto', - $tls = false, - $tls_client_cert = '/path/to/client-cert.pem', - $tls_client_key = '/path/to/client-key.pem', - $tls_cacert = '/path/to/ca.pem', - $tls_verify = true, - $init_retry_interval = 0, - $init_retries = 0, - $url = 'unix://var/run/docker.sock', - $collect_events = true, - $filtered_event_types = [], - $collect_container_size = false, - $custom_cgroups = false, - $health_service_check_whitelist = [], - $collect_container_count = false, - $collect_volume_count = false, - $collect_images_stats = false, - $collect_image_size = false, - $collect_disk_stats = false, - $collect_exit_codes = false, - $exclude = [], - $include = [], - $tags = [], - $ecs_tags = true, +class datadog_agent::integrations::docker_daemon ( + String $group = 'docker', + String $docker_root = '/', + Integer $timeout = 10, + String $api_version = 'auto', + Boolean $tls = false, + String $tls_client_cert = '/path/to/client-cert.pem', + String $tls_client_key = '/path/to/client-key.pem', + String$tls_cacert = '/path/to/ca.pem', + Boolean $tls_verify = true, + Integer $init_retry_interval = 0, + Integer $init_retries = 0, + String $url = 'unix://var/run/docker.sock', + Boolean $collect_events = true, + Array $filtered_event_types = [], + Boolean $collect_container_size = false, + Boolean $custom_cgroups = false, + Array $health_service_check_whitelist = [], + Boolean $collect_container_count = false, + Boolean $collect_volume_count = false, + Boolean $collect_images_stats = false, + Boolean $collect_image_size = false, + Boolean $collect_disk_stats = false, + Boolean $collect_exit_codes = false, + Array $exclude = [], + Array $include = [], + Array $tags = [], + Boolean $ecs_tags = true, # Possible values: "container_name", "image_name", "image_tag", "docker_image" - $performance_tags = [], + Array $performance_tags = [], # Possible values: "image_name", "image_tag", "docker_image" - $container_tags = [], + Array $container_tags = [], # Ex. "com.docker.compose.service", "com.docker.compose.project" - $collect_labels_as_tags = [], - $event_attributes_as_tags = [], + Array $collect_labels_as_tags = [], + Array $event_attributes_as_tags = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent exec { 'dd-agent-should-be-in-docker-group': command => "/usr/sbin/usermod -aG ${group} ${datadog_agent::dd_user}", unless => "/bin/cat /etc/group | grep '^${group}:' | grep -qw ${datadog_agent::dd_user}", require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $legacy_dir = "${datadog_agent::params::conf_dir}/docker_daemon.d" file { $legacy_dir: @@ -73,7 +73,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $legacy_conf = "${legacy_dir}/conf.yaml" } else { @@ -81,10 +81,10 @@ } file { $legacy_conf: - ensure => 'absent' + ensure => 'absent', } - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/docker.d" file { $dst_dir: @@ -93,7 +93,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -107,6 +107,6 @@ mode => $datadog_agent::params::permissions_file, content => template('datadog_agent/agent-conf.d/docker_daemon.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/elasticsearch.pp b/manifests/integrations/elasticsearch.pp index 05383f7b3..cfe6227bb 100644 --- a/manifests/integrations/elasticsearch.pp +++ b/manifests/integrations/elasticsearch.pp @@ -23,7 +23,7 @@ # url => "http://localhost:9201" # } # -class datadog_agent::integrations::elasticsearch( +class datadog_agent::integrations::elasticsearch ( Boolean $cluster_stats = false, Boolean $index_stats = false, Optional[String] $password = undef, @@ -37,27 +37,27 @@ Optional[String] $username = undef, Optional[Array] $instances = undef ) inherits datadog_agent::params { - require ::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 - if validate_legacy('Variant[Boolean, String]', 'is_string', $ssl_verify){ + if validate_legacy('Variant[Boolean, String]', 'is_string', $ssl_verify) { validate_absolute_path($ssl_verify) } if !$instances and $url { $_instances = [{ - 'cluster_stats' => $cluster_stats, - 'index_stats' => $index_stats, - 'password' => $password, - 'pending_task_stats' => $pending_task_stats, - 'pshard_stats' => $pshard_stats, - 'ssl_cert' => $ssl_cert, - 'ssl_key' => $ssl_key, - 'ssl_verify' => $ssl_verify, - 'tags' => $tags, - 'url' => $url, - 'username' => $username + 'cluster_stats' => $cluster_stats, + 'index_stats' => $index_stats, + 'password' => $password, + 'pending_task_stats' => $pending_task_stats, + 'pshard_stats' => $pshard_stats, + 'ssl_cert' => $ssl_cert, + 'ssl_key' => $ssl_key, + 'ssl_verify' => $ssl_verify, + 'tags' => $tags, + 'url' => $url, + 'username' => $username }] } elsif !$instances { $_instances = [] @@ -66,10 +66,10 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/elastic.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/elastic.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -78,7 +78,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -92,6 +92,6 @@ mode => $datadog_agent::params::permissions_file, content => template('datadog_agent/agent-conf.d/elastic.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/fluentd.pp b/manifests/integrations/fluentd.pp index bcbf3c21b..dde95a981 100644 --- a/manifests/integrations/fluentd.pp +++ b/manifests/integrations/fluentd.pp @@ -17,17 +17,17 @@ # } # # -class datadog_agent::integrations::fluentd( +class datadog_agent::integrations::fluentd ( $monitor_agent_url = 'http://localhost:24220/api/plugins.json', Optional[Array] $plugin_ids = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/fluentd.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/fluentd.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -36,7 +36,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { diff --git a/manifests/integrations/generic.pp b/manifests/integrations/generic.pp index c5e23d190..1c80694c8 100644 --- a/manifests/integrations/generic.pp +++ b/manifests/integrations/generic.pp @@ -17,17 +17,17 @@ # integration_contents => template(my_custom_template), # } # -class datadog_agent::integrations::generic( +class datadog_agent::integrations::generic ( Optional[String] $integration_name = undef, Optional[String] $integration_contents = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/${integration_name}.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/${integration_name}.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -36,7 +36,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -50,6 +50,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => $integration_contents, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/haproxy.pp b/manifests/integrations/haproxy.pp index ee8728b27..08ab67de6 100644 --- a/manifests/integrations/haproxy.pp +++ b/manifests/integrations/haproxy.pp @@ -16,19 +16,19 @@ # options => { collect_aggregates_only => 'False' }, # } # -class datadog_agent::integrations::haproxy( - $creds = {}, - $url = "http://${facts['networking']['ip']}:8080", - $options = {}, +class datadog_agent::integrations::haproxy ( + Hash $creds = {}, + String $url = "http://${facts['networking']['ip']}:8080", + Hash $options = {}, Optional[Array] $instances = undef ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if !$instances and $url { $_instances = [{ - 'creds' => $creds, - 'url' => $url, - 'options' => $options, + 'creds' => $creds, + 'url' => $url, + 'options' => $options, }] } elsif !$instances { $_instances = [] @@ -37,10 +37,10 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/haproxy.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/haproxy.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -49,7 +49,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -57,12 +57,12 @@ } file { $dst: - ensure => file, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_file, - content => template('datadog_agent/agent-conf.d/haproxy.yaml.erb'), - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + ensure => file, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_file, + content => template('datadog_agent/agent-conf.d/haproxy.yaml.erb'), + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index a5964bb41..9b96feb64 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -166,84 +166,83 @@ # }] # } - class datadog_agent::integrations::http_check ( - $sitename = undef, - $url = undef, - $username = undef, - $password = undef, - $timeout = 1, - $method = 'get', - $min_collection_interval = undef, - $data = undef, - $threshold = undef, - $window = undef, - $content_match = undef, - $reverse_content_match = false, - $include_content = false, - $http_response_status_code = undef, - $collect_response_time = true, - $disable_ssl_validation = false, - $ignore_ssl_warning = false, - $skip_event = true, - $no_proxy = false, - $check_certificate_expiration = true, - $days_warning = undef, - $days_critical = undef, + String $sitename = undef, + String $url = undef, + String $username = undef, + Any $password = undef, + Integer $timeout = 1, + String $method = 'get', + Integer $min_collection_interval = undef, + Any $data = undef, + Integer $threshold = undef, + Integer $window = undef, + String $content_match = undef, + Boolean $reverse_content_match = false, + Boolean $include_content = false, + String $http_response_status_code = undef, + Boolean $collect_response_time = true, + Boolean $disable_ssl_validation = false, + Boolean $ignore_ssl_warning = false, + Boolean $skip_event = true, + Boolean $no_proxy = false, + Boolean $check_certificate_expiration = true, + Integer $days_warning = undef, + Integer $days_critical = undef, Optional[Boolean] $check_hostname = undef, Optional[String] $ssl_server_name = undef, - $headers = [], - $allow_redirects = true, - $tags = [], - $contact = [], + Array $headers = [], + Boolean $allow_redirects = true, + Array $tags = [], + Array $contact = [], Optional[Array] $instances = undef, - $ca_certs = undef, + String $ca_certs = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if !$instances and $url { $_instances = [{ - 'sitename' => $sitename, - 'url' => $url, - 'username' => $username, - 'password' => $password, - 'timeout' => $timeout, - 'method' => $method, - 'min_collection_interval' => $min_collection_interval, - 'data' => $data, - 'threshold' => $threshold, - 'window' => $window, - 'content_match' => $content_match, - 'reverse_content_match' => $reverse_content_match, - 'include_content' => $include_content, - 'http_response_status_code' => $http_response_status_code, - 'collect_response_time' => $collect_response_time, - 'disable_ssl_validation' => $disable_ssl_validation, - 'ignore_ssl_warning' => $ignore_ssl_warning, - 'skip_event' => $skip_event, - 'no_proxy' => $no_proxy, - 'check_certificate_expiration' => $check_certificate_expiration, - 'days_warning' => $days_warning, - 'days_critical' => $days_critical, - 'check_hostname' => $check_hostname, - 'ssl_server_name' => $ssl_server_name, - 'headers' => $headers, - 'allow_redirects' => $allow_redirects, - 'tags' => $tags, - 'contact' => $contact, - 'ca_certs' => $ca_certs, + 'sitename' => $sitename, + 'url' => $url, + 'username' => $username, + 'password' => $password, + 'timeout' => $timeout, + 'method' => $method, + 'min_collection_interval' => $min_collection_interval, + 'data' => $data, + 'threshold' => $threshold, + 'window' => $window, + 'content_match' => $content_match, + 'reverse_content_match' => $reverse_content_match, + 'include_content' => $include_content, + 'http_response_status_code' => $http_response_status_code, + 'collect_response_time' => $collect_response_time, + 'disable_ssl_validation' => $disable_ssl_validation, + 'ignore_ssl_warning' => $ignore_ssl_warning, + 'skip_event' => $skip_event, + 'no_proxy' => $no_proxy, + 'check_certificate_expiration' => $check_certificate_expiration, + 'days_warning' => $days_warning, + 'days_critical' => $days_critical, + 'check_hostname' => $check_hostname, + 'ssl_server_name' => $ssl_server_name, + 'headers' => $headers, + 'allow_redirects' => $allow_redirects, + 'tags' => $tags, + 'contact' => $contact, + 'ca_certs' => $ca_certs, }] - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/http_check.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/http_check.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -252,7 +251,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -266,6 +265,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/http_check.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/jenkins.pp b/manifests/integrations/jenkins.pp index c3fe39bce..c017aee03 100644 --- a/manifests/integrations/jenkins.pp +++ b/manifests/integrations/jenkins.pp @@ -13,16 +13,16 @@ # } # # -class datadog_agent::integrations::jenkins( - $path = '/var/lib/jenkins' +class datadog_agent::integrations::jenkins ( + String $path = '/var/lib/jenkins' ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/jenkins.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/jenkins.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -31,7 +31,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -45,6 +45,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/jenkins.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/jmx.pp b/manifests/integrations/jmx.pp index e32f3ec93..10876b772 100644 --- a/manifests/integrations/jmx.pp +++ b/manifests/integrations/jmx.pp @@ -61,17 +61,17 @@ # }], # } # -class datadog_agent::integrations::jmx( - $init_config = {}, - $instances = [], +class datadog_agent::integrations::jmx ( + Hash $init_config = {}, + Array $instances = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/jmx.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/jmx.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -80,7 +80,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -94,7 +94,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/jmx.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } - } diff --git a/manifests/integrations/kafka.pp b/manifests/integrations/kafka.pp index 2f575e760..49072278a 100644 --- a/manifests/integrations/kafka.pp +++ b/manifests/integrations/kafka.pp @@ -52,8 +52,8 @@ # ] # } # -class datadog_agent::integrations::kafka( - $host = 'localhost', +class datadog_agent::integrations::kafka ( + String $host = 'localhost', Variant[String[1], Integer] $port = 9999, Optional[String[1]] $username = undef, Optional[String[1]] $password = undef, @@ -65,32 +65,32 @@ Optional[Hash[String[1], String[1]]] $tags = undef, Optional[Array[Hash[String[1], Data]]] $instances = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if !$instances and $host and $port { $servers = [{ - 'host' => $host, - 'port' => $port, - 'username' => $username, - 'password' => $password, - 'process_name_regex' => $process_name_regex, - 'tools_jar_path' => $tools_jar_path, - 'java_bin_path' => $java_bin_path, - 'trust_store_path' => $trust_store_path, - 'trust_store_password' => $trust_store_password, - 'tags' => $tags, + 'host' => $host, + 'port' => $port, + 'username' => $username, + 'password' => $password, + 'process_name_regex' => $process_name_regex, + 'tools_jar_path' => $tools_jar_path, + 'java_bin_path' => $java_bin_path, + 'trust_store_path' => $trust_store_path, + 'trust_store_password' => $trust_store_password, + 'tags' => $tags, }] - } elsif !$instances{ + } elsif !$instances { $servers = [] } else { $servers = $instances } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kafka.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/kafka.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -99,7 +99,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { diff --git a/manifests/integrations/kong.pp b/manifests/integrations/kong.pp index 15a17d92c..b58152868 100644 --- a/manifests/integrations/kong.pp +++ b/manifests/integrations/kong.pp @@ -25,20 +25,20 @@ # } # class datadog_agent::integrations::kong ( - $instances = [ + Array $instances = [ { 'status_url' => 'http://localhost:8001/status/', 'tags' => [] } ] ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kong.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/kong.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -47,7 +47,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -61,6 +61,6 @@ mode => $datadog_agent::params::permissions_file, content => template('datadog_agent/agent-conf.d/kong.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/kubernetes.pp b/manifests/integrations/kubernetes.pp index b984191c4..8c9a59299 100644 --- a/manifests/integrations/kubernetes.pp +++ b/manifests/integrations/kubernetes.pp @@ -21,22 +21,22 @@ # kubelet_client_key => '/etc/ssl/private/key', # } # -class datadog_agent::integrations::kubernetes( - $api_server_url = 'Enter_Your_API_url', - $apiserver_client_crt = '/path/to/crt', - $apiserver_client_key = '/path/to/key', - $kubelet_client_crt = '/path/to/crt', - $kubelet_client_key = '/path/to/key', - $tags = [], +class datadog_agent::integrations::kubernetes ( + String $api_server_url = 'Enter_Your_API_url', + String $apiserver_client_crt = '/path/to/crt', + String $apiserver_client_key = '/path/to/key', + String $kubelet_client_crt = '/path/to/crt', + String $kubelet_client_key = '/path/to/key', + Array $tags = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kubernetes.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/kubernetes.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -45,7 +45,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { diff --git a/manifests/integrations/kubernetes_state.pp b/manifests/integrations/kubernetes_state.pp index 10fe409c0..107f70142 100644 --- a/manifests/integrations/kubernetes_state.pp +++ b/manifests/integrations/kubernetes_state.pp @@ -17,18 +17,18 @@ # url => 'http://kubernetes.com:8080/metrics', # } # -class datadog_agent::integrations::kubernetes_state( - $url = 'Enter_State_URL', - $tags = [], +class datadog_agent::integrations::kubernetes_state ( + String $url = 'Enter_State_URL', + Array $tags = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kubernetes_state.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/kubernetes_state.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -37,7 +37,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { diff --git a/manifests/integrations/linux_proc_extras.pp b/manifests/integrations/linux_proc_extras.pp index 9a93c006f..980648096 100644 --- a/manifests/integrations/linux_proc_extras.pp +++ b/manifests/integrations/linux_proc_extras.pp @@ -13,16 +13,16 @@ # tags => [ 'env:production' ], # } -class datadog_agent::integrations::linux_proc_extras( - $tags = [], +class datadog_agent::integrations::linux_proc_extras ( + Array $tags = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/linux_proc_extras.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/linux_proc_extras.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -31,7 +31,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -45,7 +45,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/linux_proc_extras.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } - } diff --git a/manifests/integrations/logs.pp b/manifests/integrations/logs.pp index a71e0e19a..5f8ec670e 100644 --- a/manifests/integrations/logs.pp +++ b/manifests/integrations/logs.pp @@ -36,11 +36,11 @@ # https://docs.datadoghq.com/logs/log_collection # -class datadog_agent::integrations::logs( +class datadog_agent::integrations::logs ( Array $logs = [], ) inherits datadog_agent::params { - unless $::datadog_agent::_agent_major_version == 5 { - require ::datadog_agent + unless versioncmp($datadog_agent::_agent_major_version, '5') == 0 { + require datadog_agent file { "${datadog_agent::params::conf_dir}/logs.yaml": ensure => file, @@ -49,7 +49,7 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/logs.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } } diff --git a/manifests/integrations/marathon.pp b/manifests/integrations/marathon.pp index cf1471564..bcf008bf4 100644 --- a/manifests/integrations/marathon.pp +++ b/manifests/integrations/marathon.pp @@ -12,17 +12,17 @@ # url => "http://localhost:8080" # } # -class datadog_agent::integrations::marathon( - $marathon_timeout = 5, - $url = 'http://localhost:8080' +class datadog_agent::integrations::marathon ( + Integer $marathon_timeout = 5, + String $url = 'http://localhost:8080' ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/marathon.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/marathon.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -31,7 +31,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -45,6 +45,6 @@ mode => $datadog_agent::params::permissions_file, content => template('datadog_agent/agent-conf.d/marathon.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/memcache.pp b/manifests/integrations/memcache.pp index 985da7c9e..d0168edf6 100644 --- a/manifests/integrations/memcache.pp +++ b/manifests/integrations/memcache.pp @@ -38,27 +38,27 @@ Variant[Boolean, String] $slabs = false, Optional[Array] $instances = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if !$instances and $url { $_instances = [{ - 'url' => $url, - 'port' => $port, - 'tags' => $tags, - 'items' => $items, - 'slabs' => $slabs, + 'url' => $url, + 'port' => $port, + 'tags' => $tags, + 'items' => $items, + 'slabs' => $slabs, }] - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mcache.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/mcache.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -67,7 +67,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -81,6 +81,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/mcache.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/mesos_master.pp b/manifests/integrations/mesos_master.pp index 065fe8d97..1809dd284 100644 --- a/manifests/integrations/mesos_master.pp +++ b/manifests/integrations/mesos_master.pp @@ -12,13 +12,13 @@ # url => "http://localhost:5050" # } # -class datadog_agent::integrations::mesos_master( - $mesos_timeout = 10, - $url = 'http://localhost:5050' +class datadog_agent::integrations::mesos_master ( + Integer $mesos_timeout = 10, + String $url = 'http://localhost:5050' ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/mesos.d" file { $dst_dir: @@ -27,7 +27,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -35,14 +35,14 @@ } file { $dst: - ensure => 'absent' + ensure => 'absent', } $legacy_dst_master = "${datadog_agent::params::legacy_conf_dir}/mesos_master.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_master_dir = "${datadog_agent::params::conf_dir}/mesos_master.d" file { $legacy_dst_master: - ensure => 'absent' + ensure => 'absent', } file { $dst_master_dir: @@ -51,7 +51,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst_master = "${dst_master_dir}/conf.yaml" } else { @@ -65,6 +65,6 @@ mode => $datadog_agent::params::permissions_file, content => template('datadog_agent/agent-conf.d/mesos_master.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/mesos_slave.pp b/manifests/integrations/mesos_slave.pp index 9860cf716..b3691f10f 100644 --- a/manifests/integrations/mesos_slave.pp +++ b/manifests/integrations/mesos_slave.pp @@ -12,16 +12,15 @@ # url => "http://localhost:5051" # } # -class datadog_agent::integrations::mesos_slave( - $mesos_timeout = 10, - $url = 'http://localhost:5051' +class datadog_agent::integrations::mesos_slave ( + Integer $mesos_timeout = 10, + String $url = 'http://localhost:5051' ) inherits datadog_agent::params { - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mesos_slave.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/mesos_slave.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -30,7 +29,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -44,6 +43,6 @@ mode => $datadog_agent::params::permissions_file, content => template('datadog_agent/agent-conf.d/mesos_slave.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/mongo.pp b/manifests/integrations/mongo.pp index ff87c3f9a..4299bca51 100644 --- a/manifests/integrations/mongo.pp +++ b/manifests/integrations/mongo.pp @@ -93,16 +93,16 @@ # ] # } # -class datadog_agent::integrations::mongo( - Array $servers = [{'host' => 'localhost', 'port' => '27017'}] +class datadog_agent::integrations::mongo ( + Array $servers = [{ 'host' => 'localhost', 'port' => '27017' }] ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mongo.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/mongo.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -111,7 +111,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -125,6 +125,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/mongo.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/mysql.pp b/manifests/integrations/mysql.pp index 26106e13d..1914807a5 100644 --- a/manifests/integrations/mysql.pp +++ b/manifests/integrations/mysql.pp @@ -66,15 +66,15 @@ # } # # -class datadog_agent::integrations::mysql( +class datadog_agent::integrations::mysql ( String $host = 'localhost', - Optional[String] $user = 'datadog', + String $user = 'datadog', Optional[Variant[String, Integer]] $port = 3306, Optional[String] $password = undef, Optional[String] $sock = undef, Array $tags = [], - $replication = '0', - $galera_cluster = '0', + String $replication = '0', + String $galera_cluster = '0', Boolean $extra_status_metrics = false, Boolean $extra_innodb_metrics = false, Boolean $extra_performance_metrics = false, @@ -84,43 +84,43 @@ Optional[Array] $queries = [], Optional[Array] $instances = undef, Optional[Array] $logs = [], - ) inherits datadog_agent::params { - require ::datadog_agent +) inherits datadog_agent::params { + require datadog_agent if ($host == undef and $sock == undef) or - ($host != undef and $port == undef and $sock == undef) { + ($host != undef and $port == undef and $sock == undef) { fail('invalid MySQL configuration') } if !$instances and $host { $_instances = [{ - 'host' => $host, - 'password' => $password, - 'user' => $user, - 'port' => $port, - 'sock' => $sock, - 'tags' => $tags, - 'replication' => $replication, - 'galera_cluster' => $galera_cluster, - 'extra_status_metrics' => $extra_status_metrics, - 'extra_innodb_metrics' => $extra_innodb_metrics, - 'extra_performance_metrics' => $extra_performance_metrics, - 'schema_size_metrics' => $schema_size_metrics, - 'disable_innodb_metrics' => $disable_innodb_metrics, - 'dbm' => $dbm, - 'queries' => $queries, + 'host' => $host, + 'password' => $password, + 'user' => $user, + 'port' => $port, + 'sock' => $sock, + 'tags' => $tags, + 'replication' => $replication, + 'galera_cluster' => $galera_cluster, + 'extra_status_metrics' => $extra_status_metrics, + 'extra_innodb_metrics' => $extra_innodb_metrics, + 'extra_performance_metrics' => $extra_performance_metrics, + 'schema_size_metrics' => $schema_size_metrics, + 'disable_innodb_metrics' => $disable_innodb_metrics, + 'dbm' => $dbm, + 'queries' => $queries, }] - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mysql.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/mysql.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -129,7 +129,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -146,4 +146,3 @@ notify => Service[$datadog_agent::params::service_name], } } - diff --git a/manifests/integrations/network.pp b/manifests/integrations/network.pp index 3b409d638..e08acc0ce 100644 --- a/manifests/integrations/network.pp +++ b/manifests/integrations/network.pp @@ -19,7 +19,7 @@ # } # # -class datadog_agent::integrations::network( +class datadog_agent::integrations::network ( Boolean $collect_connection_state = false, Boolean $collect_connection_queues = false, Array[String] $excluded_interfaces = [], @@ -39,13 +39,13 @@ Array[String] $metric_patterns_include = [], Array[String] $metric_patterns_exclude = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/network.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/network.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -54,7 +54,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { diff --git a/manifests/integrations/nginx.pp b/manifests/integrations/nginx.pp index 20853a779..0f867afe2 100644 --- a/manifests/integrations/nginx.pp +++ b/manifests/integrations/nginx.pp @@ -59,17 +59,17 @@ # sourcecategory: 'http_web_access' # -class datadog_agent::integrations::nginx( +class datadog_agent::integrations::nginx ( Array $instances = [], Optional[Array] $logs = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/nginx.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/nginx.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -78,7 +78,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -92,6 +92,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/nginx.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/ntp.pp b/manifests/integrations/ntp.pp index 14251377e..2251a8479 100644 --- a/manifests/integrations/ntp.pp +++ b/manifests/integrations/ntp.pp @@ -23,20 +23,20 @@ # } # -class datadog_agent::integrations::ntp( - $offset_threshold = 60, - $host = undef, - $port = undef, - $version = undef, - $timeout = undef, +class datadog_agent::integrations::ntp ( + Integer $offset_threshold = 60, + String $host = undef, + Integer $port = undef, + String $version = undef, + Integer $timeout = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ntp.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/ntp.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -45,7 +45,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -59,6 +59,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/ntp.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/oom_kill.pp b/manifests/integrations/oom_kill.pp index 62bb44a8f..ac4d6e323 100644 --- a/manifests/integrations/oom_kill.pp +++ b/manifests/integrations/oom_kill.pp @@ -19,10 +19,10 @@ # } # -class datadog_agent::integrations::oom_kill( +class datadog_agent::integrations::oom_kill ( Array $instances = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $dst_dir = "${datadog_agent::params::conf_dir}/oom_kill.d" file { $dst_dir: @@ -31,7 +31,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" @@ -42,6 +42,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/oom_kill.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/pgbouncer.pp b/manifests/integrations/pgbouncer.pp index 1d9681d00..ba733bc7b 100644 --- a/manifests/integrations/pgbouncer.pp +++ b/manifests/integrations/pgbouncer.pp @@ -43,7 +43,7 @@ # ], # } # -class datadog_agent::integrations::pgbouncer( +class datadog_agent::integrations::pgbouncer ( String $password = '', String $host = 'localhost', Variant[String, Integer] $port = '6432', @@ -51,13 +51,13 @@ Array $tags = [], Array $pgbouncers = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/pgbouncer.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/pgbouncer.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -66,7 +66,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { diff --git a/manifests/integrations/php_fpm.pp b/manifests/integrations/php_fpm.pp index 01fd401d0..e1bd1dbaa 100644 --- a/manifests/integrations/php_fpm.pp +++ b/manifests/integrations/php_fpm.pp @@ -26,35 +26,35 @@ # } # -class datadog_agent::integrations::php_fpm( - $status_url = 'http://localhost/status', - $ping_url = 'http://localhost/ping', - $ping_reply = 'pong', - $http_host = undef, - $tags = [], - $instances = undef, - $use_fastcgi = 'false' +class datadog_agent::integrations::php_fpm ( + String $status_url = 'http://localhost/status', + String $ping_url = 'http://localhost/ping', + String $ping_reply = 'pong', + String $http_host = undef, + Array $tags = [], + Array $instances = undef, + String $use_fastcgi = 'false' ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if !$instances { $_instances = [{ - 'http_host' => $http_host, - 'status_url' => $status_url, - 'ping_url' => $ping_url, - 'ping_reply' => $ping_reply, - 'tags' => $tags, - 'use_fastcgi' => $use_fastcgi, + 'http_host' => $http_host, + 'status_url' => $status_url, + 'ping_url' => $ping_url, + 'ping_reply' => $ping_reply, + 'tags' => $tags, + 'use_fastcgi' => $use_fastcgi, }] } else { $_instances = $instances } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/php_fpm.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/php_fpm.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -63,7 +63,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -77,6 +77,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/php_fpm.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/postfix.pp b/manifests/integrations/postfix.pp index 1226b8ddd..9881830a9 100644 --- a/manifests/integrations/postfix.pp +++ b/manifests/integrations/postfix.pp @@ -30,29 +30,29 @@ # class datadog_agent::integrations::postfix ( String $directory = '/var/spool/postfix', - Array $queues = [ 'active', 'deferred', 'incoming' ], + Array $queues = ['active', 'deferred', 'incoming'], Optional[Array] $tags = [], Optional[Array] $instances = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if !$instances and $directory { $_instances = [{ - 'directory' => $directory, - 'queues' => $queues, - 'tags' => $tags + 'directory' => $directory, + 'queues' => $queues, + 'tags' => $tags }] - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/postfix.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/postfix.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -61,7 +61,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -75,6 +75,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/postfix.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/postgres.pp b/manifests/integrations/postgres.pp index 00f3f22fd..80fcae1b8 100644 --- a/manifests/integrations/postgres.pp +++ b/manifests/integrations/postgres.pp @@ -82,7 +82,7 @@ # descriptors: # - ["tag_column", "tag_column.datadog.tag"] # -class datadog_agent::integrations::postgres( +class datadog_agent::integrations::postgres ( Optional[String] $password = undef, String $host = 'localhost', String $dbname = 'postgres', @@ -100,13 +100,13 @@ Hash $custom_metrics = {}, Optional[Array] $instances = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/postgres.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/postgres.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -115,7 +115,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -124,23 +124,23 @@ if !$instances and $host { $_instances = [{ - 'host' => $host, - 'password' => $password, - 'dbname' => $dbname, - 'port' => $port, - 'username' => $username, - 'ssl' => $ssl, - 'use_psycopg2' => $use_psycopg2, - 'tags' => $tags, - 'tables' => $tables, - 'custom_metrics' => $custom_metrics, - 'collect_function_metrics' => $collect_function_metrics, - 'collect_count_metrics' => $collect_count_metrics, - 'collect_activity_metrics' => $collect_activity_metrics, - 'collect_database_size_metrics' => $collect_database_size_metrics, - 'collect_default_database' => $collect_default_database, + 'host' => $host, + 'password' => $password, + 'dbname' => $dbname, + 'port' => $port, + 'username' => $username, + 'ssl' => $ssl, + 'use_psycopg2' => $use_psycopg2, + 'tags' => $tags, + 'tables' => $tables, + 'custom_metrics' => $custom_metrics, + 'collect_function_metrics' => $collect_function_metrics, + 'collect_count_metrics' => $collect_count_metrics, + 'collect_activity_metrics' => $collect_activity_metrics, + 'collect_database_size_metrics' => $collect_database_size_metrics, + 'collect_default_database' => $collect_default_database, }] - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances diff --git a/manifests/integrations/postgres_custom_metric.pp b/manifests/integrations/postgres_custom_metric.pp index 91a7b9139..92011034f 100644 --- a/manifests/integrations/postgres_custom_metric.pp +++ b/manifests/integrations/postgres_custom_metric.pp @@ -15,13 +15,12 @@ # $descriptor: # an array that maps an sql column's to a tag. Each descriptor consists of two # fields -- column name, and datadog tag. -define datadog_agent::integrations::postgres_custom_metric( +define datadog_agent::integrations::postgres_custom_metric ( String $query, Hash $metrics, Boolean $relation = false, Array $descriptors = [], ) { - if $query !~ '^.*%s.*$' { fail('custom_metrics require %s for metric substitution') } diff --git a/manifests/integrations/process.pp b/manifests/integrations/process.pp index c69a3505d..22777c5a3 100644 --- a/manifests/integrations/process.pp +++ b/manifests/integrations/process.pp @@ -40,12 +40,12 @@ # # -class datadog_agent::integrations::process( +class datadog_agent::integrations::process ( Boolean $hiera_processes = false, - $init_config = {}, + Hash $init_config = {}, Array $processes = [], - ) inherits datadog_agent::params { - require ::datadog_agent +) inherits datadog_agent::params { + require datadog_agent if $hiera_processes { $local_processes = lookup({ 'name' => 'datadog_agent::integrations::process::processes', 'merge' => 'unique', 'default_value' => $processes }) @@ -54,10 +54,10 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/process.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/process.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -66,7 +66,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -74,12 +74,12 @@ } file { $dst: - ensure => $local_processes.length ? { 0 => absent, default => file}, + ensure => $local_processes.length ? { 0 => 'absent', default => file }, owner => $datadog_agent::dd_user, group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/process.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/rabbitmq.pp b/manifests/integrations/rabbitmq.pp index 66313f84b..f1bedbea4 100644 --- a/manifests/integrations/rabbitmq.pp +++ b/manifests/integrations/rabbitmq.pp @@ -64,14 +64,13 @@ Array $exchanges = [], Array $exchanges_regexes = [], ) inherits datadog_agent::params { - - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/rabbitmq.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/rabbitmq.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -80,7 +79,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { diff --git a/manifests/integrations/redis.pp b/manifests/integrations/redis.pp index b3c277609..9e845a426 100644 --- a/manifests/integrations/redis.pp +++ b/manifests/integrations/redis.pp @@ -40,7 +40,7 @@ # warn_on_missing_keys: true # command_stats: false # -class datadog_agent::integrations::redis( +class datadog_agent::integrations::redis ( String $host = 'localhost', String $password = '', Variant[String, Integer] $port = '6379', @@ -53,10 +53,10 @@ Optional[Array] $instances = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if $ports == undef { - $_ports = [ $port ] + $_ports = [$port] } else { $_ports = $ports } @@ -75,10 +75,10 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/redisdb.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/redisdb.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -87,7 +87,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -96,7 +96,7 @@ if !$instances and $host { $_instances = $_port_instances - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances @@ -109,6 +109,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/redisdb.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/riak.pp b/manifests/integrations/riak.pp index 5d5ab753b..3db23b5bd 100644 --- a/manifests/integrations/riak.pp +++ b/manifests/integrations/riak.pp @@ -18,17 +18,17 @@ # url => 'http://localhost:8098/stats', # } # -class datadog_agent::integrations::riak( +class datadog_agent::integrations::riak ( String $url = 'http://localhost:8098/stats', Array $tags = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/riak.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/riak.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -37,7 +37,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -52,6 +52,6 @@ mode => $datadog_agent::params::permissions_file, content => template('datadog_agent/agent-conf.d/riak.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/snmp.pp b/manifests/integrations/snmp.pp index 6527859d4..882fa51b4 100755 --- a/manifests/integrations/snmp.pp +++ b/manifests/integrations/snmp.pp @@ -50,17 +50,16 @@ # ], # } - class datadog_agent::integrations::snmp ( - $mibs_folder = undef, - $ignore_nonincreasing_oid = false, - $init_config = {}, - $instances = [], - $snmp_v1_instances = [], - $snmp_v2_instances = [], - $snmp_v3_instances = [], + Any $mibs_folder = undef, + Boolean $ignore_nonincreasing_oid = false, + Hash $init_config = {}, + Array $instances = [], + Array $snmp_v1_instances = [], + Array $snmp_v2_instances = [], + Array $snmp_v3_instances = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $versioned_instances = { 1 => $snmp_v1_instances, @@ -69,10 +68,10 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/snmp.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/snmp.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -81,7 +80,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -95,6 +94,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/snmp.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/solr.pp b/manifests/integrations/solr.pp index 4c6db0201..405bec8fe 100644 --- a/manifests/integrations/solr.pp +++ b/manifests/integrations/solr.pp @@ -26,23 +26,23 @@ # port => 8081, # } # -class datadog_agent::integrations::solr( - $hostname = 'localhost', - $port = 7199, - $username = undef, - $password = undef, - $java_bin_path = undef, - $trust_store_path = undef, - $trust_store_password = undef, - $tags = {}, +class datadog_agent::integrations::solr ( + String $hostname = 'localhost', + Integer $port = 7199, + String $username = undef, + Any $password = undef, + String $java_bin_path = undef, + String $trust_store_path = undef, + Any $trust_store_password = undef, + Hash $tags = {}, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/solr.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/solr.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -51,7 +51,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -65,7 +65,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/solr.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } - } diff --git a/manifests/integrations/ssh.pp b/manifests/integrations/ssh.pp index 697497bc4..88c51945f 100644 --- a/manifests/integrations/ssh.pp +++ b/manifests/integrations/ssh.pp @@ -26,22 +26,22 @@ # } # -class datadog_agent::integrations::ssh( - $host = $trusted['certname'], - $port = 22, - $username = $datadog_agent::dd_user, - $password = undef, - $sftp_check = true, - $private_key_file = undef, - $add_missing_keys = true, +class datadog_agent::integrations::ssh ( + String $host = $trusted['certname'], + Integer $port = 22, + String $username = $datadog_agent::dd_user, + Any $password = undef, + Boolean $sftp_check = true, + String $private_key_file = undef, + Boolean $add_missing_keys = true, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ssh.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/ssh_check.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -50,7 +50,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -64,6 +64,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/ssh.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/supervisord.pp b/manifests/integrations/supervisord.pp index 6ad15166c..3d5471684 100644 --- a/manifests/integrations/supervisord.pp +++ b/manifests/integrations/supervisord.pp @@ -42,15 +42,15 @@ # class datadog_agent::integrations::supervisord ( - $instances = [{'servername' => 'server0', 'hostname' => 'localhost', 'port' => '9001'}], + Array $instances = [{ 'servername' => 'server0', 'hostname' => 'localhost', 'port' => '9001' }], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/supervisord.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/supervisord.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -59,7 +59,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -73,6 +73,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/supervisord.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/system_core.pp b/manifests/integrations/system_core.pp index 19a0a4e2e..0861b5d2a 100644 --- a/manifests/integrations/system_core.pp +++ b/manifests/integrations/system_core.pp @@ -7,13 +7,13 @@ # # class datadog_agent::integrations::system_core inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/system_core.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/system_core.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -22,7 +22,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -30,12 +30,12 @@ } file { $dst: - ensure => file, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_file, - content => template('datadog_agent/agent-conf.d/system_core.yaml.erb'), - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + ensure => file, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_file, + content => template('datadog_agent/agent-conf.d/system_core.yaml.erb'), + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index bd5be5387..0575002c0 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -84,44 +84,43 @@ # }] # } - class datadog_agent::integrations::tcp_check ( - $check_name = undef, - $host = undef, - $port = undef, - Integer $timeout = 10, - $threshold = undef, - $window = undef, - $collect_response_time = undef, - $skip_event = undef, + String $check_name = undef, + String $host = undef, + String $port = undef, + Integer $timeout = 10, + Integer $threshold = undef, + Integer $window = undef, + Integer $collect_response_time = undef, + Integer $skip_event = undef, Array $tags = [], Optional[Array] $instances = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if !$instances and $host { $_instances = [{ - 'check_name' => $check_name, - 'host' => $host, - 'port' => $port, - 'timeout' => $timeout, - 'threshold' => $threshold, - 'window' => $window, - 'collect_response_time' => $collect_response_time, - 'skip_event' => $skip_event, - 'tags' => $tags, + 'check_name' => $check_name, + 'host' => $host, + 'port' => $port, + 'timeout' => $timeout, + 'threshold' => $threshold, + 'window' => $window, + 'collect_response_time' => $collect_response_time, + 'skip_event' => $skip_event, + 'tags' => $tags, }] - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/tcp_check.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/tcp_check.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -130,7 +129,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -144,6 +143,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/tcp_check.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/tomcat.pp b/manifests/integrations/tomcat.pp index 5092603fe..6b5ce7e7a 100644 --- a/manifests/integrations/tomcat.pp +++ b/manifests/integrations/tomcat.pp @@ -28,25 +28,24 @@ # port => 8081, # } # -class datadog_agent::integrations::tomcat( - $hostname = 'localhost', - $port = 7199, - $jmx_url = undef, - $username = undef, - $password = undef, - $java_bin_path = undef, - $trust_store_path = undef, - $trust_store_password = undef, - $tags = {}, +class datadog_agent::integrations::tomcat ( + String $hostname = 'localhost', + Integer $port = 7199, + String $jmx_url = undef, + String $username = undef, + Any $password = undef, + String $java_bin_path = undef, + String $trust_store_path = undef, + Any $trust_store_password = undef, + Hash $tags = {}, ) inherits datadog_agent::params { - require ::datadog_agent - + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/tomcat.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/tomcat.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -55,7 +54,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -69,7 +68,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/tomcat.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } - } diff --git a/manifests/integrations/twemproxy.pp b/manifests/integrations/twemproxy.pp index f5f065c22..7499d29ef 100644 --- a/manifests/integrations/twemproxy.pp +++ b/manifests/integrations/twemproxy.pp @@ -23,29 +23,29 @@ # ] # } # -class datadog_agent::integrations::twemproxy( - $host = 'localhost', - $port = '22222', - $instances = undef, +class datadog_agent::integrations::twemproxy ( + String $host = 'localhost', + String $port = '22222', + Array $instances = undef, ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent if !$instances and $host { $_instances = [{ - 'host' => $host, - 'port' => $port, + 'host' => $host, + 'port' => $port, }] - } elsif !$instances{ + } elsif !$instances { $_instances = [] } else { $_instances = $instances } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/twemproxy.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/twemproxy.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -54,7 +54,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -68,6 +68,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/twemproxy.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/varnish.pp b/manifests/integrations/varnish.pp index 95e31e8a6..0da6baf52 100644 --- a/manifests/integrations/varnish.pp +++ b/manifests/integrations/varnish.pp @@ -22,17 +22,17 @@ # } # class datadog_agent::integrations::varnish ( - $varnishstat = '/usr/bin/varnishstat', - $instance_name = undef, - $tags = [], + String $varnishstat = '/usr/bin/varnishstat', + String $instance_name = undef, + Array $tags = [], ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/varnish.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/varnish.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -41,7 +41,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -55,6 +55,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/varnish.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/integrations/zk.pp b/manifests/integrations/zk.pp index 0e3fad091..76af8417b 100644 --- a/manifests/integrations/zk.pp +++ b/manifests/integrations/zk.pp @@ -28,15 +28,15 @@ # } # class datadog_agent::integrations::zk ( - $servers = [{'host' => 'localhost', 'port' => '2181'}] + Array $servers = [{ 'host' => 'localhost', 'port' => '2181' }] ) inherits datadog_agent::params { - require ::datadog_agent + require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/zk.yaml" - if $::datadog_agent::_agent_major_version > 5 { + if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { $dst_dir = "${datadog_agent::params::conf_dir}/zk.d" file { $legacy_dst: - ensure => 'absent' + ensure => 'absent', } file { $dst_dir: @@ -45,7 +45,7 @@ group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_directory, require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } $dst = "${dst_dir}/conf.yaml" } else { @@ -59,6 +59,6 @@ mode => $datadog_agent::params::permissions_protected_file, content => template('datadog_agent/agent-conf.d/zk.yaml.erb'), require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name] + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/params.pp b/manifests/params.pp index 0483a91de..4dc51c67e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,7 +28,7 @@ case $facts['os']['name'] { 'Ubuntu','Debian','Raspbian' : { $rubydev_package = 'ruby-dev' - case $::operatingsystemrelease{ + case $facts['os']['release']['full'] { '14.04': { # Specific ruby/rubygems package name for Ubuntu 14.04 $ruby_package = 'ruby' @@ -87,5 +87,4 @@ } default: { fail("Class[datadog_agent]: Unsupported operatingsystem: ${facts['os']['name']}") } } - } diff --git a/manifests/redhat.pp b/manifests/redhat.pp index eb2bf2b92..7ab161feb 100644 --- a/manifests/redhat.pp +++ b/manifests/redhat.pp @@ -3,7 +3,7 @@ # This class contains the DataDog agent installation mechanism for Red Hat derivatives # -class datadog_agent::redhat( +class datadog_agent::redhat ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, Optional[String] $agent_repo_uri = undef, Boolean $manage_repo = true, @@ -11,18 +11,16 @@ String $agent_flavor = $datadog_agent::params::package_name, Optional[Boolean] $rpm_repo_gpgcheck = undef, ) inherits datadog_agent::params { - if $manage_repo { - $all_keys = [ - 'https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public', - 'https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public', - 'https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public', - 'https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public', + 'https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public', + 'https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public', + 'https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public', + 'https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public', ] #In this regex, version '1:6.15.0~rc.1-1' would match as $1='1:', $2='6', $3='15', $4='0', $5='~rc.1', $6='1' if $agent_version =~ /([0-9]+:)?([0-9]+)\.([0-9]+)\.([0-9]+)((?:~|-)[^0-9\s-]+[^-\s]*)?(?:-([0-9]+))?/ or $agent_version == 'latest' { - if $agent_major_version > 5 and ($agent_version == 'latest' or 0 + $3 > 35) { + if versioncmp($agent_major_version, '5') > 0 and ($agent_version == 'latest' or 0 + $3 > 35) { $keys = $all_keys[0,3] } else { $keys = $all_keys @@ -34,7 +32,7 @@ if ($rpm_repo_gpgcheck != undef) { $repo_gpgcheck = $rpm_repo_gpgcheck } else { - if ($agent_repo_uri == undef) and ($agent_major_version > 5) { + if ($agent_repo_uri == undef) and (versioncmp($agent_major_version, '5') > 0) { case $facts['os']['name'] { 'RedHat', 'CentOS', 'OracleLinux': { # disable repo_gpgcheck on 8.1 because of https://bugzilla.redhat.com/show_bug.cgi?id=1792506 @@ -51,7 +49,6 @@ } else { $repo_gpgcheck = false } - } case $agent_major_version { @@ -85,15 +82,15 @@ ensure => absent, } - yumrepo {'datadog5': + yumrepo { 'datadog5': ensure => absent, } - yumrepo {'datadog6': + yumrepo { 'datadog6': ensure => absent, } - yumrepo {'datadog': + yumrepo { 'datadog': enabled => 1, gpgcheck => 1, gpgkey => join($gpgkeys, "\n "), diff --git a/manifests/reports.pp b/manifests/reports.pp index ad3fb119a..1fc6f0724 100644 --- a/manifests/reports.pp +++ b/manifests/reports.pp @@ -15,53 +15,49 @@ # # Sample Usage: # -class datadog_agent::reports( - $api_key, - $puppetmaster_user, - $dogapi_version, - $manage_dogapi_gem = true, - $hostname_extraction_regex = undef, - $proxy_http = undef, - $proxy_https = undef, - $report_fact_tags = [], - $report_trusted_fact_tags = [], - $datadog_site = 'https://api.datadoghq.com', - $puppet_gem_provider = $datadog_agent::params::gem_provider, +class datadog_agent::reports ( + String $api_key, + String $puppetmaster_user, + String $dogapi_version, + Boolean $manage_dogapi_gem = true, + String $hostname_extraction_regex = undef, + String $proxy_http = undef, + String $proxy_https = undef, + Array $report_fact_tags = [], + Array $report_trusted_fact_tags = [], + String $datadog_site = 'https://api.datadoghq.com', + String $puppet_gem_provider = $datadog_agent::params::gem_provider, ) inherits datadog_agent::params { - if ($facts['os']['name'] == 'Windows') { - fail('Reporting is not yet supported from a Windows host') - } else { - - require ::datadog_agent + require datadog_agent if $manage_dogapi_gem { $rubydev_package = $datadog_agent::params::rubydev_package # check to make sure that you're not installing rubydev somewhere else if ! defined(Package[$rubydev_package]) { - package {$rubydev_package: + package { $rubydev_package: ensure => installed, - before => Package['dogapi'] + before => Package['dogapi'], } } if (! defined(Package['rubygems'])) { package { 'ruby': ensure => 'installed', - name => $datadog_agent::params::ruby_package + name => $datadog_agent::params::ruby_package, } package { 'rubygems': ensure => 'installed', name => $datadog_agent::params::rubygems_package, - require => Package['ruby'] + require => Package['ruby'], } } - package{ 'dogapi': + package { 'dogapi': ensure => $dogapi_version, provider => $puppet_gem_provider, } @@ -75,6 +71,5 @@ mode => '0640', require => File['/etc/datadog-agent'], } - } } diff --git a/manifests/security_agent.pp b/manifests/security_agent.pp index eceb12036..9e0ed4e5e 100644 --- a/manifests/security_agent.pp +++ b/manifests/security_agent.pp @@ -1,4 +1,4 @@ -class datadog_agent::security_agent( +class datadog_agent::security_agent ( Boolean $enabled = false, Optional[String] $socket = undef, @@ -7,16 +7,14 @@ Optional[String] $service_provider = undef, ) inherits datadog_agent::params { - $securityagent_config = { 'runtime_security_config' => { 'enabled' => $enabled, - 'socket' => $socket, + 'socket' => $socket, }, } if $facts['os']['name'] == 'Windows' { - file { 'C:/ProgramData/Datadog/security-agent.yaml': owner => $datadog_agent::params::dd_user, group => $datadog_agent::params::dd_group, @@ -24,9 +22,7 @@ content => template('datadog_agent/security-agent.yaml.erb'), require => File['C:/ProgramData/Datadog'], } - } else { - if $service_provider { service { $datadog_agent::params::securityagent_service_name: ensure => $service_ensure, @@ -55,5 +51,4 @@ require => File['/etc/datadog-agent'], } } - } diff --git a/manifests/service.pp b/manifests/service.pp index fbd74eef9..96af7d989 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -3,20 +3,19 @@ # This class declares the datadog-agent service # -class datadog_agent::service( - $service_ensure = 'running', +class datadog_agent::service ( + String $service_ensure = 'running', Variant[Boolean, Enum['manual', 'mask', 'delayed']] $service_enable = true, Optional[String] $service_provider = undef, String $agent_flavor = $datadog_agent::params::package_name, ) inherits datadog_agent::params { - if ($facts['os']['name'] == 'Windows') { - service { $datadog_agent::params::service_name: - ensure => $service_ensure, - enable => $service_enable, - restart => ['powershell', '-Command', 'Restart-Service -Force DatadogAgent'], # Force restarts dependent services - require => Package[$datadog_agent::params::package_name] - } + service { $datadog_agent::params::service_name: + ensure => $service_ensure, + enable => $service_enable, + restart => ['powershell', '-Command', 'Restart-Service -Force DatadogAgent'], # Force restarts dependent services + require => Package[$datadog_agent::params::package_name], + } } else { if $service_provider { service { $datadog_agent::params::service_name: @@ -37,6 +36,4 @@ } } } - - } diff --git a/manifests/suse.pp b/manifests/suse.pp index 37626817d..4a928b52b 100644 --- a/manifests/suse.pp +++ b/manifests/suse.pp @@ -3,7 +3,7 @@ # This class contains the DataDog agent installation mechanism for SUSE distributions # -class datadog_agent::suse( +class datadog_agent::suse ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, String $agent_version = $datadog_agent::params::agent_version, String $release = $datadog_agent::params::apt_default_release, @@ -11,7 +11,6 @@ String $agent_flavor = $datadog_agent::params::package_name, Optional[Boolean] $rpm_repo_gpgcheck = undef, ) inherits datadog_agent::params { - $current_key = 'https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public' $all_keys = [ $current_key, @@ -21,11 +20,11 @@ ] #In this regex, version '1:6.15.0~rc.1-1' would match as $1='1:', $2='6', $3='15', $4='0', $5='~rc.1', $6='1' if $agent_version =~ /([0-9]+:)?([0-9]+)\.([0-9]+)\.([0-9]+)((?:~|-)[^0-9\s-]+[^-\s]*)?(?:-([0-9]+))?/ or $agent_version == 'latest' { - if $agent_major_version > 5 and ($agent_version == 'latest' or 0 + $3 > 35) { - $keys_to_use = $all_keys[0,3] - } else { - $keys_to_use = $all_keys - } + if versioncmp($agent_major_version, '5') > 0 and ($agent_version == 'latest' or 0 + $3 > 35) { + $keys_to_use = $all_keys[0,3] + } else { + $keys_to_use = $all_keys + } } else { $keys_to_use = $all_keys } @@ -41,10 +40,10 @@ } case $agent_major_version { - 5 : { fail('Agent v5 package not available in SUSE') } - 6 : { $gpgkeys = $keys_to_use } - 7 : { $gpgkeys = $keys_to_use } - default: { fail('invalid agent_major_version') } + 5 : { fail('Agent v5 package not available in SUSE') } + 6 : { $gpgkeys = $keys_to_use } + 7 : { $gpgkeys = $keys_to_use } + default: { fail('invalid agent_major_version') } } if ($agent_repo_uri != undef) { @@ -101,5 +100,4 @@ package { $agent_flavor: ensure => $agent_version, } - } diff --git a/manifests/system_probe.pp b/manifests/system_probe.pp index df0443a52..45aaf845d 100644 --- a/manifests/system_probe.pp +++ b/manifests/system_probe.pp @@ -5,7 +5,7 @@ # to 'true on the datadog_agent class. # -class datadog_agent::system_probe( +class datadog_agent::system_probe ( Boolean $enabled = false, Boolean $network_enabled = false, Boolean $service_monitoring_enabled = false, @@ -18,8 +18,6 @@ String $service_ensure = 'running', Optional[String] $service_provider = undef, ) inherits datadog_agent::params { - - $sysprobe_config = { 'system_probe_config' => { 'enabled' => $enabled, @@ -45,9 +43,7 @@ require => File['C:/ProgramData/Datadog'], notify => Service[$datadog_agent::params::service_name], } - } else { - if $service_provider { service { $datadog_agent::params::sysprobe_service_name: ensure => $service_ensure, @@ -76,5 +72,4 @@ require => File['/etc/datadog-agent'], } } - } diff --git a/manifests/tag5.pp b/manifests/tag5.pp index 9134b4211..33b1b4635 100644 --- a/manifests/tag5.pp +++ b/manifests/tag5.pp @@ -1,18 +1,17 @@ # Allow custom tags via a define -define datadog_agent::tag5( - $tag_name = $name, - $lookup_fact = false, -){ - - if $lookup_fact{ +define datadog_agent::tag5 ( + String $tag_name = $name, + Boolean $lookup_fact = false, +) { + if $lookup_fact { $value = getvar($tag_name) - if is_array($value){ + if is_array($value) { $tags = prefix($value, "${tag_name}:") - datadog_agent::tag5{$tags: } + datadog_agent::tag5 { $tags: } } else { if $value { - concat::fragment{ "datadog tag ${tag_name}:${value}": + concat::fragment { "datadog tag ${tag_name}:${value}": target => '/etc/dd-agent/datadog.conf', content => "${tag_name}:${value}, ", order => '03', @@ -20,11 +19,10 @@ } } } else { - concat::fragment{ "datadog tag ${tag_name}": + concat::fragment { "datadog tag ${tag_name}": target => '/etc/dd-agent/datadog.conf', content => "${tag_name}, ", order => '03', } } - } diff --git a/manifests/ubuntu.pp b/manifests/ubuntu.pp index 806cbef8c..fe6df6ede 100644 --- a/manifests/ubuntu.pp +++ b/manifests/ubuntu.pp @@ -3,7 +3,7 @@ # This class contains the DataDog agent installation mechanism for Debian derivatives # -class datadog_agent::ubuntu( +class datadog_agent::ubuntu ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, String $agent_version = $datadog_agent::params::agent_version, Optional[String] $agent_repo_uri = undef, @@ -19,7 +19,6 @@ 'A2923DFF56EDA6E76E55E492D3A80E30382E94DE' => 'https://keys.datadoghq.com/DATADOG_APT_KEY_382E94DE.public', }, ) inherits datadog_agent::params { - if $agent_version =~ /^[0-9]+\.[0-9]+\.[0-9]+((?:~|-)[^0-9\s-]+[^-\s]*)?$/ { $platform_agent_version = "1:${agent_version}-1" } @@ -55,15 +54,15 @@ exec { "ensure key ${key_fingerprint} is imported in APT keyring": command => "/bin/cat /tmp/${key_fingerprint} | gpg --import --batch --no-default-keyring --keyring ${apt_usr_share_keyring}", # the second part extracts the fingerprint of the key from output like "fpr::::A2923DFF56EDA6E76E55E492D3A80E30382E94DE:" - unless => @("CMD"/L) + unless => "@(\"CMD\"/L) /usr/bin/gpg --no-default-keyring --keyring ${apt_usr_share_keyring} --list-keys --with-fingerprint --with-colons | grep \ $(cat /tmp/${key_fingerprint} | gpg --with-colons --with-fingerprint 2>/dev/null | grep 'fpr:' | sed 's|^fpr||' | tr -d ':') - | CMD + | CMD", } } if ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '16') == -1) or - ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['full'], '9') == -1) { + ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['full'], '9') == -1) { file { $apt_trusted_d_keyring: mode => '0644', source => "file://${apt_usr_share_keyring}", @@ -104,12 +103,12 @@ package { $agent_flavor: ensure => $platform_agent_version, require => [Apt::Source['datadog'], - Class['apt::update']], + Class['apt::update']], } package { 'datadog-signing-keys': ensure => 'latest', require => [Apt::Source['datadog'], - Class['apt::update']], + Class['apt::update']], } } diff --git a/manifests/ubuntu_installer.pp b/manifests/ubuntu_installer.pp index 9f4ce9e22..b9ad851c2 100644 --- a/manifests/ubuntu_installer.pp +++ b/manifests/ubuntu_installer.pp @@ -88,10 +88,10 @@ exec { "ensure key ${key_fingerprint} is imported in APT keyring": command => "/bin/cat /tmp/${key_fingerprint} | gpg --import --batch --no-default-keyring --keyring ${apt_usr_share_keyring}", # the second part extracts the fingerprint of the key from output like "fpr::::A2923DFF56EDA6E76E55E492D3A80E30382E94DE:" - unless => @("CMD"/L) + unless => "@(\"CMD\"/L) /usr/bin/gpg --no-default-keyring --keyring ${apt_usr_share_keyring} --list-keys --with-fingerprint --with-colons | grep \ $(cat /tmp/${key_fingerprint} | gpg --with-colons --with-fingerprint 2>/dev/null | grep 'fpr:' | sed 's|^fpr||' | tr -d ':') - | CMD + | CMD", } } if ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '16') == -1) or diff --git a/manifests/windows.pp b/manifests/windows.pp index 15e014af0..078647270 100644 --- a/manifests/windows.pp +++ b/manifests/windows.pp @@ -3,7 +3,7 @@ # This class contains the DataDog agent installation mechanism for Windows # -class datadog_agent::windows( +class datadog_agent::windows ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, String $agent_version = $datadog_agent::params::agent_version, Optional[String] $agent_repo_uri = undef, @@ -18,7 +18,6 @@ Optional[String] $ddagentuser_name = undef, Optional[String] $ddagentuser_password = undef, ) inherits datadog_agent::params { - $msi_full_path = "${msi_location}/datadog-agent-${agent_major_version}-${agent_version}.amd64.msi" if ($agent_repo_uri != undef) { @@ -46,16 +45,16 @@ exec { 'assert-acceptable-msi':, command => 'Exit 1', - unless => @(ACCEPTABLE), - $blacklist = '928b00d2f952219732cda9ae0515351b15f9b9c1ea1d546738f9dc0fda70c336','78b2bb2b231bcc185eb73dd367bfb6cb8a5d45ba93a46a7890fd607dc9188194'; - $fileStream = [system.io.file]::openread('${msi_full_path}'); - $hasher = [System.Security.Cryptography.HashAlgorithm]::create('sha256'); - $hash = $hasher.ComputeHash($fileStream); - $fileStream.close(); - $fileStream.dispose(); - $hexhash = [system.bitconverter]::tostring($hash).ToLower().replace('-',''); - if ($blacklist.Contains($hexhash)) { Exit 1 } else { Exit 0 } - | ACCEPTABLE + unless => "@(ACCEPTABLE), + \$blacklist = '928b00d2f952219732cda9ae0515351b15f9b9c1ea1d546738f9dc0fda70c336','78b2bb2b231bcc185eb73dd367bfb6cb8a5d45ba93a46a7890fd607dc9188194'; + \$fileStream = [system.io.file]::openread('${msi_full_path}'); + \$hasher = [System.Security.Cryptography.HashAlgorithm]::create('sha256'); + \$hash = \$hasher.ComputeHash(\$fileStream); + \$fileStream.close(); + \$fileStream.dispose(); + \$hexhash = [system.bitconverter]::tostring(\$hash).ToLower().replace('-',''); + if (\$blacklist.Contains(\$hexhash)) { Exit 1 } else { Exit 0 } + | ACCEPTABLE", provider => 'powershell', logoutput => 'on_failure', require => File['installer'], @@ -71,16 +70,15 @@ $hostname_option = $hostname ? { '' => {}, default => { 'HOSTNAME' => $hostname } } $npm_install_option = $npm_install ? { false => {}, true => { 'ADDLOCAL' => 'MainApplication,NPM' } } - $ddagentuser_name_option = $ddagentuser_name ? { undef => {}, default => { 'DDAGENTUSER_NAME' => $ddagentuser_name}} - $ddagentuser_password_option = ($ddagentuser_name != undef and $ddagentuser_password != undef) ? { true => {'DDAGENTUSER_PASSWORD' => $ddagentuser_password}, false => {}} + $ddagentuser_name_option = $ddagentuser_name ? { undef => {}, default => { 'DDAGENTUSER_NAME' => $ddagentuser_name } } + $ddagentuser_password_option = ($ddagentuser_name != undef and $ddagentuser_password != undef) ? { true => { 'DDAGENTUSER_PASSWORD' => $ddagentuser_password }, false => {} } package { $datadog_agent::params::package_name: ensure => $ensure_version, provider => 'windows', source => $msi_full_path, - install_options => ['/norestart', {'APIKEY' => $api_key, 'TAGS' => $tags_quote_wrap} + $npm_install_option + $hostname_option + $ddagentuser_name_option + $ddagentuser_password_option] + install_options => ['/norestart', { 'APIKEY' => $api_key, 'TAGS' => $tags_quote_wrap } + $npm_install_option + $hostname_option + $ddagentuser_name_option + $ddagentuser_password_option], } - } else { exec { 'datadog_6_14_fix': command => "((New-Object System.Net.WebClient).DownloadFile('https://s3.amazonaws.com/ddagent-windows-stable/scripts/fix_6_14.ps1', \$env:temp + '\\fix_6_14.ps1')); &\$env:temp\\fix_6_14.ps1", @@ -93,6 +91,5 @@ uninstall_options => ['/quiet'], subscribe => Exec['datadog_6_14_fix'], } - } } From e2b9c256f69080e87d0bd75d2edeaca59df79c28 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 20 Dec 2024 15:35:16 +0000 Subject: [PATCH 002/133] update linting rules --- .puppet-lint.rc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.puppet-lint.rc b/.puppet-lint.rc index 6856ecf37..54f3eee45 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,3 +1,11 @@ +--fail-on-warnings --relative +--no-80chars-check --no-140chars-check ---fail-on-warnings +--no-class_inherits_from_params_class-check +--no-autoloader_layout-check +--no-parameter_documentation-check +--no-single_quote_string_with_variables-check +--no-lookup_in_parameter-check +--no-top_scope_facts-check +--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp From 373df1c63d5be0575541c3c1d999084284026e10 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 20 Dec 2024 15:54:27 +0000 Subject: [PATCH 003/133] added missing data types, removed optional when we defaulting things. prettied the code. --- manifests/init.pp | 20 ++++++++++---------- manifests/integrations/activemq_xml.pp | 6 +++--- manifests/integrations/cassandra.pp | 2 +- manifests/integrations/consul.pp | 2 +- manifests/integrations/disk.pp | 4 ++-- manifests/integrations/fluentd.pp | 4 ++-- manifests/integrations/mysql.pp | 10 +++++----- manifests/integrations/postfix.pp | 2 +- manifests/integrations/rabbitmq.pp | 4 ++-- manifests/ubuntu.pp | 18 +++++++++--------- 10 files changed, 36 insertions(+), 36 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 914a1360d..d41ade491 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -284,8 +284,8 @@ Boolean $collect_gce_tags = false, Boolean $collect_instance_metadata = true, Array $tags = [], - $integrations = {}, - $hiera_integrations = false, + Hash $integrations = {}, + Boolean $hiera_integrations = false, Boolean $hiera_tags = false, Array $facts_to_tags = [], Array $trusted_facts_to_tags = [], @@ -297,16 +297,16 @@ Array $dogstreams = [], String $log_level = 'info', Boolean $log_to_syslog = true, - $service_ensure = 'running', - $service_enable = true, + String $service_ensure = 'running', + Boolean $service_enable = true, Boolean $manage_repo = true, Boolean $manage_dogapi_gem = true, Boolean $manage_install = true, Optional[Boolean] $datadog_installer_enabled = undef, - $hostname_extraction_regex = undef, + String $hostname_extraction_regex = undef, Boolean $hostname_fqdn = false, Variant[Stdlib::Port, Pattern[/^\d*$/]] $dogstatsd_port = 8125, - $dogstatsd_socket = '', + String $dogstatsd_socket = '', Array $report_fact_tags = [], Array $report_trusted_fact_tags = [], String $statsd_forward_host = '', @@ -319,7 +319,7 @@ Variant[Stdlib::Port, Pattern[/^\d*$/]] $graphite_listen_port = '', String $extra_template = '', String $ganglia_host = '', - $ganglia_port = 8651, + Integer $ganglia_port = 8651, Boolean $skip_ssl_validation = false, Boolean $skip_apt_key_trusting = false, Boolean $use_curl_http_client = false, @@ -355,8 +355,8 @@ Optional[Integer] $agent_major_version = undef, Optional[String] $conf_dir = undef, Boolean $conf_dir_purge = $datadog_agent::params::conf_dir_purge, - $dd_group = $datadog_agent::params::dd_group, - $dd_groups = $datadog_agent::params::dd_groups, + String $dd_group = $datadog_agent::params::dd_group, + Any $dd_groups = $datadog_agent::params::dd_groups, Boolean $apm_enabled = $datadog_agent::params::apm_default_enabled, String $apm_env = 'none', Boolean $apm_non_local_traffic = false, @@ -368,7 +368,7 @@ Boolean $scrub_args = $datadog_agent::params::process_default_scrub_args, Array $custom_sensitive_words = $datadog_agent::params::process_default_custom_words, Boolean $logs_enabled = $datadog_agent::params::logs_enabled, - $logs_open_files_limit = $datadog_agent::params::logs_open_files_limit, + Integer $logs_open_files_limit = $datadog_agent::params::logs_open_files_limit, Boolean $container_collect_all = $datadog_agent::params::container_collect_all, Hash[String[1], Data] $agent_extra_options = {}, Optional[String] $agent_repo_uri = undef, diff --git a/manifests/integrations/activemq_xml.pp b/manifests/integrations/activemq_xml.pp index f3b66bc08..fe903232e 100644 --- a/manifests/integrations/activemq_xml.pp +++ b/manifests/integrations/activemq_xml.pp @@ -47,9 +47,9 @@ Boolean $supress_errors = false, Optional[String] $username = undef, Optional[String] $password = undef, - Optional[Array[String]] $detailed_queues = [], - Optional[Array[String]] $detailed_topics = [], - Optional[Array[String]] $detailed_subscribers = [], + Array[String] $detailed_queues = [], + Array[String] $detailed_topics = [], + Array[String] $detailed_subscribers = [], Optional[Array] $instances = undef, ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/cassandra.pp b/manifests/integrations/cassandra.pp index 6e8da8051..9a651229a 100644 --- a/manifests/integrations/cassandra.pp +++ b/manifests/integrations/cassandra.pp @@ -33,7 +33,7 @@ Integer $port = 7199, Optional[String] $user = undef, Optional[String] $password = undef, - Optional[Hash] $tags = {}, + Hash $tags = {}, Optional[Integer] $max_returned_metrics = undef, ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/consul.pp b/manifests/integrations/consul.pp index 18652b0f3..b89f895d8 100644 --- a/manifests/integrations/consul.pp +++ b/manifests/integrations/consul.pp @@ -31,7 +31,7 @@ Boolean $catalog_checks = true, Boolean $network_latency_checks = true, Boolean $new_leader_checks = true, - Optional[Array] $service_whitelist = [] + Array $service_whitelist = [] ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/disk.pp b/manifests/integrations/disk.pp index 18985a549..911ac6667 100644 --- a/manifests/integrations/disk.pp +++ b/manifests/integrations/disk.pp @@ -62,8 +62,8 @@ # } class datadog_agent::integrations::disk ( String $use_mount = 'no', - $all_partitions = undef, - $tag_by_filesystem = undef, + String $all_partitions = undef, + String $tag_by_filesystem = undef, Optional[Array[String]] $filesystem_exclude = undef, Optional[Array[String]] $device_exclude = undef, Optional[Array[String]] $mountpoint_exclude = undef, diff --git a/manifests/integrations/fluentd.pp b/manifests/integrations/fluentd.pp index dde95a981..5918c3deb 100644 --- a/manifests/integrations/fluentd.pp +++ b/manifests/integrations/fluentd.pp @@ -18,8 +18,8 @@ # # class datadog_agent::integrations::fluentd ( - $monitor_agent_url = 'http://localhost:24220/api/plugins.json', - Optional[Array] $plugin_ids = [], + String $monitor_agent_url = 'http://localhost:24220/api/plugins.json', + Array $plugin_ids = [], ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/mysql.pp b/manifests/integrations/mysql.pp index 1914807a5..38ab0dc4c 100644 --- a/manifests/integrations/mysql.pp +++ b/manifests/integrations/mysql.pp @@ -69,21 +69,21 @@ class datadog_agent::integrations::mysql ( String $host = 'localhost', String $user = 'datadog', - Optional[Variant[String, Integer]] $port = 3306, + Variant[String, Integer] $port = 3306, Optional[String] $password = undef, Optional[String] $sock = undef, Array $tags = [], - String $replication = '0', - String $galera_cluster = '0', + String $replication = '0', + String $galera_cluster = '0', Boolean $extra_status_metrics = false, Boolean $extra_innodb_metrics = false, Boolean $extra_performance_metrics = false, Boolean $schema_size_metrics = false, Boolean $disable_innodb_metrics = false, Optional[Boolean] $dbm = undef, - Optional[Array] $queries = [], + Array $queries = [], Optional[Array] $instances = undef, - Optional[Array] $logs = [], + Array $logs = [], ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/postfix.pp b/manifests/integrations/postfix.pp index 9881830a9..6d65825a3 100644 --- a/manifests/integrations/postfix.pp +++ b/manifests/integrations/postfix.pp @@ -31,7 +31,7 @@ class datadog_agent::integrations::postfix ( String $directory = '/var/spool/postfix', Array $queues = ['active', 'deferred', 'incoming'], - Optional[Array] $tags = [], + Array $tags = [], Optional[Array] $instances = undef, ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/rabbitmq.pp b/manifests/integrations/rabbitmq.pp index f1bedbea4..dc551f2ae 100644 --- a/manifests/integrations/rabbitmq.pp +++ b/manifests/integrations/rabbitmq.pp @@ -52,8 +52,8 @@ class datadog_agent::integrations::rabbitmq ( Optional[String] $url = undef, - Optional[String] $username = 'guest', - Optional[String] $password = 'guest', + String $username = 'guest', + String $password = 'guest', Boolean $ssl_verify = true, Boolean $tag_families = false, Array $nodes = [], diff --git a/manifests/ubuntu.pp b/manifests/ubuntu.pp index fe6df6ede..483fd3ca7 100644 --- a/manifests/ubuntu.pp +++ b/manifests/ubuntu.pp @@ -4,15 +4,15 @@ # class datadog_agent::ubuntu ( - Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, - String $agent_version = $datadog_agent::params::agent_version, - Optional[String] $agent_repo_uri = undef, - String $release = $datadog_agent::params::apt_default_release, - Boolean $skip_apt_key_trusting = false, - String $agent_flavor = $datadog_agent::params::package_name, - Optional[String] $apt_trusted_d_keyring = '/etc/apt/trusted.gpg.d/datadog-archive-keyring.gpg', - Optional[String] $apt_usr_share_keyring = '/usr/share/keyrings/datadog-archive-keyring.gpg', - Optional[Hash[String, String]] $apt_default_keys = { + Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, + String $agent_version = $datadog_agent::params::agent_version, + Optional[String] $agent_repo_uri = undef, + String $release = $datadog_agent::params::apt_default_release, + Boolean $skip_apt_key_trusting = false, + String $agent_flavor = $datadog_agent::params::package_name, + String $apt_trusted_d_keyring = '/etc/apt/trusted.gpg.d/datadog-archive-keyring.gpg', + String $apt_usr_share_keyring = '/usr/share/keyrings/datadog-archive-keyring.gpg', + Hash[String, String] $apt_default_keys = { 'DATADOG_APT_KEY_CURRENT.public' => 'https://keys.datadoghq.com/DATADOG_APT_KEY_CURRENT.public', '5F1E256061D813B125E156E8E6266D4AC0962C7D' => 'https://keys.datadoghq.com/DATADOG_APT_KEY_C0962C7D.public', 'D75CEA17048B9ACBF186794B32637D44F14F620E' => 'https://keys.datadoghq.com/DATADOG_APT_KEY_F14F620E.public', From 3153b49365a73fa770104cac27ff10705d4738f2 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 20 Dec 2024 15:54:39 +0000 Subject: [PATCH 004/133] add default extensions --- .vscode/extensions.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..6da8d472f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "puppet.puppet-vscode", + "Shopify.ruby-lsp" + ] +} From f54b8602338e8aa325becfd8181ffbe60d6da268 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 20 Dec 2024 15:55:49 +0000 Subject: [PATCH 005/133] optional param should not be optional if using default. prettied things --- manifests/system_probe.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/system_probe.pp b/manifests/system_probe.pp index 45aaf845d..88a157c84 100644 --- a/manifests/system_probe.pp +++ b/manifests/system_probe.pp @@ -6,12 +6,12 @@ # class datadog_agent::system_probe ( - Boolean $enabled = false, - Boolean $network_enabled = false, - Boolean $service_monitoring_enabled = false, - Optional[String] $log_file = undef, - Optional[String] $sysprobe_socket = undef, - Optional[Boolean] $enable_oom_kill = false, + Boolean $enabled = false, + Boolean $network_enabled = false, + Boolean $service_monitoring_enabled = false, + Optional[String] $log_file = undef, + Optional[String] $sysprobe_socket = undef, + Boolean $enable_oom_kill = false, Optional[Hash] $runtime_security_config = undef, Boolean $service_enable = true, From 84ed1a25d8ca3335a7cd875aaf28871cbdd4d10e Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 20 Dec 2024 15:59:37 +0000 Subject: [PATCH 006/133] now that we support Puppet 8, we should support stdlib v9. add linting no check for empty strings --- .puppet-lint.rc | 1 + metadata.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.puppet-lint.rc b/.puppet-lint.rc index 54f3eee45..6b2238bd2 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -6,6 +6,7 @@ --no-autoloader_layout-check --no-parameter_documentation-check --no-single_quote_string_with_variables-check +--no-params_empty_string_assignment-check --no-lookup_in_parameter-check --no-top_scope_facts-check --ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp diff --git a/metadata.json b/metadata.json index 43374b448..55846c83c 100644 --- a/metadata.json +++ b/metadata.json @@ -10,7 +10,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">=4.25.0 <9.0.0" + "version_requirement": ">=4.25.0 <10.0.0" }, { "name": "puppetlabs/concat", From bdd7245cee7db5ece6369ac307a42c7393ef3dd3 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 23 Dec 2024 09:49:55 +0000 Subject: [PATCH 007/133] upgrade pdk version to 3.4 --- .gitignore | 12 + .pdkignore | 17 +- .rspec | 2 + .rubocop.yml | 635 ++++++++++++++++++++++++++++++++++++-- .yardopts | 1 + Gemfile | 119 +++++--- Gemfile.lock | 670 +++++++++++++++++++---------------------- Rakefile | 15 + metadata.json | 8 +- pdk.yaml | 2 + spec/default_facts.yml | 9 + spec/spec_helper.rb | 113 +++++-- 12 files changed, 1149 insertions(+), 454 deletions(-) create mode 100644 .rspec create mode 100644 .yardopts create mode 100644 pdk.yaml create mode 100644 spec/default_facts.yml diff --git a/.gitignore b/.gitignore index d67bb69cf..e8202815a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,11 +11,15 @@ /bin/ /doc/ /Gemfile.local +/Gemfile.lock /junit/ /log/ /pkg/ +/spec/fixtures/manifests/ +/spec/fixtures/modules/* /tmp/ /vendor/ +/.vendor/ /convert_report.txt /update_report.txt spec/fixtures @@ -33,3 +37,11 @@ environments/**/.vagrant .kitchen .vscode + +/spec/fixtures/litmus_inventory.yaml +.resource_types +.modules +.task_cache.json +.plan_cache.json +.rerun.json +bolt-debug.log diff --git a/.pdkignore b/.pdkignore index 12313396a..a9d5282b0 100644 --- a/.pdkignore +++ b/.pdkignore @@ -16,30 +16,43 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ +/.vendor/ /convert_report.txt /update_report.txt .DS_Store .project .envrc /inventory.yaml -/appveyor.yml +/spec/fixtures/litmus_inventory.yaml +.resource_types +.modules +.task_cache.json +.plan_cache.json +.rerun.json +bolt-debug.log /.fixtures.yml /Gemfile /.gitattributes +/.github/ /.gitignore /.gitlab-ci.yml + /.pdkignore +/.puppet-lint.rc /Rakefile /rakelib/ /.rspec /.rubocop.yml /.travis.yml +/..yml /.yardopts /spec/ /.vscode/ +/.sync.yml +/.devcontainer/ /.github/ /.circleci/ /.pre-commit-config.yaml diff --git a/.rspec b/.rspec new file mode 100644 index 000000000..16f9cdb01 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--format documentation diff --git a/.rubocop.yml b/.rubocop.yml index c2c01dd62..21b82b99b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,12 +1,13 @@ --- require: +- rubocop-performance - rubocop-rspec -- rubocop-i18n AllCops: + NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.1' + TargetRubyVersion: '2.6' Include: - - "./**/*.rb" + - "**/*.rb" Exclude: - bin/* - ".vendor/**/*" @@ -18,16 +19,9 @@ AllCops: - "**/Puppetfile" - "**/Vagrantfile" - "**/Guardfile" -Metrics/LineLength: +Layout/LineLength: Description: People have wide screens, use them. Max: 200 -GetText: - Enabled: false -GetText/DecorateString: - Description: We don't want to decorate test output. - Exclude: - - spec/**/* - Enabled: false RSpec/BeforeAfterAll: Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing. @@ -36,6 +30,9 @@ RSpec/BeforeAfterAll: RSpec/HookArgument: Description: Prefer explicit :each argument, matching existing module's style EnforcedStyle: each +RSpec/DescribeSymbol: + Exclude: + - spec/unit/facter/**/*.rb Style/BlockDelimiters: Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then. @@ -68,7 +65,7 @@ Style/TrailingCommaInArguments: Description: Prefer always trailing comma on multiline argument lists. This makes diffs, and re-ordering nicer. EnforcedStyleForMultiline: comma -Style/TrailingCommaInLiteral: +Style/TrailingCommaInArrayLiteral: Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer. EnforcedStyleForMultiline: comma @@ -83,26 +80,176 @@ Style/Documentation: - spec/**/* Style/WordArray: EnforcedStyle: brackets +Performance/AncestorsInclude: + Enabled: true +Performance/BigDecimalWithNumericArgument: + Enabled: true +Performance/BlockGivenWithExplicitBlock: + Enabled: true +Performance/CaseWhenSplat: + Enabled: true +Performance/ConstantRegexp: + Enabled: true +Performance/MethodObjectAsBlock: + Enabled: true +Performance/RedundantSortBlock: + Enabled: true +Performance/RedundantStringChars: + Enabled: true +Performance/ReverseFirst: + Enabled: true +Performance/SortReverse: + Enabled: true +Performance/Squeeze: + Enabled: true +Performance/StringInclude: + Enabled: true +Performance/Sum: + Enabled: true Style/CollectionMethods: Enabled: true Style/MethodCalledOnDoEndBlock: Enabled: true Style/StringMethods: Enabled: true -GetText/DecorateFunctionMessage: +Bundler/GemFilename: + Enabled: false +Bundler/InsecureProtocolSource: + Enabled: false +Capybara/CurrentPathExpectation: Enabled: false -GetText/DecorateStringFormattingUsingInterpolation: +Capybara/VisibilityMatcher: Enabled: false -GetText/DecorateStringFormattingUsingPercent: +Gemspec/DuplicatedAssignment: + Enabled: false +Gemspec/OrderedDependencies: + Enabled: false +Gemspec/RequiredRubyVersion: + Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false +Layout/ArgumentAlignment: + Enabled: false +Layout/BeginEndAlignment: + Enabled: false +Layout/ClosingHeredocIndentation: + Enabled: false +Layout/EmptyComment: + Enabled: false +Layout/EmptyLineAfterGuardClause: + Enabled: false +Layout/EmptyLinesAroundArguments: + Enabled: false +Layout/EmptyLinesAroundAttributeAccessor: Enabled: false Layout/EndOfLine: Enabled: false -Layout/IndentHeredoc: +Layout/FirstArgumentIndentation: + Enabled: false +Layout/HashAlignment: + Enabled: false +Layout/HeredocIndentation: + Enabled: false +Layout/LeadingEmptyLines: + Enabled: false +Layout/SpaceAroundMethodCallOperator: + Enabled: false +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false +Layout/SpaceInsideReferenceBrackets: + Enabled: false +Lint/BigDecimalNew: + Enabled: false +Lint/BooleanSymbol: + Enabled: false +Lint/ConstantDefinitionInBlock: + Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false +Lint/DisjunctiveAssignmentInConstructor: + Enabled: false +Lint/DuplicateElsifCondition: + Enabled: false +Lint/DuplicateRequire: + Enabled: false +Lint/DuplicateRescueException: + Enabled: false +Lint/EmptyConditionalBody: + Enabled: false +Lint/EmptyFile: + Enabled: false +Lint/ErbNewArguments: + Enabled: false +Lint/FloatComparison: + Enabled: false +Lint/HashCompareByIdentity: + Enabled: false +Lint/IdentityComparison: + Enabled: false +Lint/InterpolationCheck: + Enabled: false +Lint/MissingCopEnableDirective: + Enabled: false +Lint/MixedRegexpCaptureTypes: + Enabled: false +Lint/NestedPercentLiteral: + Enabled: false +Lint/NonDeterministicRequireOrder: + Enabled: false +Lint/OrderedMagicComments: + Enabled: false +Lint/OutOfRangeRegexpRef: + Enabled: false +Lint/RaiseException: + Enabled: false +Lint/RedundantCopEnableDirective: + Enabled: false +Lint/RedundantRequireStatement: + Enabled: false +Lint/RedundantSafeNavigation: + Enabled: false +Lint/RedundantWithIndex: + Enabled: false +Lint/RedundantWithObject: + Enabled: false +Lint/RegexpAsCondition: + Enabled: false +Lint/ReturnInVoidContext: + Enabled: false +Lint/SafeNavigationConsistency: + Enabled: false +Lint/SafeNavigationWithEmpty: + Enabled: false +Lint/SelfAssignment: + Enabled: false +Lint/SendWithMixinArgument: + Enabled: false +Lint/ShadowedArgument: + Enabled: false +Lint/StructNewOverride: + Enabled: false +Lint/ToJSON: + Enabled: false +Lint/TopLevelReturnWithArgument: + Enabled: false +Lint/TrailingCommaInAttributeDeclaration: + Enabled: false +Lint/UnreachableLoop: + Enabled: false +Lint/UriEscapeUnescape: + Enabled: false +Lint/UriRegexp: + Enabled: false +Lint/UselessMethodDefinition: + Enabled: false +Lint/UselessTimes: Enabled: false Metrics/AbcSize: Enabled: false Metrics/BlockLength: Enabled: false +Metrics/BlockNesting: + Enabled: false Metrics/ClassLength: Enabled: false Metrics/CyclomaticComplexity: @@ -115,25 +262,469 @@ Metrics/ParameterLists: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Migration/DepartmentName: + Enabled: false +Naming/AccessorMethodName: + Enabled: false +Naming/BlockParameterName: + Enabled: false +Naming/HeredocDelimiterCase: + Enabled: false +Naming/HeredocDelimiterNaming: + Enabled: false +Naming/MemoizedInstanceVariableName: + Enabled: false +Naming/MethodParameterName: + Enabled: false +Naming/RescuedExceptionsVariableName: + Enabled: false +Naming/VariableNumber: + Enabled: false +Performance/BindCall: + Enabled: false +Performance/DeletePrefix: + Enabled: false +Performance/DeleteSuffix: + Enabled: false +Performance/InefficientHashSearch: + Enabled: false +Performance/UnfreezeString: + Enabled: false +Performance/UriDefaultParser: + Enabled: false +RSpec/Be: + Enabled: false +RSpec/Capybara/FeatureMethods: + Enabled: false +RSpec/ContainExactly: + Enabled: false +RSpec/ContextMethod: + Enabled: false +RSpec/ContextWording: + Enabled: false RSpec/DescribeClass: Enabled: false +RSpec/EmptyHook: + Enabled: false +RSpec/EmptyLineAfterExample: + Enabled: false +RSpec/EmptyLineAfterExampleGroup: + Enabled: false +RSpec/EmptyLineAfterHook: + Enabled: false RSpec/ExampleLength: Enabled: false -RSpec/MessageExpectation: +RSpec/ExampleWithoutDescription: + Enabled: false +RSpec/ExpectChange: + Enabled: false +RSpec/ExpectInHook: + Enabled: false +RSpec/FactoryBot/AttributeDefinedStatically: + Enabled: false +RSpec/FactoryBot/CreateList: + Enabled: false +RSpec/FactoryBot/FactoryClassName: + Enabled: false +RSpec/HooksBeforeExamples: + Enabled: false +RSpec/ImplicitBlockExpectation: + Enabled: false +RSpec/ImplicitSubject: + Enabled: false +RSpec/LeakyConstantDeclaration: + Enabled: false +RSpec/LetBeforeExamples: + Enabled: false +RSpec/MatchArray: + Enabled: false +RSpec/MissingExampleGroupArgument: Enabled: false RSpec/MultipleExpectations: Enabled: false +RSpec/MultipleMemoizedHelpers: + Enabled: false +RSpec/MultipleSubjects: + Enabled: false RSpec/NestedGroups: Enabled: false -Style/AsciiComments: +RSpec/PredicateMatcher: + Enabled: false +RSpec/ReceiveCounts: + Enabled: false +RSpec/ReceiveNever: + Enabled: false +RSpec/RepeatedExampleGroupBody: + Enabled: false +RSpec/RepeatedExampleGroupDescription: + Enabled: false +RSpec/RepeatedIncludeExample: + Enabled: false +RSpec/ReturnFromStub: + Enabled: false +RSpec/SharedExamples: + Enabled: false +RSpec/StubbedMock: + Enabled: false +RSpec/UnspecifiedException: + Enabled: false +RSpec/VariableDefinition: + Enabled: false +RSpec/VoidExpect: + Enabled: false +RSpec/Yield: + Enabled: false +Security/Open: + Enabled: false +Style/AccessModifierDeclarations: + Enabled: false +Style/AccessorGrouping: + Enabled: false +Style/BisectedAttrAccessor: + Enabled: false +Style/CaseLikeIf: + Enabled: false +Style/ClassEqualityComparison: + Enabled: false +Style/ColonMethodDefinition: + Enabled: false +Style/CombinableLoops: + Enabled: false +Style/CommentedKeyword: + Enabled: false +Style/Dir: + Enabled: false +Style/DoubleCopDisableDirective: + Enabled: false +Style/EmptyBlockParameter: + Enabled: false +Style/EmptyLambdaParameter: + Enabled: false +Style/Encoding: + Enabled: false +Style/EvalWithLocation: + Enabled: false +Style/ExpandPathArguments: + Enabled: false +Style/ExplicitBlockArgument: + Enabled: false +Style/ExponentialNotation: + Enabled: false +Style/FloatDivision: + Enabled: false +Style/FrozenStringLiteralComment: + Enabled: false +Style/GlobalStdStream: + Enabled: false +Style/HashAsLastArrayItem: + Enabled: false +Style/HashLikeCase: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: Enabled: false Style/IfUnlessModifier: Enabled: false -Style/SymbolProc: +Style/KeywordParametersOrder: + Enabled: false +Style/MinMax: + Enabled: false +Style/MixinUsage: + Enabled: false +Style/MultilineWhenThen: + Enabled: false +Style/NegatedUnless: Enabled: false Style/NumericPredicate: Enabled: false -Layout/FirstHashElementLineBreak: - Enabled: true -Style/EmptyLiteral: +Style/OptionalBooleanParameter: + Enabled: false +Style/OrAssignment: + Enabled: false +Style/RandomWithOffset: + Enabled: false +Style/RedundantAssignment: + Enabled: false +Style/RedundantCondition: + Enabled: false +Style/RedundantConditional: + Enabled: false +Style/RedundantFetchBlock: + Enabled: false +Style/RedundantFileExtensionInRequire: + Enabled: false +Style/RedundantRegexpCharacterClass: + Enabled: false +Style/RedundantRegexpEscape: + Enabled: false +Style/RedundantSelfAssignment: + Enabled: false +Style/RedundantSort: + Enabled: false +Style/RescueStandardError: + Enabled: false +Style/SingleArgumentDig: + Enabled: false +Style/SlicingWithRange: + Enabled: false +Style/SoleNestedConditional: + Enabled: false +Style/StderrPuts: + Enabled: false +Style/StringConcatenation: + Enabled: false +Style/Strip: + Enabled: false +Style/SymbolProc: + Enabled: false +Style/TrailingBodyOnClass: + Enabled: false +Style/TrailingBodyOnMethodDefinition: + Enabled: false +Style/TrailingBodyOnModule: + Enabled: false +Style/TrailingCommaInHashLiteral: + Enabled: false +Style/TrailingMethodEndStatement: + Enabled: false +Style/UnpackFirst: + Enabled: false +Capybara/MatchStyle: + Enabled: false +Capybara/NegationMatcher: + Enabled: false +Capybara/SpecificActions: + Enabled: false +Capybara/SpecificFinders: + Enabled: false +Capybara/SpecificMatcher: + Enabled: false +Gemspec/DeprecatedAttributeAssignment: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false +Gemspec/RequireMFA: + Enabled: false +Layout/LineContinuationLeadingSpace: + Enabled: false +Layout/LineContinuationSpacing: + Enabled: false +Layout/LineEndStringConcatenationIndentation: + Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false +Lint/AmbiguousAssignment: + Enabled: false +Lint/AmbiguousOperatorPrecedence: + Enabled: false +Lint/AmbiguousRange: + Enabled: false +Lint/ConstantOverwrittenInRescue: + Enabled: false +Lint/DeprecatedConstants: + Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateMagicComment: + Enabled: false +Lint/DuplicateMatchPattern: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/EmptyInPattern: + Enabled: false +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false +Lint/LambdaWithoutLiteralBlock: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/NonAtomicFileOperation: + Enabled: false +Lint/NumberedParameterAssignment: + Enabled: false +Lint/OrAssignmentToConstant: + Enabled: false +Lint/RedundantDirGlobSort: + Enabled: false +Lint/RefinementImportMethods: + Enabled: false +Lint/RequireRangeParentheses: + Enabled: false +Lint/RequireRelativeSelfPath: + Enabled: false +Lint/SymbolConversion: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/TripleQuotes: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Lint/UselessRescue: + Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false +Naming/BlockForwarding: + Enabled: false +Performance/CollectionLiteralInLoop: + Enabled: false +Performance/ConcurrentMonotonicTime: + Enabled: false +Performance/MapCompact: + Enabled: false +Performance/RedundantEqualityComparisonBlock: + Enabled: false +Performance/RedundantSplitRegexpArgument: + Enabled: false +Performance/StringIdentifierArgument: + Enabled: false +RSpec/BeEq: + Enabled: false +RSpec/BeNil: + Enabled: false +RSpec/ChangeByZero: + Enabled: false +RSpec/ClassCheck: + Enabled: false +RSpec/DuplicatedMetadata: + Enabled: false +RSpec/ExcessiveDocstringSpacing: + Enabled: false +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false +RSpec/FactoryBot/FactoryNameStyle: + Enabled: false +RSpec/FactoryBot/SyntaxMethods: + Enabled: false +RSpec/IdenticalEqualityAssertion: + Enabled: false +RSpec/NoExpectationExample: + Enabled: false +RSpec/PendingWithoutReason: + Enabled: false +RSpec/Rails/AvoidSetupHook: + Enabled: false +RSpec/Rails/HaveHttpStatus: + Enabled: false +RSpec/Rails/InferredSpecType: + Enabled: false +RSpec/Rails/MinitestAssertions: + Enabled: false +RSpec/Rails/TravelAround: + Enabled: false +RSpec/RedundantAround: + Enabled: false +RSpec/SkipBlockInsideExample: + Enabled: false +RSpec/SortMetadata: + Enabled: false +RSpec/SubjectDeclaration: + Enabled: false +RSpec/VerifiedDoubleReference: + Enabled: false +Security/CompoundHash: + Enabled: false +Security/IoMethods: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false +Style/ArrayIntersect: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/ComparableClamp: + Enabled: false +Style/ConcatArrayLiterals: + Enabled: false +Style/DataInheritance: + Enabled: false +Style/DirEmpty: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/EmptyHeredoc: + Enabled: false +Style/EndlessMethod: + Enabled: false +Style/EnvHome: + Enabled: false +Style/FetchEnvVar: + Enabled: false +Style/FileEmpty: + Enabled: false +Style/FileRead: + Enabled: false +Style/FileWrite: + Enabled: false +Style/HashConversion: + Enabled: false +Style/HashExcept: + Enabled: false +Style/IfWithBooleanLiteralBranches: + Enabled: false +Style/InPatternThen: + Enabled: false +Style/MagicCommentFormat: + Enabled: false +Style/MapCompactWithConditionalBlock: + Enabled: false +Style/MapToHash: + Enabled: false +Style/MapToSet: + Enabled: false +Style/MinMaxComparison: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NestedFileDirname: + Enabled: false +Style/NilLambda: + Enabled: false +Style/NumberedParameters: + Enabled: false +Style/NumberedParametersLimit: + Enabled: false +Style/ObjectThen: + Enabled: false +Style/OpenStructUse: + Enabled: false +Style/OperatorMethodCall: + Enabled: false +Style/QuotedSymbols: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/RedundantConstantBase: + Enabled: false +Style/RedundantDoubleSplatHashBraces: + Enabled: false +Style/RedundantEach: + Enabled: false +Style/RedundantHeredocDelimiterQuotes: + Enabled: false +Style/RedundantInitialize: + Enabled: false +Style/RedundantLineContinuation: + Enabled: false +Style/RedundantSelfAssignmentBranch: + Enabled: false +Style/RedundantStringEscape: + Enabled: false +Style/SelectByRegexp: + Enabled: false +Style/StringChars: + Enabled: false +Style/SwapValues: Enabled: false diff --git a/.yardopts b/.yardopts new file mode 100644 index 000000000..29c933bcf --- /dev/null +++ b/.yardopts @@ -0,0 +1 @@ +--markup markdown diff --git a/Gemfile b/Gemfile index d803173f9..8dbbcb1c9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,58 +1,85 @@ -source "https://rubygems.org" +source ENV['GEM_SOURCE'] || 'https://rubygems.org' -ruby_version = Gem::Version.new(RUBY_VERSION.dup) +def location_for(place_or_version, fake_version = nil) + git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} + file_url_regex = %r{\Afile:\/\/(?.*)} -# Each version of Puppet recommends a specific version of Ruby. Try to fetch the Puppet version that -# matches our Ruby (unless PUPPET_VERSION is defined). -matching_puppet_version = ruby_version > Gem::Version.new('2.5') ? (ruby_version > Gem::Version.new('2.7') ? '7.0.0' : '6.0.1') : '4.10.2' -puppet_version = ENV.fetch('PUPPET_VERSION', matching_puppet_version) -gem "puppet", "~> #{puppet_version}" - -ruby_version_segments = ruby_version.segments -minor_version = ruby_version_segments[0..1].join('.') + if place_or_version && (git_url = place_or_version.match(git_url_regex)) + [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact + elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) + ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] + else + [place_or_version, { require: false }] + end +end group :development do - gem "rake", "~> 12.3.3" if ruby_version < Gem::Version.new('2.6.0') # last version for ruby < 2.6 - gem "semantic_puppet", '= 1.0.4' - gem "xmlrpc" if ruby_version >= Gem::Version.new('2.3') - gem "concurrent-ruby", '= 1.1.10' if Gem::Requirement.create([' >= 6.9.0', '<7.25.0']).satisfied_by?(Gem::Version.new(puppet_version)) # Add this beucause until Puppet 7.25 concurrent-ruby 1.22 break puppet - gem "ruby-pwsh", '~> 0.3.0', platforms: [:mswin, :mingw, :x64_mingw] - gem "fast_gettext", '1.1.0', require: false if ruby_version < Gem::Version.new('2.1.0') - gem "fast_gettext", require: false if ruby_version >= Gem::Version.new('2.1.0') - gem "json_pure", '<= 2.0.1', require: false if ruby_version < Gem::Version.new('2.0.0') - gem "json", '= 1.8.1', require: false if ruby_version == Gem::Version.new('2.1.9') - gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(ruby_version) - gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(ruby_version) - gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "librarian-puppet", '<= 4.0.1' + gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "deep_merge", '~> 1.2.2', require: false + gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false + gem "facterdb", '~> 2.1', require: false + gem "metadata-json-lint", '~> 4.0', require: false + gem "rspec-puppet-facts", '~> 4.0', require: false + gem "dependency_checker", '~> 1.0.0', require: false + gem "parallel_tests", '= 3.12.1', require: false + gem "pry", '~> 0.10', require: false + gem "simplecov-console", '~> 0.9', require: false + gem "puppet-debugger", '~> 1.0', require: false + gem "rubocop", '~> 1.50.0', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "librarian-puppet", '~> 5.0' gem "kitchen-puppet" gem "kitchen-docker" gem "kitchen-verifier-serverspec" + gem "rexml", '>= 3.0.0', '< 3.2.7', require: false gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] - gem "rubocop-i18n", "~> 1.2.0" - gem "rubocop-rspec", "~> 1.16.0" + gem "test-kitchen", '~> 3.7.0' +end +group :development, :release_prep do + gem "puppet-strings", '~> 4.0', require: false + gem "puppetlabs_spec_helper", '~> 8.0', require: false + gem "puppet-blacksmith", '~> 7.0', require: false +end +group :system_tests do + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "serverspec", '~> 2.41', require: false +end - # https://github.com/ffi/ffi/issues/1103 (pin only for Ruby >= 2.5 as this version is not compatible below. ffi 1.17 is not compatible with Ruby 2.5: https://github.com/ffi/ffi/issues/1103) - if ruby_version >= Gem::Version.new('2.5') - gem "ffi", "= 1.16.3", platforms: [:ruby] - else - gem "ffi", require: false, platforms: [:mswin, :mingw, :x64_mingw] - end +puppet_version = ENV['PUPPET_GEM_VERSION'] +facter_version = ENV['FACTER_GEM_VERSION'] +hiera_version = ENV['HIERA_GEM_VERSION'] - if ruby_version >= Gem::Version.new('2.3') - gem "test-kitchen", '~> 2.5.4' - gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby] - gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby] - gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] - else - gem "test-kitchen", '~> 1.16.0' - gem "puppetlabs_spec_helper", "~> 2.14.1" - gem "puppet-lint", "~> 2.4.2" - gem "metadata-json-lint", "~> 1.2.2" - gem "puppet-syntax", "~> 2.5.0" - gem "rspec-puppet", "~> 2.6.9" - gem "rubocop", "~> 0.49.1" - gem "artifactory", "~> 2.8.2" +gems = {} + +gems['puppet'] = location_for(puppet_version) + +# If facter or hiera versions have been specified via the environment +# variables + +gems['facter'] = location_for(facter_version) if facter_version +gems['hiera'] = location_for(hiera_version) if hiera_version + +gems.each do |gem_name, gem_params| + gem gem_name, *gem_params +end + +# Evaluate Gemfile.local and ~/.gemfile if they exist +extra_gemfiles = [ + "#{__FILE__}.local", + File.join(Dir.home, '.gemfile'), +] + +extra_gemfiles.each do |gemfile| + if File.file?(gemfile) && File.readable?(gemfile) + eval(File.read(gemfile), binding) end end +# vim: syntax=ruby diff --git a/Gemfile.lock b/Gemfile.lock index 07fddbc5e..cc9892063 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,34 +1,30 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.3.6) - activesupport (6.1.6.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + CFPropertyList (3.0.6) + rexml + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ansi (1.5.0) ast (2.4.2) awesome_print (1.9.2) - aws-eventstream (1.2.0) - aws-partitions (1.609.0) - aws-sdk-core (3.131.3) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.525.0) - aws-sigv4 (~> 1.1) + aws-eventstream (1.3.0) + aws-partitions (1.1026.0) + aws-sdk-core (3.214.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-ec2 (1.323.0) - aws-sdk-core (~> 3, >= 3.127.0) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.5.1) + aws-sdk-ec2 (1.498.0) + aws-sdk-core (~> 3, >= 3.210.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.10.1) aws-eventstream (~> 1, >= 1.0.2) - bcrypt_pbkdf (1.1.0) - bindata (2.4.10) - bolt (3.24.0) - CFPropertyList (~> 2.2) + base64 (0.2.0) + bigdecimal (3.1.8) + bindata (2.5.0) + bolt (3.30.0) + CFPropertyList (>= 2.2) addressable (~> 2.5) aws-sdk-ec2 (~> 1) concurrent-ruby (~> 1.0) @@ -37,474 +33,432 @@ GEM jwt (~> 2.2) logging (~> 2.2) minitar (~> 0.6) - net-scp (~> 1.2) - net-ssh (>= 4.0, < 7.0) + net-scp (>= 1.2, < 5.0) + net-ssh (>= 4.0, < 8.0) net-ssh-krb (~> 0.5) orchestrator_client (~> 0.5) puppet (>= 6.18.0) puppet-resource_api (>= 1.8.1) - puppet-strings (~> 2.3) - puppetfile-resolver (~> 0.5) + puppet-strings (>= 2.3.0, < 5.0) + puppetfile-resolver (>= 0.6.2, < 1.0) r10k (~> 3.10) ruby_smb (~> 1.0) terminal-table (~> 3.0) winrm (~> 2.0) winrm-fs (~> 1.3) - builder (3.2.4) - codecov (0.2.5) - colorize - json - simplecov + builder (3.3.0) coderay (1.1.3) colored2 (3.1.2) - colorize (0.8.1) - concurrent-ruby (1.1.10) - connection_pool (2.2.5) - cri (2.15.11) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) + cri (2.15.12) deep_merge (1.2.2) - dependency_checker (0.2.0) + dependency_checker (1.0.1) parallel - puppet_forge (~> 2.2) - rake (~> 12.3) + puppet_forge (>= 2.2, < 6.0) + rake (~> 13.0) semantic_puppet (~> 1.0) - diff-lcs (1.5.0) - docile (1.4.0) - docker-api (2.2.0) - excon (>= 0.47.0) + diff-lcs (1.5.1) + docile (1.4.1) + docker-api (2.4.0) + excon (>= 0.64.0) multi_json - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - ed25519 (1.2.4) - equatable (0.7.0) - erubi (1.10.0) - excon (0.92.4) - facter (4.2.10) + domain_name (0.6.20240107) + erubi (1.13.1) + excon (1.2.2) + facter (4.10.0) hocon (~> 1.3) - thor (>= 1.0.1, < 2.0) - facterdb (1.19.0) + thor (>= 1.0.1, < 1.3) + facterdb (2.1.0) facter (< 5.0.0) - jgrep - faraday (0.17.4) - multipart-post (>= 1.2, < 3) - faraday_middleware (0.14.0) - faraday (>= 0.7.4, < 1.0) - fast_gettext (1.1.2) + jgrep (~> 1.5, >= 1.5.4) + faraday (2.12.2) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-follow_redirects (0.3.0) + faraday (>= 1, < 3) + faraday-net_http (3.4.0) + net-http (>= 0.5.0) + faraday-net_http_persistent (2.3.0) + faraday (~> 2.5) + net-http-persistent (>= 4.0.4, < 5) + fast_gettext (2.4.0) + prime ffi (1.16.3) - ffi-compiler (1.0.1) - ffi (>= 1.0.0) - rake - gettext (3.2.9) + forwardable (1.3.3) + getoptlong (0.2.1) + gettext (3.5.0) + erubi locale (>= 2.0.5) + prime + racc text (>= 1.3.0) - gettext-setup (0.34) - fast_gettext (~> 1.1.0) - gettext (>= 3.0.2, < 3.3.0) + gettext-setup (1.1.0) + fast_gettext (~> 2.1) + gettext (~> 3.4) locale gssapi (1.3.1) ffi (>= 1.0.1) - gyoku (1.3.1) + gyoku (1.4.0) builder (>= 2.1.2) - hiera (3.9.0) - hiera-eyaml (3.3.0) + rexml (~> 3.0) + hiera-eyaml (3.4.0) highline optimist - highline (2.0.3) - hirb (0.7.3) - hocon (1.3.1) - honeycomb-beeline (2.11.0) - libhoney (>= 1.14.2) - http (4.4.1) - addressable (~> 2.3) - http-cookie (~> 1.0) - http-form_data (~> 2.2) - http-parser (~> 1.2.0) + highline (3.1.1) + reline + hocon (1.4.0) http-accept (1.7.0) - http-cookie (1.0.5) + http-cookie (1.0.8) domain_name (~> 0.5) - http-form_data (2.3.0) - http-parser (1.2.3) - ffi-compiler (>= 1.0, < 2.0) httpclient (2.8.3) - i18n (1.12.0) - concurrent-ruby (~> 1.0) + io-console (0.7.2) jgrep (1.5.4) - jmespath (1.6.1) - json (2.6.2) - json-schema (2.8.1) - addressable (>= 2.4) + jmespath (1.6.2) + json (2.6.3) + json-schema (5.1.0) + addressable (~> 2.8) jwt (2.2.3) - kitchen-docker (2.11.0) - test-kitchen (>= 1.0.0) - kitchen-puppet (3.5.2) - librarian-puppet (>= 3.0) - net-ssh (>= 3) - test-kitchen (>= 1.4) - kitchen-verifier-serverspec (0.7.1) - net-ssh (>= 3) - test-kitchen (>= 1.4) - libhoney (2.2.0) - addressable (~> 2.0) - excon - http (>= 2.0, < 6.0) - librarian-puppet (3.0.1) - librarianp (>= 0.6.3) - puppet_forge (~> 2.1) - rsync - librarianp (1.1.1) - thor (~> 1.0) - license-acceptance (1.0.19) - pastel (~> 0.7) - tomlrb (~> 1.2) - tty-box (~> 0.3) - tty-prompt (~> 0.18) little-plugger (1.1.4) - locale (2.1.3) + locale (2.1.4) log4r (1.1.10) - logging (2.3.0) + logger (1.6.4) + logging (2.4.0) little-plugger (~> 1.1) multi_json (~> 1.14) - metaclass (0.0.4) - metadata-json-lint (2.4.0) - json-schema (~> 2.8) + metadata-json-lint (4.1.0) + json-schema (>= 2.8, < 6.0) + semantic_puppet (~> 1.0) spdx-licenses (~> 1.0) - method_source (0.8.2) - mime-types (3.4.1) + method_source (1.1.0) + mime-types (3.6.0) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - minitar (0.9) - minitest (5.16.2) - mixlib-install (3.12.16) - mixlib-shellout - mixlib-versioning - thor - mixlib-shellout (2.2.7) - mixlib-versioning (1.2.12) - mocha (1.1.0) - metaclass (~> 0.0.1) + mime-types-data (3.2024.1203) + minitar (0.12.1) + mocha (2.7.1) + ruby2_keywords (>= 0.0.5) molinillo (0.8.0) multi_json (1.15.0) - multipart-post (2.1.1) - necromancer (0.5.1) - net-http-persistent (4.0.1) + net-http (0.6.0) + uri + net-http-persistent (4.0.5) connection_pool (~> 2.2) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-ssh (6.1.0) - net-ssh-gateway (2.0.0) - net-ssh (>= 4.0.0) + net-scp (4.0.0) + net-ssh (>= 2.6.5, < 8.0.0) + net-ssh (7.3.0) net-ssh-krb (0.5.1) gssapi (~> 1.3.0) net-ssh (>= 2.0) - net-telnet (0.1.1) + net-telnet (0.2.0) netrc (0.11.0) - nori (2.6.0) - optimist (3.0.1) - orchestrator_client (0.5.4) - faraday (~> 0.17.4) - net-http-persistent - parallel (1.20.1) - parallel_tests (2.14.2) + nori (2.7.1) + bigdecimal + optimist (3.2.0) + orchestrator_client (0.7.1) + faraday (>= 1.4, < 3.0) + faraday-net_http_persistent (>= 1.0, < 3.0) + parallel (1.26.3) + parallel_tests (3.12.1) parallel - parser (2.7.2.0) + parser (3.3.6.0) ast (~> 2.4.1) - pastel (0.7.4) - equatable (~> 0.6) - tty-color (~> 0.5) - pathspec (1.0.0) + racc + pathspec (2.1.0) pluginator (1.5.0) - powerpack (0.1.3) - pry (0.10.4) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - public_suffix (4.0.7) - puppet (7.0.0) + prime (0.1.3) + forwardable + singleton + pry (0.15.0) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (6.0.1) + puppet (8.10.0-x64-mingw32) concurrent-ruby (~> 1.0) deep_merge (~> 1.0) - facter (> 2.0.1, < 5) - fast_gettext (~> 1.1) - hiera (>= 3.2.1, < 4) + facter (>= 4.3.0, < 5) + fast_gettext (>= 2.1, < 4) + ffi (>= 1.15.5, < 1.17.0, != 1.16.2, != 1.16.1, != 1.16.0) + getoptlong (~> 0.2.0) locale (~> 2.1) - multi_json (~> 1.10) + minitar (~> 0.9) + multi_json (~> 1.13) puppet-resource_api (~> 1.5) + scanf (~> 1.0) semantic_puppet (~> 1.0) - puppet-blacksmith (6.1.1) - puppet-modulebuilder (~> 0.2) + puppet-blacksmith (7.1.0) + puppet-modulebuilder (~> 1.0) rest-client (~> 2.0) - puppet-debugger (1.2.0) + puppet-debugger (1.4.0) awesome_print (~> 1.7) bundler facterdb (>= 0.4.0) pluginator (~> 1.5.0) - puppet (>= 5.5) + puppet (>= 6) rb-readline (>= 0.5.5) table_print (>= 1.0.0) - tty-pager (~> 0.13.0) - puppet-lint (2.5.2) - puppet-module-posix-default-r2.7 (1.1.1) - puppet-module-posix-dev-r2.7 (0.5.3) - activesupport (~> 6.0) - bcrypt_pbkdf (~> 1.0) - codecov (>= 0.2, < 0.2.6) - concurrent-ruby (!= 1.1.6) - dependency_checker (~> 0.2) - ed25519 (~> 1.2) - facterdb (>= 0.8.1, < 2.0.0) - gettext-setup (~> 0.26) - metadata-json-lint (>= 2.0.2, < 3.0.0) - mocha (>= 1.0.0, < 1.2.0) - parallel_tests (>= 2.14.1, < 2.14.3) - pry (~> 0.10.4) - puppet-blacksmith (~> 6.0) - puppet-debugger (~> 1.0) - puppet-lint (>= 2.3.0, < 3.0.0) - puppet-resource_api (~> 1.8) - puppet-strings (~> 2.0) - puppet-syntax (>= 2.4.1, < 3.0.0) - puppet_litmus (>= 0.4.0, < 1.0.0) - puppet_pot_generator (~> 1.0) - puppetlabs_spec_helper (>= 2.9.0, < 3.0.0) - rainbow (~> 2.0) - rspec-puppet (>= 2.3.2, < 3.0.0) - rspec-puppet-facts (>= 1.10.0, < 3) - rspec_junit_formatter (~> 0.2) - rubocop (~> 0.49.0) - rubocop-i18n (~> 1.2.0) - rubocop-rspec (~> 1.16.0) - serverspec (~> 2.41) - simplecov (< 0.19.0) - simplecov-console (~> 0.4.2) - specinfra (= 2.82.2) - puppet-modulebuilder (0.3.0) + tty-pager (~> 0.14) + puppet-lint (4.2.4) + puppet-lint-absolute_classname-check (4.0.0) + puppet-lint (>= 3.0, < 5) + puppet-lint-anchor-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-file_ensure-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-leading_zero-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-lookup_in_parameter-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-manifest_whitespace-check (0.3.0) + puppet-lint (>= 1.0, < 5) + puppet-lint-optional_default-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-param-docs (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-param-types (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-params_empty_string-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-resource_reference_syntax (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-strict_indent-check (3.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-topscope-variable-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-trailing_comma-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-unquoted_string-check (3.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-variable_contains_upcase (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-version_comparison-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-modulebuilder (1.1.0) minitar (~> 0.9) - pathspec (>= 0.2.1, < 2.0.0) - puppet-resource_api (1.8.14) + pathspec (>= 0.2.1, < 3.0.0) + puppet-resource_api (1.9.0) hocon (>= 1.0) - puppet-strings (2.9.0) - rgen - yard (~> 0.9.5) - puppet-syntax (2.6.1) - puppet (>= 5) - rake - puppet_forge (2.3.4) - faraday (>= 0.9.0, < 0.18.0, != 0.13.1) - faraday_middleware (>= 0.9.0, < 0.15.0) - gettext-setup (~> 0.11) - minitar + puppet-strings (4.1.3) + rgen (~> 0.9) + yard (~> 0.9, < 0.9.37) + puppet-syntax (4.1.1) + puppet (>= 7, < 9) + rake (~> 13.1) + puppet_forge (5.0.4) + faraday (~> 2.0) + faraday-follow_redirects (~> 0.3.0) + minitar (< 1.0.0) semantic_puppet (~> 1.0) - puppet_litmus (0.34.0) - bolt (>= 2.0.1, < 4.0.0) + puppet_litmus (1.6.0) + bolt (~> 3.0) docker-api (>= 1.34, < 3.0.0) - honeycomb-beeline parallel - puppet-modulebuilder (>= 0.2.1, < 1.0.0) + puppet-modulebuilder (>= 0.3.0) retryable (~> 3.0) rspec - rspec_honeycomb_formatter tty-spinner (>= 0.5.0, < 1.0.0) - puppet_pot_generator (1.0.1) - puppet - puppetfile-resolver (0.6.2) + puppetfile-resolver (0.6.3) molinillo (~> 0.6) semantic_puppet (~> 1.0) - puppetlabs_spec_helper (2.16.0) - mocha (~> 1.0) - pathspec (>= 0.2.1, < 1.1.0) - puppet-lint (~> 2.0) - puppet-syntax (>= 2.0, < 4) - rspec-puppet (~> 2.0) - r10k (3.15.0) + puppetlabs_spec_helper (8.0.0) + mocha (>= 1.0, < 3) + pathspec (>= 0.2, < 3) + puppet-lint (~> 4.0) + puppet-syntax (~> 4.1, >= 4.1.1) + rspec-github (~> 2.0) + rspec-puppet (~> 5.0) + r10k (3.15.3) colored2 (= 3.1.2) cri (>= 2.15.10) fast_gettext (>= 1.1.0, < 3.0.0) gettext (>= 3.0.2, < 4.0.0) - gettext-setup (~> 0.24) + gettext-setup (>= 0.24, < 2.0.0) jwt (~> 2.2.3) log4r (= 1.1.10) minitar (~> 0.9) multi_json (~> 1.10) puppet_forge (>= 2.3.0) - rainbow (2.2.2) - rake - rake (12.3.3) + racc (1.8.1) + rainbow (3.1.1) + rake (13.2.1) rb-readline (0.5.5) - rest-client (2.1.0) + regexp_parser (2.9.3) + reline (0.5.12) + io-console (~> 0.5) + rest-client (2.1.0-x64-mingw32) + ffi (~> 1.9) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) retryable (3.0.5) - rgen (0.9.0) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-its (1.3.0) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) - rspec-mocks (3.11.1) + rexml (3.2.6) + rgen (0.9.1) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-puppet (2.12.0) - rspec - rspec-puppet-facts (2.0.5) - facter - facterdb (>= 0.5.0) - puppet - rspec-support (3.11.0) - rspec_honeycomb_formatter (0.2.1) - honeycomb-beeline + rspec-support (~> 3.13.0) + rspec-github (2.4.0) rspec-core (~> 3.0) - rspec_junit_formatter (0.5.1) - rspec-core (>= 2, < 4, != 2.12.0) - rsync (1.0.9) - rubocop (0.49.1) + rspec-its (2.0.0) + rspec-core (>= 3.13.0) + rspec-expectations (>= 3.13.0) + rspec-mocks (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-puppet (5.0.0) + rspec (~> 3.0) + rspec-puppet-facts (4.0.0) + deep_merge (~> 1.2) + facter (< 5) + facterdb (~> 2.1) + puppet (>= 7, < 9) + rspec-support (3.13.2) + rubocop (1.50.2) + json (~> 2.3) parallel (~> 1.10) - parser (>= 2.3.3.1, < 3.0) - powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) + parser (>= 3.2.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (~> 1.0, >= 1.0.1) - rubocop-i18n (1.2.0) - rubocop (~> 0.49.0) - rubocop-rspec (1.16.0) - rubocop (>= 0.49.0) - ruby-progressbar (1.11.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.37.0) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-performance (1.16.0) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + rubocop-rspec (2.19.0) + rubocop (~> 1.33) + rubocop-capybara (~> 2.17) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) ruby_smb (1.1.0) bindata rubyntlm windows_error - rubyntlm (0.6.3) + rubyntlm (0.6.5) + base64 rubyzip (2.3.2) - semantic_puppet (1.0.4) - serverspec (2.42.0) + scanf (1.0.0) + semantic_puppet (1.1.0) + serverspec (2.42.3) multi_json rspec (~> 3.0) rspec-its specinfra (~> 2.72) sfl (2.3) - simplecov (0.18.5) + simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) - simplecov-console (0.4.2) + simplecov_json_formatter (~> 0.1) + simplecov-console (0.9.2) ansi - hirb simplecov - simplecov-html (0.12.3) - slop (3.6.0) + terminal-table + simplecov-html (0.13.1) + simplecov_json_formatter (0.1.4) + singleton (0.3.0) spdx-licenses (1.3.0) - specinfra (2.82.2) + specinfra (2.91.0) + base64 net-scp net-ssh (>= 2.7) - net-telnet (= 0.1.1) + net-telnet sfl - strings (0.1.8) - strings-ansi (~> 0.1) - unicode-display_width (~> 1.5) + strings (0.2.1) + strings-ansi (~> 0.2) + unicode-display_width (>= 1.5, < 3.0) unicode_utils (~> 1.4) strings-ansi (0.2.0) table_print (1.5.7) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - test-kitchen (2.5.4) - bcrypt_pbkdf (~> 1.0) - ed25519 (~> 1.2) - license-acceptance (~> 1.0, >= 1.0.11) - mixlib-install (~> 3.6) - mixlib-shellout (>= 1.2, < 4.0) - net-scp (>= 1.1, < 4.0) - net-ssh (>= 2.9, < 7.0) - net-ssh-gateway (>= 1.2, < 3.0) - thor (>= 0.19, < 2.0) - winrm (~> 2.0) - winrm-elevated (~> 1.0) - winrm-fs (~> 1.1) text (1.3.1) - thor (1.1.0) - tomlrb (1.3.0) - tty-box (0.5.0) - pastel (~> 0.7.2) - strings (~> 0.1.6) - tty-cursor (~> 0.7) - tty-color (0.6.0) + thor (1.2.2) tty-cursor (0.7.1) - tty-pager (0.13.0) - strings (~> 0.1.8) + tty-pager (0.14.0) + strings (~> 0.2.0) tty-screen (~> 0.8) - tty-prompt (0.21.0) - necromancer (~> 0.5.0) - pastel (~> 0.7.0) - tty-reader (~> 0.7.0) - tty-reader (0.7.0) - tty-cursor (~> 0.7) - tty-screen (~> 0.7) - wisper (~> 2.0.0) - tty-screen (0.8.1) + tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) - tzinfo (2.0.5) - concurrent-ruby (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (1.7.0) + unicode-display_width (2.6.0) unicode_utils (1.4.0) - webrick (1.7.0) - windows_error (0.1.4) - winrm (2.3.6) + uri (1.0.2) + voxpupuli-puppet-lint-plugins (5.0.0) + puppet-lint (~> 4.0) + puppet-lint-absolute_classname-check (~> 4.0) + puppet-lint-anchor-check (~> 2.0) + puppet-lint-file_ensure-check (~> 2.0) + puppet-lint-leading_zero-check (~> 2.0) + puppet-lint-lookup_in_parameter-check (~> 2.0) + puppet-lint-manifest_whitespace-check (~> 0.3, < 1.0.0) + puppet-lint-optional_default-check (~> 2.0) + puppet-lint-param-docs (~> 2.0) + puppet-lint-param-types (~> 2.0) + puppet-lint-params_empty_string-check (~> 2.0) + puppet-lint-resource_reference_syntax (~> 2.0) + puppet-lint-strict_indent-check (~> 3.0) + puppet-lint-topscope-variable-check (~> 2.0) + puppet-lint-trailing_comma-check (~> 2.0) + puppet-lint-unquoted_string-check (~> 3.0) + puppet-lint-variable_contains_upcase (~> 2.0) + puppet-lint-version_comparison-check (~> 2.0) + windows_error (0.1.5) + winrm (2.3.9) builder (>= 2.1.2) erubi (~> 1.8) gssapi (~> 1.2) gyoku (~> 1.0) httpclient (~> 2.2, >= 2.2.0.2) logging (>= 1.6.1, < 3.0) - nori (~> 2.0) + nori (~> 2.0, >= 2.7.1) + rexml (~> 3.0) rubyntlm (~> 0.6.0, >= 0.6.3) - winrm-elevated (1.2.3) - erubi (~> 1.8) - winrm (~> 2.0) - winrm-fs (~> 1.0) winrm-fs (1.3.5) erubi (~> 1.8) logging (>= 1.6.1, < 3.0) rubyzip (~> 2.0) winrm (~> 2.0) - wisper (2.0.1) - xmlrpc (0.3.2) - webrick - yard (0.9.28) - webrick (~> 1.7.0) - zeitwerk (2.6.0) + yard (0.9.36) PLATFORMS - ruby + x64-mingw32 DEPENDENCIES - concurrent-ruby (= 1.1.10) - fast_gettext - ffi (= 1.16.3) - kitchen-docker - kitchen-puppet - kitchen-verifier-serverspec - librarian-puppet (<= 4.0.1) - mixlib-shellout (~> 2.2.7) - puppet (~> 7.0.0) - puppet-module-posix-default-r2.7 - puppet-module-posix-dev-r2.7 - puppet-module-win-default-r2.7 - puppet-module-win-dev-r2.7 + CFPropertyList (< 3.0.7) + deep_merge (~> 1.2.2) + dependency_checker (~> 1.0.0) + facterdb (~> 2.1) + json (= 2.6.3) + metadata-json-lint (~> 4.0) + parallel_tests (= 3.12.1) + pry (~> 0.10) + puppet (= 8.10.0) + puppet-blacksmith (~> 7.0) + puppet-debugger (~> 1.0) + puppet-strings (~> 4.0) + puppet_litmus (~> 1.0) + puppetlabs_spec_helper (~> 8.0) rb-readline (= 0.5.5) - rubocop-i18n (~> 1.2.0) - rubocop-rspec (~> 1.16.0) - ruby-pwsh (~> 0.3.0) - semantic_puppet (= 1.0.4) - test-kitchen (~> 2.5.4) - xmlrpc + rexml (>= 3.0.0, < 3.2.7) + rspec-puppet-facts (~> 4.0) + rubocop (~> 1.50.0) + rubocop-performance (= 1.16.0) + rubocop-rspec (= 2.19.0) + serverspec (~> 2.41) + simplecov-console (~> 0.9) + voxpupuli-puppet-lint-plugins (~> 5.0) BUNDLED WITH - 1.17.3 + 2.4.13 diff --git a/Rakefile b/Rakefile index 7c1fd16db..130ff70ec 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,10 @@ +# frozen_string_literal: true + +require 'bundler' +require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' +require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? require 'puppet-lint/tasks/puppet-lint' require 'rubocop/rake_task' @@ -13,6 +18,16 @@ exclude_paths = [ PuppetLint.configuration.ignore_paths = exclude_paths PuppetSyntax.exclude_paths = exclude_paths +PuppetLint.configuration.send('disable_relative') +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.send('disable_140chars') +PuppetLint.configuration.send('disable_class_inherits_from_params_class') +PuppetLint.configuration.send('disable_autoloader_layout') +PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_single_quote_string_with_variables') +PuppetLint.configuration.fail_on_warnings = true +PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"] + desc "Run syntax, lint, and spec tests." task :test => [ 'syntax', diff --git a/metadata.json b/metadata.json index 55846c83c..2ed70307c 100644 --- a/metadata.json +++ b/metadata.json @@ -148,11 +148,11 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">=4.6.0 <8.0.0" + "version_requirement": ">=4.6.0 < 9.0.0" } ], "description": "This will install the Datadog monitoring agent. Sign up and get your API key at: http://www.datadoghq.com", - "pdk-version": "1.15.0", - "template-url": "https://github.com/puppetlabs/pdk-templates#1.15.0", - "template-ref": "tags/1.15.0-0-g0bc522e" + "pdk-version": "3.4.0", + "template-url": "https://github.com/puppetlabs/pdk-templates#3.4.0", + "template-ref": "tags/3.4.0-0-gd3cc13f" } diff --git a/pdk.yaml b/pdk.yaml new file mode 100644 index 000000000..4bef4bd0f --- /dev/null +++ b/pdk.yaml @@ -0,0 +1,2 @@ +--- +ignore: [] diff --git a/spec/default_facts.yml b/spec/default_facts.yml new file mode 100644 index 000000000..3346c394d --- /dev/null +++ b/spec/default_facts.yml @@ -0,0 +1,9 @@ +# Use default_module_facts.yml for module specific facts. +# +# Facts specified here will override the values provided by rspec-puppet-facts. +--- +networking: + ip: "172.16.254.254" + ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" + mac: "AA:AA:AA:AA:AA:AA" +is_pe: false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8bf6b9389..cb40a30fd 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,15 @@ +# frozen_string_literal: true + +RSpec.configure do |c| + c.mock_with :rspec +end + require 'puppetlabs_spec_helper/module_spec_helper' +require 'rspec-puppet-facts' + +require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) + +include RspecPuppetFacts DEBIAN_OS = ['Ubuntu', 'Debian'].freeze REDHAT_OS = ['RedHat', 'CentOS', 'Fedora', 'Amazon', 'Scientific', 'OracleLinux', 'AlmaLinux', 'Rocky'].freeze @@ -60,30 +71,88 @@ def getosrelease(operatingsystem) end end -RSpec.configure do |c| - c.default_facts = { - 'architecture' => 'x86_64', - 'operatingsystem' => (RSpec::Support::OS.windows? ? 'Windows' : 'Ubuntu'), - 'osfamily' => (RSpec::Support::OS.windows? ? 'windows' : 'Debian'), - 'operatingsystemmajrelease' => (RSpec::Support::OS.windows? ? '2019' : '14'), - 'operatingsystemminrelease' => (RSpec::Support::OS.windows? ? 'SP1' : '04'), - 'operatingsystemrelease' => (RSpec::Support::OS.windows? ? '2019 SP1' : '14.04'), - 'lsbdistrelease' => (RSpec::Support::OS.windows? ? '2019 SP1' : '14.04'), - 'lsbdistcodename' => (RSpec::Support::OS.windows? ? '2019' : '14.04'), - 'os' => { - 'architecture' => 'x86_64', - 'name' => (RSpec::Support::OS.windows? ? 'Windows' : 'Ubuntu'), - 'family' => (RSpec::Support::OS.windows? ? 'windows' : 'Debian'), - 'release' => { - 'major' => (RSpec::Support::OS.windows? ? '2019' : '14'), - 'minor' => (RSpec::Support::OS.windows? ? 'SP1' : '04'), - 'full' => (RSpec::Support::OS.windows? ? '2019 SP1' : '14.04'), - }, +# Get parameters from catalogue. +def get_from_catalogue(type, name, parameter) + catalogue.resource(type, name).send(:parameters)[parameter.to_sym] +end + +default_facts = { + puppetversion: Puppet.version, + facterversion: Facter.version, + architecture: 'x86_64', + operatingsystem: (RSpec::Support::OS.windows? ? 'Windows' : 'Ubuntu'), + osfamily: (RSpec::Support::OS.windows? ? 'windows' : 'Debian'), + operatingsystemmajrelease: (RSpec::Support::OS.windows? ? '2019' : '14'), + operatingsystemminrelease: (RSpec::Support::OS.windows? ? 'SP1' : '04'), + operatingsystemrelease: (RSpec::Support::OS.windows? ? '2019 SP1' : '14.04'), + lsbdistrelease: (RSpec::Support::OS.windows? ? '2019 SP1' : '14.04'), + lsbdistcodename: (RSpec::Support::OS.windows? ? '2019' : '14.04'), + os: { + architecture: 'x86_64', + name: (RSpec::Support::OS.windows? ? 'Windows' : 'Ubuntu'), + family: (RSpec::Support::OS.windows? ? 'windows' : 'Debian'), + release: { + major: (RSpec::Support::OS.windows? ? '2019' : '14'), + minor: (RSpec::Support::OS.windows? ? 'SP1' : '04'), + full: (RSpec::Support::OS.windows? ? '2019 SP1' : '14.04'), }, } +} + +default_fact_files = [ + File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')), + File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')), +] + +default_fact_files.each do |f| + next unless File.exist?(f) && File.readable?(f) && File.size?(f) + + begin + require 'deep_merge' + default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) + rescue StandardError => e + RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" + end end -# Get parameters from catalogue. -def get_from_catalogue(type, name, parameter) - catalogue.resource(type, name).send(:parameters)[parameter.to_sym] +# read default_facts and merge them over what is provided by facterdb +default_facts.each do |fact, value| + add_custom_fact fact, value, merge_facts: true end + +RSpec.configure do |c| + c.default_facts = default_facts + c.before :each do + # set to strictest setting for testing + # by default Puppet runs at warning level + Puppet.settings[:strict] = :warning + Puppet.settings[:strict_variables] = true + end + c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT'] + c.after(:suite) do + RSpec::Puppet::Coverage.report!(0) + end + + # Filter backtrace noise + backtrace_exclusion_patterns = [ + %r{spec_helper}, + %r{gems}, + ] + + if c.respond_to?(:backtrace_exclusion_patterns) + c.backtrace_exclusion_patterns = backtrace_exclusion_patterns + elsif c.respond_to?(:backtrace_clean_patterns) + c.backtrace_clean_patterns = backtrace_exclusion_patterns + end +end + +# Ensures that a module is defined +# @param module_name Name of the module +def ensure_module_defined(module_name) + module_name.split('::').reduce(Object) do |last_module, next_module| + last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false) + last_module.const_get(next_module, false) + end +end + +# 'spec_overrides' from sync.yml will appear below this line From 9231147e031b7af4a585da8f8be237b01659e4ca Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 23 Dec 2024 11:08:26 +0000 Subject: [PATCH 008/133] controlling versions of io-console (as 0.8 is built for Ruby 3.3) and bcrypt_pbkdf 1.1 fails to install with Ruby 3.2.5 --- Gemfile | 2 + Gemfile.lock | 118 +++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 103 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index 8dbbcb1c9..980c57a18 100644 --- a/Gemfile +++ b/Gemfile @@ -34,6 +34,8 @@ group :development do gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "io-console", '= 0.7.2', require: false + gem "bcrypt_pbkdf", '= 1.0.1', require: false gem "librarian-puppet", '~> 5.0' gem "kitchen-puppet" gem "kitchen-docker" diff --git a/Gemfile.lock b/Gemfile.lock index cc9892063..0f9b97e4d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,7 +9,7 @@ GEM ast (2.4.2) awesome_print (1.9.2) aws-eventstream (1.3.0) - aws-partitions (1.1026.0) + aws-partitions (1.1027.0) aws-sdk-core (3.214.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) @@ -21,9 +21,10 @@ GEM aws-sigv4 (1.10.1) aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) + bcrypt_pbkdf (1.0.1-x64-mingw32) bigdecimal (3.1.8) bindata (2.5.0) - bolt (3.30.0) + bolt (4.0.0) CFPropertyList (>= 2.2) addressable (~> 2.5) aws-sdk-ec2 (~> 1) @@ -36,17 +37,19 @@ GEM net-scp (>= 1.2, < 5.0) net-ssh (>= 4.0, < 8.0) net-ssh-krb (~> 0.5) - orchestrator_client (~> 0.5) + orchestrator_client (~> 0.7) puppet (>= 6.18.0) puppet-resource_api (>= 1.8.1) puppet-strings (>= 2.3.0, < 5.0) puppetfile-resolver (>= 0.6.2, < 1.0) - r10k (~> 3.10) + r10k (>= 3.10, < 5) ruby_smb (~> 1.0) terminal-table (~> 3.0) winrm (~> 2.0) winrm-fs (~> 1.3) builder (3.3.0) + chef-utils (18.6.2) + concurrent-ruby coderay (1.1.3) colored2 (3.1.2) concurrent-ruby (1.3.4) @@ -64,6 +67,7 @@ GEM excon (>= 0.64.0) multi_json domain_name (0.6.20240107) + ed25519 (1.3.0) erubi (1.13.1) excon (1.2.2) facter (4.10.0) @@ -86,6 +90,8 @@ GEM fast_gettext (2.4.0) prime ffi (1.16.3) + ffi-win32-extensions (1.0.4) + ffi forwardable (1.3.3) getoptlong (0.2.1) gettext (3.5.0) @@ -117,9 +123,31 @@ GEM jgrep (1.5.4) jmespath (1.6.2) json (2.6.3) - json-schema (5.1.0) + json-schema (5.1.1) addressable (~> 2.8) - jwt (2.2.3) + bigdecimal (~> 3.1) + jwt (2.9.3) + base64 + kitchen-docker (3.0.0) + test-kitchen (>= 1.0.0) + kitchen-puppet (3.7.0) + librarian-puppet (>= 3.0) + net-ssh (>= 3) + test-kitchen (>= 1.4) + kitchen-verifier-serverspec (0.7.2) + net-ssh (>= 3) + test-kitchen (>= 1.4) + librarian-puppet (5.0.0) + librarianp (>= 0.6.3) + puppet_forge (>= 2.1, < 5) + rsync + librarianp (1.1.2) + thor (~> 1.0) + license-acceptance (2.1.13) + pastel (~> 0.7) + tomlrb (>= 1.2, < 3.0) + tty-box (~> 0.6) + tty-prompt (~> 0.20) little-plugger (1.1.4) locale (2.1.4) log4r (1.1.10) @@ -137,6 +165,16 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2024.1203) minitar (0.12.1) + mixlib-install (3.12.30) + mixlib-shellout + mixlib-versioning + thor + mixlib-shellout (3.3.4-universal-mingw32) + chef-utils + ffi-win32-extensions (~> 1.0.3) + win32-process (~> 0.9) + wmi-lite (~> 1.0) + mixlib-versioning (1.2.12) mocha (2.7.1) ruby2_keywords (>= 0.0.5) molinillo (0.8.0) @@ -148,6 +186,8 @@ GEM net-scp (4.0.0) net-ssh (>= 2.6.5, < 8.0.0) net-ssh (7.3.0) + net-ssh-gateway (2.0.0) + net-ssh (>= 4.0.0) net-ssh-krb (0.5.1) gssapi (~> 1.3.0) net-ssh (>= 2.0) @@ -165,6 +205,8 @@ GEM parser (3.3.6.0) ast (~> 2.4.1) racc + pastel (0.8.0) + tty-color (~> 0.5) pathspec (2.1.0) pluginator (1.5.0) prime (0.1.3) @@ -245,13 +287,13 @@ GEM puppet-syntax (4.1.1) puppet (>= 7, < 9) rake (~> 13.1) - puppet_forge (5.0.4) + puppet_forge (4.1.0) faraday (~> 2.0) faraday-follow_redirects (~> 0.3.0) - minitar (< 1.0.0) + minitar semantic_puppet (~> 1.0) - puppet_litmus (1.6.0) - bolt (~> 3.0) + puppet_litmus (1.6.1) + bolt (~> 4.0) docker-api (>= 1.34, < 3.0.0) parallel puppet-modulebuilder (>= 0.3.0) @@ -268,23 +310,21 @@ GEM puppet-syntax (~> 4.1, >= 4.1.1) rspec-github (~> 2.0) rspec-puppet (~> 5.0) - r10k (3.15.3) + r10k (4.1.0) colored2 (= 3.1.2) cri (>= 2.15.10) - fast_gettext (>= 1.1.0, < 3.0.0) - gettext (>= 3.0.2, < 4.0.0) - gettext-setup (>= 0.24, < 2.0.0) - jwt (~> 2.2.3) + gettext-setup (>= 0.24, < 2.0) + jwt (>= 2.2.3, < 3) log4r (= 1.1.10) minitar (~> 0.9) multi_json (~> 1.10) - puppet_forge (>= 2.3.0) + puppet_forge (>= 4.1, < 6) racc (1.8.1) rainbow (3.1.1) rake (13.2.1) rb-readline (0.5.5) regexp_parser (2.9.3) - reline (0.5.12) + reline (0.6.0) io-console (~> 0.5) rest-client (2.1.0-x64-mingw32) ffi (~> 1.9) @@ -320,6 +360,7 @@ GEM facterdb (~> 2.1) puppet (>= 7, < 9) rspec-support (3.13.2) + rsync (1.0.9) rubocop (1.50.2) json (~> 2.3) parallel (~> 1.10) @@ -383,12 +424,39 @@ GEM table_print (1.5.7) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) + test-kitchen (3.7.0) + bcrypt_pbkdf (~> 1.0) + chef-utils (>= 16.4.35) + ed25519 (~> 1.2) + license-acceptance (>= 1.0.11, < 3.0) + mixlib-install (~> 3.6) + mixlib-shellout (>= 1.2, < 4.0) + net-scp (>= 1.1, < 5.0) + net-ssh (>= 2.9, < 8.0) + net-ssh-gateway (>= 1.2, < 3.0) + thor (>= 0.19, < 2.0) + winrm (~> 2.0) + winrm-elevated (~> 1.0) + winrm-fs (~> 1.1) text (1.3.1) thor (1.2.2) + tomlrb (2.0.3) + tty-box (0.7.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-cursor (~> 0.7) + tty-color (0.6.0) tty-cursor (0.7.1) tty-pager (0.14.0) strings (~> 0.2.0) tty-screen (~> 0.8) + tty-prompt (0.23.1) + pastel (~> 0.8) + tty-reader (~> 0.8) + tty-reader (0.9.0) + tty-cursor (~> 0.7) + tty-screen (~> 0.8) + wisper (~> 2.0) tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) @@ -414,6 +482,8 @@ GEM puppet-lint-unquoted_string-check (~> 3.0) puppet-lint-variable_contains_upcase (~> 2.0) puppet-lint-version_comparison-check (~> 2.0) + win32-process (0.10.0) + ffi (>= 1.0.0) windows_error (0.1.5) winrm (2.3.9) builder (>= 2.1.2) @@ -425,11 +495,17 @@ GEM nori (~> 2.0, >= 2.7.1) rexml (~> 3.0) rubyntlm (~> 0.6.0, >= 0.6.3) + winrm-elevated (1.2.3) + erubi (~> 1.8) + winrm (~> 2.0) + winrm-fs (~> 1.0) winrm-fs (1.3.5) erubi (~> 1.8) logging (>= 1.6.1, < 3.0) rubyzip (~> 2.0) winrm (~> 2.0) + wisper (2.0.1) + wmi-lite (1.0.7) yard (0.9.36) PLATFORMS @@ -437,11 +513,18 @@ PLATFORMS DEPENDENCIES CFPropertyList (< 3.0.7) + bcrypt_pbkdf (= 1.0.1) deep_merge (~> 1.2.2) dependency_checker (~> 1.0.0) facterdb (~> 2.1) + io-console (= 0.7.2) json (= 2.6.3) + kitchen-docker + kitchen-puppet + kitchen-verifier-serverspec + librarian-puppet (~> 5.0) metadata-json-lint (~> 4.0) + mixlib-shellout (~> 2.2.7) parallel_tests (= 3.12.1) pry (~> 0.10) puppet (= 8.10.0) @@ -458,6 +541,7 @@ DEPENDENCIES rubocop-rspec (= 2.19.0) serverspec (~> 2.41) simplecov-console (~> 0.9) + test-kitchen (~> 3.7.0) voxpupuli-puppet-lint-plugins (~> 5.0) BUNDLED WITH From c9a36a0e3e4adc279e615e30aac1f47b1f7c336d Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 24 Jan 2025 15:22:00 +0000 Subject: [PATCH 009/133] update the reference to concat to support later versions of stdlib --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 2ed70307c..5ca61162b 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppetlabs/concat", - "version_requirement": ">=4.0.0 <8.0.0" + "version_requirement": ">=4.0.0 <10.0.0" }, { "name": "puppetlabs/apt", From 57681d76e512ce6c08ea01529ff12e397e7d623c Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 27 Jan 2025 08:19:35 +0000 Subject: [PATCH 010/133] update to new stdlib function --- manifests/tag5.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/tag5.pp b/manifests/tag5.pp index 33b1b4635..77e49bcb5 100644 --- a/manifests/tag5.pp +++ b/manifests/tag5.pp @@ -6,7 +6,7 @@ if $lookup_fact { $value = getvar($tag_name) - if is_array($value) { + if $value.is_a(Array) { $tags = prefix($value, "${tag_name}:") datadog_agent::tag5 { $tags: } } else { From 3ae9a1fb38c264d9dd00b0eccd77ad86a71acab4 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 27 Jan 2025 15:04:15 +0000 Subject: [PATCH 011/133] fixes requested by code review --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index d41ade491..c808bedbc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -303,7 +303,7 @@ Boolean $manage_dogapi_gem = true, Boolean $manage_install = true, Optional[Boolean] $datadog_installer_enabled = undef, - String $hostname_extraction_regex = undef, + Optional[String] $hostname_extraction_regex = undef, Boolean $hostname_fqdn = false, Variant[Stdlib::Port, Pattern[/^\d*$/]] $dogstatsd_port = 8125, String $dogstatsd_socket = '', @@ -368,7 +368,7 @@ Boolean $scrub_args = $datadog_agent::params::process_default_scrub_args, Array $custom_sensitive_words = $datadog_agent::params::process_default_custom_words, Boolean $logs_enabled = $datadog_agent::params::logs_enabled, - Integer $logs_open_files_limit = $datadog_agent::params::logs_open_files_limit, + Optional[Integer] $logs_open_files_limit = $datadog_agent::params::logs_open_files_limit, Boolean $container_collect_all = $datadog_agent::params::container_collect_all, Hash[String[1], Data] $agent_extra_options = {}, Optional[String] $agent_repo_uri = undef, From cd105ea52703a0fa99fbeb1d69dec1e03e4c01c5 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 27 Jan 2025 15:04:49 +0000 Subject: [PATCH 012/133] remove deprecated function, moving to is_a --- manifests/integrations/elasticsearch.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/integrations/elasticsearch.pp b/manifests/integrations/elasticsearch.pp index cfe6227bb..67bca4d57 100644 --- a/manifests/integrations/elasticsearch.pp +++ b/manifests/integrations/elasticsearch.pp @@ -41,7 +41,7 @@ # $ssl_verify can be a bool or a string # https://github.com/DataDog/dd-agent/blob/master/checks.d/elastic.py#L454-L455 - if validate_legacy('Variant[Boolean, String]', 'is_string', $ssl_verify) { + if $ssl_verify.is_a(String) { validate_absolute_path($ssl_verify) } From 9b4023dfa9c66ad7915ffc3f100dc44359512e10 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 27 Jan 2025 15:30:27 +0000 Subject: [PATCH 013/133] version comparison is working with a int not a string --- manifests/init.pp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index c808bedbc..e57390f92 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -410,7 +410,10 @@ if $facts['os']['release']['full'] =~ /^6(.[0-9])?/ and $agent_version == 'latest' { notice("datadog-agent ${_agent_major_version}.51 is the last supported version on CentOS 6. Installing ${_agent_major_version}.51 now") $agent_full_version='7.51.1' - } elsif $facts['os']['release']['full'] =~ /^6(.[0-9])?/ and $_agent_minor_version != undef and versioncmp($_agent_minor_version, '51') > 0 { +# $_agent_minor_version is a Integer, so we can't use the versioncmp function +# lint:ignore:version_comparison + } elsif $facts['os']['release']['full'] =~ /^6(.[0-9])?/ and $_agent_minor_version != undef and $_agent_minor_version > 51 { +# lint:endignore fail("datadog-agent ${_agent_major_version}.51 is the last supported version on CentOS 6.") } else { $agent_full_version = $agent_version @@ -419,9 +422,12 @@ default: { $agent_full_version = $agent_version } } - if versioncmp($_agent_major_version, '5') != 0 and versioncmp($_agent_major_version, '6') != 0 and versioncmp($_agent_major_version, '7') != 0 { +# $_agent_major_version is a Integer, so we can't use the versioncmp function +# lint:ignore:version_comparison + if $_agent_major_version != 5 and $_agent_major_version != 6 and $_agent_major_version != 7 { fail("agent_major_version must be either 5, 6 or 7, not ${_agent_major_version}") } +# lint:endignore if ($facts['os']['name'] == 'Windows' and $windows_ddagentuser_name != undef) { $dd_user = $windows_ddagentuser_name @@ -430,7 +436,10 @@ } if $conf_dir == undef { - if versioncmp($_agent_major_version, '5') == 0 { +# $_agent_major_version is a Integer, so we can't use the versioncmp function +# lint:ignore:version_comparison + if $_agent_major_version == 5 { +# lint:endignore $_conf_dir = $datadog_agent::params::legacy_conf_dir } else { $_conf_dir = $datadog_agent::params::conf_dir @@ -654,7 +663,10 @@ } } - if versioncmp($_agent_major_version, '5') == 0 { +# $_agent_major_version is a Integer, so we can't use the versioncmp function +# lint:ignore:version_comparison + if $_agent_major_version == 5 { +# lint:endignore if ($facts['os']['name'] == 'Windows') { fail('Installation of agent 5 with puppet is not supported on Windows') } From 7ae44228cdc1ae28644a714cbed3a302a11b039c Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 27 Jan 2025 15:31:59 +0000 Subject: [PATCH 014/133] making optional following code review --- manifests/reports.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/reports.pp b/manifests/reports.pp index 1fc6f0724..53dba54ed 100644 --- a/manifests/reports.pp +++ b/manifests/reports.pp @@ -20,9 +20,9 @@ String $puppetmaster_user, String $dogapi_version, Boolean $manage_dogapi_gem = true, - String $hostname_extraction_regex = undef, - String $proxy_http = undef, - String $proxy_https = undef, + Optional[String] $hostname_extraction_regex = undef, + Optional[String] $proxy_http = undef, + Optional[String] $proxy_https = undef, Array $report_fact_tags = [], Array $report_trusted_fact_tags = [], String $datadog_site = 'https://api.datadoghq.com', From 20176f8aeba769fe29925d13f4893c04b4f43ef7 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 27 Jan 2025 15:52:37 +0000 Subject: [PATCH 015/133] revert versioncmp changes made by pdk validate --- manifests/init.pp | 12 ------------ manifests/integration.pp | 2 +- manifests/integrations/activemq_xml.pp | 2 +- manifests/integrations/apache.pp | 2 +- manifests/integrations/cacti.pp | 2 +- manifests/integrations/cassandra.pp | 2 +- manifests/integrations/ceph.pp | 2 +- manifests/integrations/consul.pp | 2 +- manifests/integrations/directory.pp | 2 +- manifests/integrations/disk.pp | 2 +- manifests/integrations/dns_check.pp | 2 +- manifests/integrations/docker_daemon.pp | 4 ++-- manifests/integrations/elasticsearch.pp | 2 +- manifests/integrations/fluentd.pp | 2 +- manifests/integrations/generic.pp | 2 +- manifests/integrations/haproxy.pp | 2 +- manifests/integrations/http_check.pp | 2 +- manifests/integrations/jenkins.pp | 2 +- manifests/integrations/jmx.pp | 2 +- manifests/integrations/kafka.pp | 2 +- manifests/integrations/kong.pp | 2 +- manifests/integrations/kubernetes.pp | 2 +- manifests/integrations/kubernetes_state.pp | 2 +- manifests/integrations/linux_proc_extras.pp | 2 +- manifests/integrations/logs.pp | 2 +- manifests/integrations/marathon.pp | 2 +- manifests/integrations/memcache.pp | 2 +- manifests/integrations/mesos_master.pp | 4 ++-- manifests/integrations/mesos_slave.pp | 2 +- manifests/integrations/mongo.pp | 2 +- manifests/integrations/mysql.pp | 2 +- manifests/integrations/network.pp | 2 +- manifests/integrations/nginx.pp | 2 +- manifests/integrations/ntp.pp | 2 +- manifests/integrations/pgbouncer.pp | 2 +- manifests/integrations/php_fpm.pp | 2 +- manifests/integrations/postfix.pp | 2 +- manifests/integrations/postgres.pp | 2 +- manifests/integrations/process.pp | 2 +- manifests/integrations/rabbitmq.pp | 2 +- manifests/integrations/redis.pp | 2 +- manifests/integrations/riak.pp | 2 +- manifests/integrations/snmp.pp | 2 +- manifests/integrations/solr.pp | 2 +- manifests/integrations/ssh.pp | 2 +- manifests/integrations/supervisord.pp | 2 +- manifests/integrations/system_core.pp | 2 +- manifests/integrations/tcp_check.pp | 2 +- manifests/integrations/tomcat.pp | 2 +- manifests/integrations/twemproxy.pp | 2 +- manifests/integrations/varnish.pp | 2 +- manifests/integrations/zk.pp | 2 +- manifests/redhat.pp | 4 ++-- manifests/suse.pp | 2 +- 54 files changed, 56 insertions(+), 68 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index e57390f92..6a86cd8bd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -410,10 +410,7 @@ if $facts['os']['release']['full'] =~ /^6(.[0-9])?/ and $agent_version == 'latest' { notice("datadog-agent ${_agent_major_version}.51 is the last supported version on CentOS 6. Installing ${_agent_major_version}.51 now") $agent_full_version='7.51.1' -# $_agent_minor_version is a Integer, so we can't use the versioncmp function -# lint:ignore:version_comparison } elsif $facts['os']['release']['full'] =~ /^6(.[0-9])?/ and $_agent_minor_version != undef and $_agent_minor_version > 51 { -# lint:endignore fail("datadog-agent ${_agent_major_version}.51 is the last supported version on CentOS 6.") } else { $agent_full_version = $agent_version @@ -422,12 +419,9 @@ default: { $agent_full_version = $agent_version } } -# $_agent_major_version is a Integer, so we can't use the versioncmp function -# lint:ignore:version_comparison if $_agent_major_version != 5 and $_agent_major_version != 6 and $_agent_major_version != 7 { fail("agent_major_version must be either 5, 6 or 7, not ${_agent_major_version}") } -# lint:endignore if ($facts['os']['name'] == 'Windows' and $windows_ddagentuser_name != undef) { $dd_user = $windows_ddagentuser_name @@ -436,10 +430,7 @@ } if $conf_dir == undef { -# $_agent_major_version is a Integer, so we can't use the versioncmp function -# lint:ignore:version_comparison if $_agent_major_version == 5 { -# lint:endignore $_conf_dir = $datadog_agent::params::legacy_conf_dir } else { $_conf_dir = $datadog_agent::params::conf_dir @@ -663,10 +654,7 @@ } } -# $_agent_major_version is a Integer, so we can't use the versioncmp function -# lint:ignore:version_comparison if $_agent_major_version == 5 { -# lint:endignore if ($facts['os']['name'] == 'Windows') { fail('Installation of agent 5 with puppet is not supported on Windows') } diff --git a/manifests/integration.pp b/manifests/integration.pp index 60920498d..4a7bf9dce 100644 --- a/manifests/integration.pp +++ b/manifests/integration.pp @@ -10,7 +10,7 @@ # datadog_agent class, causing a dependency cycle. If using this class # directly, you should define datadog_agent before datadog_agent::integration. - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/${integration}.d" $dst = "${dst_dir}/${$conf_file}.yaml" if (! defined(File[$dst_dir])) { diff --git a/manifests/integrations/activemq_xml.pp b/manifests/integrations/activemq_xml.pp index fe903232e..3a0c31495 100644 --- a/manifests/integrations/activemq_xml.pp +++ b/manifests/integrations/activemq_xml.pp @@ -55,7 +55,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/activemq_xml.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/activemq_xml.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/apache.pp b/manifests/integrations/apache.pp index 1a0b64c0c..4f1547c62 100644 --- a/manifests/integrations/apache.pp +++ b/manifests/integrations/apache.pp @@ -36,7 +36,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/apache.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/apache.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/cacti.pp b/manifests/integrations/cacti.pp index 367a40d55..ad7ecd192 100644 --- a/manifests/integrations/cacti.pp +++ b/manifests/integrations/cacti.pp @@ -21,7 +21,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/cacti.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/cacti.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/cassandra.pp b/manifests/integrations/cassandra.pp index 9a651229a..dc1a9ff36 100644 --- a/manifests/integrations/cassandra.pp +++ b/manifests/integrations/cassandra.pp @@ -39,7 +39,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/cassandra.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/cassandra.d" file { $legacy_dst: diff --git a/manifests/integrations/ceph.pp b/manifests/integrations/ceph.pp index 7363e8dde..33eec0868 100644 --- a/manifests/integrations/ceph.pp +++ b/manifests/integrations/ceph.pp @@ -24,7 +24,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ceph.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/ceph.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/consul.pp b/manifests/integrations/consul.pp index b89f895d8..05c6d30f1 100644 --- a/manifests/integrations/consul.pp +++ b/manifests/integrations/consul.pp @@ -36,7 +36,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/consul.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/consul.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/directory.pp b/manifests/integrations/directory.pp index c482210b0..0a50ae8b5 100644 --- a/manifests/integrations/directory.pp +++ b/manifests/integrations/directory.pp @@ -89,7 +89,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/directory.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/directory.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/disk.pp b/manifests/integrations/disk.pp index 911ac6667..376b9afe2 100644 --- a/manifests/integrations/disk.pp +++ b/manifests/integrations/disk.pp @@ -90,7 +90,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/disk.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/disk.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/dns_check.pp b/manifests/integrations/dns_check.pp index d097aaadc..d4784c8da 100644 --- a/manifests/integrations/dns_check.pp +++ b/manifests/integrations/dns_check.pp @@ -36,7 +36,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/dns_check.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/dns_check.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/docker_daemon.pp b/manifests/integrations/docker_daemon.pp index 1f0c67197..5ec6bc565 100644 --- a/manifests/integrations/docker_daemon.pp +++ b/manifests/integrations/docker_daemon.pp @@ -64,7 +64,7 @@ notify => Service[$datadog_agent::params::service_name], } - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $legacy_dir = "${datadog_agent::params::conf_dir}/docker_daemon.d" file { $legacy_dir: @@ -84,7 +84,7 @@ ensure => 'absent', } - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/docker.d" file { $dst_dir: diff --git a/manifests/integrations/elasticsearch.pp b/manifests/integrations/elasticsearch.pp index 67bca4d57..6d8097a24 100644 --- a/manifests/integrations/elasticsearch.pp +++ b/manifests/integrations/elasticsearch.pp @@ -66,7 +66,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/elastic.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/elastic.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/fluentd.pp b/manifests/integrations/fluentd.pp index 5918c3deb..7f9251746 100644 --- a/manifests/integrations/fluentd.pp +++ b/manifests/integrations/fluentd.pp @@ -24,7 +24,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/fluentd.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/fluentd.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/generic.pp b/manifests/integrations/generic.pp index 1c80694c8..754ae7185 100644 --- a/manifests/integrations/generic.pp +++ b/manifests/integrations/generic.pp @@ -24,7 +24,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/${integration_name}.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/${integration_name}.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/haproxy.pp b/manifests/integrations/haproxy.pp index 08ab67de6..63a661c2f 100644 --- a/manifests/integrations/haproxy.pp +++ b/manifests/integrations/haproxy.pp @@ -37,7 +37,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/haproxy.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/haproxy.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index 9b96feb64..940aea26f 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -239,7 +239,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/http_check.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/http_check.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/jenkins.pp b/manifests/integrations/jenkins.pp index c017aee03..262b977c7 100644 --- a/manifests/integrations/jenkins.pp +++ b/manifests/integrations/jenkins.pp @@ -19,7 +19,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/jenkins.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/jenkins.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/jmx.pp b/manifests/integrations/jmx.pp index 10876b772..72b18fa59 100644 --- a/manifests/integrations/jmx.pp +++ b/manifests/integrations/jmx.pp @@ -68,7 +68,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/jmx.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/jmx.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/kafka.pp b/manifests/integrations/kafka.pp index 49072278a..ae8528817 100644 --- a/manifests/integrations/kafka.pp +++ b/manifests/integrations/kafka.pp @@ -87,7 +87,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kafka.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/kafka.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/kong.pp b/manifests/integrations/kong.pp index b58152868..e972b73c7 100644 --- a/manifests/integrations/kong.pp +++ b/manifests/integrations/kong.pp @@ -35,7 +35,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kong.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/kong.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/kubernetes.pp b/manifests/integrations/kubernetes.pp index 8c9a59299..83bd05e40 100644 --- a/manifests/integrations/kubernetes.pp +++ b/manifests/integrations/kubernetes.pp @@ -33,7 +33,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kubernetes.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/kubernetes.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/kubernetes_state.pp b/manifests/integrations/kubernetes_state.pp index 107f70142..84357f43a 100644 --- a/manifests/integrations/kubernetes_state.pp +++ b/manifests/integrations/kubernetes_state.pp @@ -25,7 +25,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kubernetes_state.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/kubernetes_state.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/linux_proc_extras.pp b/manifests/integrations/linux_proc_extras.pp index 980648096..13d2fbae4 100644 --- a/manifests/integrations/linux_proc_extras.pp +++ b/manifests/integrations/linux_proc_extras.pp @@ -19,7 +19,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/linux_proc_extras.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/linux_proc_extras.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/logs.pp b/manifests/integrations/logs.pp index 5f8ec670e..a7d7bfff5 100644 --- a/manifests/integrations/logs.pp +++ b/manifests/integrations/logs.pp @@ -39,7 +39,7 @@ class datadog_agent::integrations::logs ( Array $logs = [], ) inherits datadog_agent::params { - unless versioncmp($datadog_agent::_agent_major_version, '5') == 0 { + unless $datadog_agent::_agent_major_version == 5 { require datadog_agent file { "${datadog_agent::params::conf_dir}/logs.yaml": diff --git a/manifests/integrations/marathon.pp b/manifests/integrations/marathon.pp index bcf008bf4..1c6c51a02 100644 --- a/manifests/integrations/marathon.pp +++ b/manifests/integrations/marathon.pp @@ -19,7 +19,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/marathon.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/marathon.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/memcache.pp b/manifests/integrations/memcache.pp index d0168edf6..8a507a061 100644 --- a/manifests/integrations/memcache.pp +++ b/manifests/integrations/memcache.pp @@ -55,7 +55,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mcache.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/mcache.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/mesos_master.pp b/manifests/integrations/mesos_master.pp index 1809dd284..fa6fcf5b0 100644 --- a/manifests/integrations/mesos_master.pp +++ b/manifests/integrations/mesos_master.pp @@ -18,7 +18,7 @@ ) inherits datadog_agent::params { require datadog_agent - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/mesos.d" file { $dst_dir: @@ -39,7 +39,7 @@ } $legacy_dst_master = "${datadog_agent::params::legacy_conf_dir}/mesos_master.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_master_dir = "${datadog_agent::params::conf_dir}/mesos_master.d" file { $legacy_dst_master: ensure => 'absent', diff --git a/manifests/integrations/mesos_slave.pp b/manifests/integrations/mesos_slave.pp index b3691f10f..9dcd574ae 100644 --- a/manifests/integrations/mesos_slave.pp +++ b/manifests/integrations/mesos_slave.pp @@ -17,7 +17,7 @@ String $url = 'http://localhost:5051' ) inherits datadog_agent::params { $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mesos_slave.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/mesos_slave.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/mongo.pp b/manifests/integrations/mongo.pp index 4299bca51..bfa8dd8b9 100644 --- a/manifests/integrations/mongo.pp +++ b/manifests/integrations/mongo.pp @@ -99,7 +99,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mongo.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/mongo.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/mysql.pp b/manifests/integrations/mysql.pp index 38ab0dc4c..a539b4b7c 100644 --- a/manifests/integrations/mysql.pp +++ b/manifests/integrations/mysql.pp @@ -117,7 +117,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mysql.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/mysql.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/network.pp b/manifests/integrations/network.pp index e08acc0ce..92a8d4544 100644 --- a/manifests/integrations/network.pp +++ b/manifests/integrations/network.pp @@ -42,7 +42,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/network.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/network.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/nginx.pp b/manifests/integrations/nginx.pp index 0f867afe2..e97e776b4 100644 --- a/manifests/integrations/nginx.pp +++ b/manifests/integrations/nginx.pp @@ -66,7 +66,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/nginx.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/nginx.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/ntp.pp b/manifests/integrations/ntp.pp index 2251a8479..31f3509e2 100644 --- a/manifests/integrations/ntp.pp +++ b/manifests/integrations/ntp.pp @@ -33,7 +33,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ntp.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/ntp.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/pgbouncer.pp b/manifests/integrations/pgbouncer.pp index ba733bc7b..f29bef5ce 100644 --- a/manifests/integrations/pgbouncer.pp +++ b/manifests/integrations/pgbouncer.pp @@ -54,7 +54,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/pgbouncer.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/pgbouncer.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/php_fpm.pp b/manifests/integrations/php_fpm.pp index e1bd1dbaa..31a9d65e6 100644 --- a/manifests/integrations/php_fpm.pp +++ b/manifests/integrations/php_fpm.pp @@ -51,7 +51,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/php_fpm.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/php_fpm.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/postfix.pp b/manifests/integrations/postfix.pp index 6d65825a3..60c786da5 100644 --- a/manifests/integrations/postfix.pp +++ b/manifests/integrations/postfix.pp @@ -49,7 +49,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/postfix.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/postfix.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/postgres.pp b/manifests/integrations/postgres.pp index 80fcae1b8..fb3ea3f40 100644 --- a/manifests/integrations/postgres.pp +++ b/manifests/integrations/postgres.pp @@ -103,7 +103,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/postgres.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/postgres.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/process.pp b/manifests/integrations/process.pp index 22777c5a3..09b3b9902 100644 --- a/manifests/integrations/process.pp +++ b/manifests/integrations/process.pp @@ -54,7 +54,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/process.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/process.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/rabbitmq.pp b/manifests/integrations/rabbitmq.pp index dc551f2ae..009e3b5e0 100644 --- a/manifests/integrations/rabbitmq.pp +++ b/manifests/integrations/rabbitmq.pp @@ -67,7 +67,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/rabbitmq.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/rabbitmq.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/redis.pp b/manifests/integrations/redis.pp index 9e845a426..34429ea34 100644 --- a/manifests/integrations/redis.pp +++ b/manifests/integrations/redis.pp @@ -75,7 +75,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/redisdb.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/redisdb.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/riak.pp b/manifests/integrations/riak.pp index 3db23b5bd..41f48e9f2 100644 --- a/manifests/integrations/riak.pp +++ b/manifests/integrations/riak.pp @@ -25,7 +25,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/riak.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/riak.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/snmp.pp b/manifests/integrations/snmp.pp index 882fa51b4..b8db406a0 100755 --- a/manifests/integrations/snmp.pp +++ b/manifests/integrations/snmp.pp @@ -68,7 +68,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/snmp.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/snmp.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/solr.pp b/manifests/integrations/solr.pp index 405bec8fe..290850084 100644 --- a/manifests/integrations/solr.pp +++ b/manifests/integrations/solr.pp @@ -39,7 +39,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/solr.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/solr.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/ssh.pp b/manifests/integrations/ssh.pp index 88c51945f..34db2202c 100644 --- a/manifests/integrations/ssh.pp +++ b/manifests/integrations/ssh.pp @@ -38,7 +38,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ssh.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/ssh_check.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/supervisord.pp b/manifests/integrations/supervisord.pp index 3d5471684..78353d042 100644 --- a/manifests/integrations/supervisord.pp +++ b/manifests/integrations/supervisord.pp @@ -47,7 +47,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/supervisord.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/supervisord.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/system_core.pp b/manifests/integrations/system_core.pp index 0861b5d2a..c77ed8a79 100644 --- a/manifests/integrations/system_core.pp +++ b/manifests/integrations/system_core.pp @@ -10,7 +10,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/system_core.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/system_core.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index 0575002c0..b85ae9492 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -117,7 +117,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/tcp_check.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/tcp_check.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/tomcat.pp b/manifests/integrations/tomcat.pp index 6b5ce7e7a..4003a90bd 100644 --- a/manifests/integrations/tomcat.pp +++ b/manifests/integrations/tomcat.pp @@ -42,7 +42,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/tomcat.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/tomcat.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/twemproxy.pp b/manifests/integrations/twemproxy.pp index 7499d29ef..698a797e1 100644 --- a/manifests/integrations/twemproxy.pp +++ b/manifests/integrations/twemproxy.pp @@ -42,7 +42,7 @@ } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/twemproxy.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/twemproxy.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/varnish.pp b/manifests/integrations/varnish.pp index 0da6baf52..b1ef7ce90 100644 --- a/manifests/integrations/varnish.pp +++ b/manifests/integrations/varnish.pp @@ -29,7 +29,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/varnish.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/varnish.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/integrations/zk.pp b/manifests/integrations/zk.pp index 76af8417b..75ec8fc51 100644 --- a/manifests/integrations/zk.pp +++ b/manifests/integrations/zk.pp @@ -33,7 +33,7 @@ require datadog_agent $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/zk.yaml" - if versioncmp($datadog_agent::_agent_major_version, '5') > 0 { + if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/zk.d" file { $legacy_dst: ensure => 'absent', diff --git a/manifests/redhat.pp b/manifests/redhat.pp index 7ab161feb..b08d0c238 100644 --- a/manifests/redhat.pp +++ b/manifests/redhat.pp @@ -20,7 +20,7 @@ ] #In this regex, version '1:6.15.0~rc.1-1' would match as $1='1:', $2='6', $3='15', $4='0', $5='~rc.1', $6='1' if $agent_version =~ /([0-9]+:)?([0-9]+)\.([0-9]+)\.([0-9]+)((?:~|-)[^0-9\s-]+[^-\s]*)?(?:-([0-9]+))?/ or $agent_version == 'latest' { - if versioncmp($agent_major_version, '5') > 0 and ($agent_version == 'latest' or 0 + $3 > 35) { + if $agent_major_version > 5 and ($agent_version == 'latest' or 0 + $3 > 35) { $keys = $all_keys[0,3] } else { $keys = $all_keys @@ -32,7 +32,7 @@ if ($rpm_repo_gpgcheck != undef) { $repo_gpgcheck = $rpm_repo_gpgcheck } else { - if ($agent_repo_uri == undef) and (versioncmp($agent_major_version, '5') > 0) { + if ($agent_repo_uri == undef) and ($agent_major_version > 5) { case $facts['os']['name'] { 'RedHat', 'CentOS', 'OracleLinux': { # disable repo_gpgcheck on 8.1 because of https://bugzilla.redhat.com/show_bug.cgi?id=1792506 diff --git a/manifests/suse.pp b/manifests/suse.pp index 4a928b52b..58d1b2075 100644 --- a/manifests/suse.pp +++ b/manifests/suse.pp @@ -20,7 +20,7 @@ ] #In this regex, version '1:6.15.0~rc.1-1' would match as $1='1:', $2='6', $3='15', $4='0', $5='~rc.1', $6='1' if $agent_version =~ /([0-9]+:)?([0-9]+)\.([0-9]+)\.([0-9]+)((?:~|-)[^0-9\s-]+[^-\s]*)?(?:-([0-9]+))?/ or $agent_version == 'latest' { - if versioncmp($agent_major_version, '5') > 0 and ($agent_version == 'latest' or 0 + $3 > 35) { + if $agent_major_version > 5 and ($agent_version == 'latest' or 0 + $3 > 35) { $keys_to_use = $all_keys[0,3] } else { $keys_to_use = $all_keys From 169150c97f284a9aafe1d499f892a3b5c6d2d63a Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 27 Jan 2025 15:53:04 +0000 Subject: [PATCH 016/133] removing linting check for use of versioning as we use integers for versionning not strings --- .puppet-lint.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/.puppet-lint.rc b/.puppet-lint.rc index 6b2238bd2..8b43cfb03 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -8,5 +8,6 @@ --no-single_quote_string_with_variables-check --no-params_empty_string_assignment-check --no-lookup_in_parameter-check +--no-version_comparison-check --no-top_scope_facts-check --ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp From 0b5359534c60b368321f8a02d8163be0d956e62d Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 08:01:34 +0000 Subject: [PATCH 017/133] update module dependencies to support Puppet 8 --- metadata.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/metadata.json b/metadata.json index 5ca61162b..9340aee81 100644 --- a/metadata.json +++ b/metadata.json @@ -18,7 +18,7 @@ }, { "name": "puppetlabs/apt", - "version_requirement": ">=4.4.0 <9.0.0" + "version_requirement": ">=4.4.0 <10.0.0" }, { "name": "puppetlabs/puppetserver_gem", @@ -26,15 +26,15 @@ }, { "name": "puppetlabs/yumrepo_core", - "version_requirement": ">=1.0.3 < 2.0.0" + "version_requirement": ">=1.0.3 < 3.0.0" }, { "name": "puppetlabs/powershell", - "version_requirement": ">=2.3.0 <5.0.0" + "version_requirement": ">=2.3.0 <7.0.0" }, { "name": "puppet/zypprepo", - "version_requirement": ">=3.1.0 <4.0.0" + "version_requirement": ">=3.1.0 <6.0.0" } ], "operatingsystem_support": [ From 04dbd407119452fbd50d6d618773457199b0aa68 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 20:10:38 +0000 Subject: [PATCH 018/133] fixed class documentation and made params optional --- manifests/integrations/php_fpm.pp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/manifests/integrations/php_fpm.pp b/manifests/integrations/php_fpm.pp index 31a9d65e6..9438db67b 100644 --- a/manifests/integrations/php_fpm.pp +++ b/manifests/integrations/php_fpm.pp @@ -1,39 +1,37 @@ -# Class: datadog_agent::integrations::php_fpm +# @summary # # This class will set-up PHP FPM monitoring # -# Parameters: -# $status_url +# @param status_url # URL to fetch FPM metrics. Default: http://localhost/status # -# $ping_url +# @param ping_url # URL to get a reliable check of the FPM pool. Default: http://localhost/ping # -# $ping_reply +# @param ping_reply # Expected response from ping_url. Default: pong # -# $tags +# @param tags # Optional array of tags # -# $use_fastcgi +# @param use_fastcgi # Use fastcgi to get stats. Default: false # -# Sample Usage: +# @example # # class { 'datadog_agent::integrations::php_fpm' : # status_url => 'http://localhost/fpm_status', # ping_url => 'http://localhost/fpm_ping' # } # - class datadog_agent::integrations::php_fpm ( - String $status_url = 'http://localhost/status', - String $ping_url = 'http://localhost/ping', - String $ping_reply = 'pong', - String $http_host = undef, - Array $tags = [], - Array $instances = undef, - String $use_fastcgi = 'false' + String $status_url = 'http://localhost/status', + String $ping_url = 'http://localhost/ping', + String $ping_reply = 'pong', + Optional[String] $http_host = undef, + Array $tags = [], + Optional[Array] $instances = undef, + String $use_fastcgi = 'false' ) inherits datadog_agent::params { require datadog_agent From d718c77e19962dbc633d642f3b1dec238c864f5a Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 20:41:53 +0000 Subject: [PATCH 019/133] fix all optional references to undef calls. fix warnings about no class docs due to space between class declaration and docs --- manifests/install_integration.pp | 5 ++-- manifests/integrations/cacti.pp | 8 +++--- manifests/integrations/directory.pp | 1 - manifests/integrations/disk.pp | 5 ++-- manifests/integrations/http_check.pp | 27 ++++++++++----------- manifests/integrations/linux_proc_extras.pp | 1 - manifests/integrations/logs.pp | 1 - manifests/integrations/nginx.pp | 1 - manifests/integrations/ntp.pp | 9 +++---- manifests/integrations/snmp.pp | 5 ++-- manifests/integrations/solr.pp | 16 ++++++------ manifests/integrations/ssh.pp | 15 ++++++------ manifests/integrations/supervisord.pp | 1 - manifests/integrations/tcp_check.pp | 17 ++++++------- manifests/integrations/tomcat.pp | 18 +++++++------- manifests/integrations/twemproxy.pp | 6 ++--- manifests/integrations/varnish.pp | 6 ++--- manifests/redhat.pp | 1 - manifests/service.pp | 1 - manifests/suse.pp | 1 - manifests/system_probe.pp | 1 - manifests/windows.pp | 1 - 22 files changed, 66 insertions(+), 81 deletions(-) diff --git a/manifests/install_integration.pp b/manifests/install_integration.pp index ad70085dd..2998a78ad 100644 --- a/manifests/install_integration.pp +++ b/manifests/install_integration.pp @@ -1,7 +1,8 @@ +# Installs the integration with the given name and version. define datadog_agent::install_integration ( Enum['present', 'absent'] $ensure = 'present', - String $integration_name = undef, - String $version = undef, + Optional[String] $integration_name = undef, + Optional[String] $version = undef, Boolean $third_party = false, ) { require datadog_agent diff --git a/manifests/integrations/cacti.pp b/manifests/integrations/cacti.pp index ad7ecd192..38c26d196 100644 --- a/manifests/integrations/cacti.pp +++ b/manifests/integrations/cacti.pp @@ -13,10 +13,10 @@ # The path to the cacti rrd directory e.g. /var/lib/cacti/rra/ # class datadog_agent::integrations::cacti ( - String $mysql_host = 'localhost', - String $mysql_user = 'cacti', - Any $mysql_password = undef, - String $rrd_path = '/var/lib/cacti/rra/', + String $mysql_host = 'localhost', + String $mysql_user = 'cacti', + Optional[Any] $mysql_password = undef, + String $rrd_path = '/var/lib/cacti/rra/', ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/directory.pp b/manifests/integrations/directory.pp index 0a50ae8b5..87f680b0e 100644 --- a/manifests/integrations/directory.pp +++ b/manifests/integrations/directory.pp @@ -53,7 +53,6 @@ # }, # ] # } - class datadog_agent::integrations::directory ( String $directory = '', Boolean $filegauges = false, diff --git a/manifests/integrations/disk.pp b/manifests/integrations/disk.pp index 376b9afe2..7c36db621 100644 --- a/manifests/integrations/disk.pp +++ b/manifests/integrations/disk.pp @@ -51,7 +51,6 @@ # Regular expression (optional) to exclude disks, eg: /dev/sde.* # $excluded_mountpoint_re (DEPRECATED in agent version>6.9, use $mountpoint_exclude instead) # Regular expression (optional) to exclude , eg: /mnt/somebody-elses-problem.* - # # Sample Usage: # @@ -62,8 +61,8 @@ # } class datadog_agent::integrations::disk ( String $use_mount = 'no', - String $all_partitions = undef, - String $tag_by_filesystem = undef, + Optional[String] $all_partitions = undef, + Optional[String] $tag_by_filesystem = undef, Optional[Array[String]] $filesystem_exclude = undef, Optional[Array[String]] $device_exclude = undef, Optional[Array[String]] $mountpoint_exclude = undef, diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index 940aea26f..d423d69b8 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -165,30 +165,29 @@ # 'tags' => ['production', 'wordpress'] # }] # } - class datadog_agent::integrations::http_check ( - String $sitename = undef, - String $url = undef, - String $username = undef, - Any $password = undef, + Optional[String] $sitename = undef, + Optional[String] $url = undef, + Optional[String] $username = undef, + Optional[Any] $password = undef, Integer $timeout = 1, String $method = 'get', - Integer $min_collection_interval = undef, - Any $data = undef, - Integer $threshold = undef, - Integer $window = undef, - String $content_match = undef, + Optional[Integer] $min_collection_interval = undef, + Optional[Any] $data = undef, + Optional[Integer] $threshold = undef, + Optional[Integer] $window = undef, + Optional[String] $content_match = undef, Boolean $reverse_content_match = false, Boolean $include_content = false, - String $http_response_status_code = undef, + Optional[String] $http_response_status_code = undef, Boolean $collect_response_time = true, Boolean $disable_ssl_validation = false, Boolean $ignore_ssl_warning = false, Boolean $skip_event = true, Boolean $no_proxy = false, Boolean $check_certificate_expiration = true, - Integer $days_warning = undef, - Integer $days_critical = undef, + Optional[Integer] $days_warning = undef, + Optional[Integer] $days_critical = undef, Optional[Boolean] $check_hostname = undef, Optional[String] $ssl_server_name = undef, Array $headers = [], @@ -196,7 +195,7 @@ Array $tags = [], Array $contact = [], Optional[Array] $instances = undef, - String $ca_certs = undef, + Optional[String] $ca_certs = undef, ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/linux_proc_extras.pp b/manifests/integrations/linux_proc_extras.pp index 13d2fbae4..b9d848b19 100644 --- a/manifests/integrations/linux_proc_extras.pp +++ b/manifests/integrations/linux_proc_extras.pp @@ -12,7 +12,6 @@ # class { 'datadog_agent::integrations::linux_proc_extras': # tags => [ 'env:production' ], # } - class datadog_agent::integrations::linux_proc_extras ( Array $tags = [], ) inherits datadog_agent::params { diff --git a/manifests/integrations/logs.pp b/manifests/integrations/logs.pp index a7d7bfff5..d40a5fcb7 100644 --- a/manifests/integrations/logs.pp +++ b/manifests/integrations/logs.pp @@ -35,7 +35,6 @@ # Documentation: # https://docs.datadoghq.com/logs/log_collection # - class datadog_agent::integrations::logs ( Array $logs = [], ) inherits datadog_agent::params { diff --git a/manifests/integrations/nginx.pp b/manifests/integrations/nginx.pp index e97e776b4..d870ec3cd 100644 --- a/manifests/integrations/nginx.pp +++ b/manifests/integrations/nginx.pp @@ -58,7 +58,6 @@ # source: nginx # sourcecategory: 'http_web_access' # - class datadog_agent::integrations::nginx ( Array $instances = [], Optional[Array] $logs = undef, diff --git a/manifests/integrations/ntp.pp b/manifests/integrations/ntp.pp index 31f3509e2..4b8884427 100644 --- a/manifests/integrations/ntp.pp +++ b/manifests/integrations/ntp.pp @@ -22,13 +22,12 @@ # host => 'pool.ntp.org', # } # - class datadog_agent::integrations::ntp ( Integer $offset_threshold = 60, - String $host = undef, - Integer $port = undef, - String $version = undef, - Integer $timeout = undef, + Optional[String] $host = undef, + Optional[Integer] $port = undef, + Optional[String] $version = undef, + Optional[Integer] $timeout = undef, ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/snmp.pp b/manifests/integrations/snmp.pp index b8db406a0..e91d759e7 100755 --- a/manifests/integrations/snmp.pp +++ b/manifests/integrations/snmp.pp @@ -49,11 +49,10 @@ # } # ], # } - class datadog_agent::integrations::snmp ( - Any $mibs_folder = undef, + Optional[Any] $mibs_folder = undef, Boolean $ignore_nonincreasing_oid = false, - Hash $init_config = {}, + Hash $init_config = {}, Array $instances = [], Array $snmp_v1_instances = [], Array $snmp_v2_instances = [], diff --git a/manifests/integrations/solr.pp b/manifests/integrations/solr.pp index 290850084..498872781 100644 --- a/manifests/integrations/solr.pp +++ b/manifests/integrations/solr.pp @@ -27,14 +27,14 @@ # } # class datadog_agent::integrations::solr ( - String $hostname = 'localhost', - Integer $port = 7199, - String $username = undef, - Any $password = undef, - String $java_bin_path = undef, - String $trust_store_path = undef, - Any $trust_store_password = undef, - Hash $tags = {}, + String $hostname = 'localhost', + Integer $port = 7199, + Optional[String] $username = undef, + Optional[Any] $password = undef, + Optional[String] $java_bin_path = undef, + Optional[String] $trust_store_path = undef, + Optional[Any] $trust_store_password = undef, + Hash $tags = {}, ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/ssh.pp b/manifests/integrations/ssh.pp index 34db2202c..ca24fa0fb 100644 --- a/manifests/integrations/ssh.pp +++ b/manifests/integrations/ssh.pp @@ -25,15 +25,14 @@ # private_key_file => '/opt/super_secret_key', # } # - class datadog_agent::integrations::ssh ( - String $host = $trusted['certname'], - Integer $port = 22, - String $username = $datadog_agent::dd_user, - Any $password = undef, - Boolean $sftp_check = true, - String $private_key_file = undef, - Boolean $add_missing_keys = true, + String $host = $trusted['certname'], + Integer $port = 22, + String $username = $datadog_agent::dd_user, + Optional[Any] $password = undef, + Boolean $sftp_check = true, + Optional[String] $private_key_file = undef, + Boolean $add_missing_keys = true, ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/supervisord.pp b/manifests/integrations/supervisord.pp index 78353d042..2bfe91c1b 100644 --- a/manifests/integrations/supervisord.pp +++ b/manifests/integrations/supervisord.pp @@ -40,7 +40,6 @@ # # # - class datadog_agent::integrations::supervisord ( Array $instances = [{ 'servername' => 'server0', 'hostname' => 'localhost', 'port' => '9001' }], ) inherits datadog_agent::params { diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index b85ae9492..92ca996b8 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -83,16 +83,15 @@ # 'port' => '443', # }] # } - class datadog_agent::integrations::tcp_check ( - String $check_name = undef, - String $host = undef, - String $port = undef, - Integer $timeout = 10, - Integer $threshold = undef, - Integer $window = undef, - Integer $collect_response_time = undef, - Integer $skip_event = undef, + Optional[String] $check_name = undef, + Optional[String] $host = undef, + Optional[String] $port = undef, + Integer $timeout = 10, + Optional[Integer] $threshold = undef, + Optional[Integer] $window = undef, + Optional[Integer] $collect_response_time = undef, + Optional[Integer] $skip_event = undef, Array $tags = [], Optional[Array] $instances = undef, ) inherits datadog_agent::params { diff --git a/manifests/integrations/tomcat.pp b/manifests/integrations/tomcat.pp index 4003a90bd..595d4731f 100644 --- a/manifests/integrations/tomcat.pp +++ b/manifests/integrations/tomcat.pp @@ -29,15 +29,15 @@ # } # class datadog_agent::integrations::tomcat ( - String $hostname = 'localhost', - Integer $port = 7199, - String $jmx_url = undef, - String $username = undef, - Any $password = undef, - String $java_bin_path = undef, - String $trust_store_path = undef, - Any $trust_store_password = undef, - Hash $tags = {}, + String $hostname = 'localhost', + Integer $port = 7199, + Optional[String] $jmx_url = undef, + Optional[String] $username = undef, + Optional[Any] $password = undef, + Optional[String] $java_bin_path = undef, + Optional[String] $trust_store_path = undef, + Optional[Any] $trust_store_password = undef, + Hash $tags = {}, ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/twemproxy.pp b/manifests/integrations/twemproxy.pp index 698a797e1..01d51ce62 100644 --- a/manifests/integrations/twemproxy.pp +++ b/manifests/integrations/twemproxy.pp @@ -24,9 +24,9 @@ # } # class datadog_agent::integrations::twemproxy ( - String $host = 'localhost', - String $port = '22222', - Array $instances = undef, + String $host = 'localhost', + String $port = '22222', + Optional[Array] $instances = undef, ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/integrations/varnish.pp b/manifests/integrations/varnish.pp index b1ef7ce90..10683e3af 100644 --- a/manifests/integrations/varnish.pp +++ b/manifests/integrations/varnish.pp @@ -22,9 +22,9 @@ # } # class datadog_agent::integrations::varnish ( - String $varnishstat = '/usr/bin/varnishstat', - String $instance_name = undef, - Array $tags = [], + String $varnishstat = '/usr/bin/varnishstat', + Optional[String] $instance_name = undef, + Array $tags = [], ) inherits datadog_agent::params { require datadog_agent diff --git a/manifests/redhat.pp b/manifests/redhat.pp index b08d0c238..6a142dad9 100644 --- a/manifests/redhat.pp +++ b/manifests/redhat.pp @@ -2,7 +2,6 @@ # # This class contains the DataDog agent installation mechanism for Red Hat derivatives # - class datadog_agent::redhat ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, Optional[String] $agent_repo_uri = undef, diff --git a/manifests/service.pp b/manifests/service.pp index 96af7d989..d0102d108 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -2,7 +2,6 @@ # # This class declares the datadog-agent service # - class datadog_agent::service ( String $service_ensure = 'running', Variant[Boolean, Enum['manual', 'mask', 'delayed']] $service_enable = true, diff --git a/manifests/suse.pp b/manifests/suse.pp index 58d1b2075..ae9f51d6f 100644 --- a/manifests/suse.pp +++ b/manifests/suse.pp @@ -2,7 +2,6 @@ # # This class contains the DataDog agent installation mechanism for SUSE distributions # - class datadog_agent::suse ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, String $agent_version = $datadog_agent::params::agent_version, diff --git a/manifests/system_probe.pp b/manifests/system_probe.pp index 88a157c84..9e0bcc128 100644 --- a/manifests/system_probe.pp +++ b/manifests/system_probe.pp @@ -4,7 +4,6 @@ # On Windows, install the NPM driver by setting 'windows_npm_install' # to 'true on the datadog_agent class. # - class datadog_agent::system_probe ( Boolean $enabled = false, Boolean $network_enabled = false, diff --git a/manifests/windows.pp b/manifests/windows.pp index 078647270..488b605bb 100644 --- a/manifests/windows.pp +++ b/manifests/windows.pp @@ -2,7 +2,6 @@ # # This class contains the DataDog agent installation mechanism for Windows # - class datadog_agent::windows ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, String $agent_version = $datadog_agent::params::agent_version, From 1868a80a170643a608cbe1618d17c49ac4e04886 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 20:49:26 +0000 Subject: [PATCH 020/133] fix for unless command --- manifests/ubuntu.pp | 10 ++++++---- manifests/ubuntu_installer.pp | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/manifests/ubuntu.pp b/manifests/ubuntu.pp index 483fd3ca7..babc9fcdc 100644 --- a/manifests/ubuntu.pp +++ b/manifests/ubuntu.pp @@ -51,13 +51,15 @@ source => $key_url, } + $unless_cmd = @("CMD"/L) + /usr/bin/gpg --no-default-keyring --keyring ${apt_usr_share_keyring} --list-keys --with-fingerprint --with-colons | grep \ + $(cat /tmp/${key_fingerprint} | gpg --with-colons --with-fingerprint 2>/dev/null | grep 'fpr:' | sed 's|^fpr||' | tr -d ':') + | CMD + exec { "ensure key ${key_fingerprint} is imported in APT keyring": command => "/bin/cat /tmp/${key_fingerprint} | gpg --import --batch --no-default-keyring --keyring ${apt_usr_share_keyring}", # the second part extracts the fingerprint of the key from output like "fpr::::A2923DFF56EDA6E76E55E492D3A80E30382E94DE:" - unless => "@(\"CMD\"/L) - /usr/bin/gpg --no-default-keyring --keyring ${apt_usr_share_keyring} --list-keys --with-fingerprint --with-colons | grep \ - $(cat /tmp/${key_fingerprint} | gpg --with-colons --with-fingerprint 2>/dev/null | grep 'fpr:' | sed 's|^fpr||' | tr -d ':') - | CMD", + unless => $unless_cmd, } } diff --git a/manifests/ubuntu_installer.pp b/manifests/ubuntu_installer.pp index b9ad851c2..427098dad 100644 --- a/manifests/ubuntu_installer.pp +++ b/manifests/ubuntu_installer.pp @@ -85,13 +85,15 @@ source => $key_url, } + $unless_cmd = @("CMD"/L) + /usr/bin/gpg --no-default-keyring --keyring ${apt_usr_share_keyring} --list-keys --with-fingerprint --with-colons | grep \ + $(cat /tmp/${key_fingerprint} | gpg --with-colons --with-fingerprint 2>/dev/null | grep 'fpr:' | sed 's|^fpr||' | tr -d ':') + | CMD + exec { "ensure key ${key_fingerprint} is imported in APT keyring": command => "/bin/cat /tmp/${key_fingerprint} | gpg --import --batch --no-default-keyring --keyring ${apt_usr_share_keyring}", # the second part extracts the fingerprint of the key from output like "fpr::::A2923DFF56EDA6E76E55E492D3A80E30382E94DE:" - unless => "@(\"CMD\"/L) - /usr/bin/gpg --no-default-keyring --keyring ${apt_usr_share_keyring} --list-keys --with-fingerprint --with-colons | grep \ - $(cat /tmp/${key_fingerprint} | gpg --with-colons --with-fingerprint 2>/dev/null | grep 'fpr:' | sed 's|^fpr||' | tr -d ':') - | CMD", + unless => $unless_cmd, } } if ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '16') == -1) or From daa8e2de4cb90f12cfa8e6538f3ee2b24a097b39 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 28 Jan 2025 15:51:53 -0500 Subject: [PATCH 021/133] fix pdk validation warnings --- Gemfile.lock | 82 +++++++++++---------- lib/puppet/reports/datadog_reports.rb | 2 +- manifests/install_integration.pp | 4 + manifests/integration.pp | 4 + manifests/integrations/directory.pp | 1 - manifests/integrations/http_check.pp | 1 - manifests/integrations/linux_proc_extras.pp | 1 - manifests/integrations/logs.pp | 1 - manifests/integrations/nginx.pp | 1 - manifests/integrations/ntp.pp | 1 - manifests/integrations/oom_kill.pp | 1 - manifests/integrations/php_fpm.pp | 1 - manifests/integrations/rabbitmq.pp | 1 - manifests/integrations/snmp.pp | 1 - manifests/integrations/ssh.pp | 1 - manifests/integrations/supervisord.pp | 1 - manifests/integrations/tcp_check.pp | 1 - manifests/params.pp | 1 - manifests/redhat.pp | 1 - manifests/security_agent.pp | 4 + manifests/service.pp | 1 - manifests/suse.pp | 1 - manifests/system_probe.pp | 1 - manifests/ubuntu.pp | 1 - manifests/windows.pp | 1 - spec/spec_helper.rb | 28 +++---- 26 files changed, 69 insertions(+), 75 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0f9b97e4d..5db49b9e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,20 +9,20 @@ GEM ast (2.4.2) awesome_print (1.9.2) aws-eventstream (1.3.0) - aws-partitions (1.1027.0) - aws-sdk-core (3.214.0) + aws-partitions (1.1043.0) + aws-sdk-core (3.217.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-ec2 (1.498.0) - aws-sdk-core (~> 3, >= 3.210.0) + aws-sdk-ec2 (1.502.0) + aws-sdk-core (~> 3, >= 3.216.0) aws-sigv4 (~> 1.5) - aws-sigv4 (1.10.1) + aws-sigv4 (1.11.0) aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) - bcrypt_pbkdf (1.0.1-x64-mingw32) - bigdecimal (3.1.8) + bcrypt_pbkdf (1.0.1) + bigdecimal (3.1.9) bindata (2.5.0) bolt (4.0.0) CFPropertyList (>= 2.2) @@ -52,8 +52,8 @@ GEM concurrent-ruby coderay (1.1.3) colored2 (3.1.2) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) cri (2.15.12) deep_merge (1.2.2) dependency_checker (1.0.1) @@ -69,7 +69,7 @@ GEM domain_name (0.6.20240107) ed25519 (1.3.0) erubi (1.13.1) - excon (1.2.2) + excon (1.2.3) facter (4.10.0) hocon (~> 1.3) thor (>= 1.0.1, < 1.3) @@ -89,12 +89,10 @@ GEM net-http-persistent (>= 4.0.4, < 5) fast_gettext (2.4.0) prime - ffi (1.16.3) - ffi-win32-extensions (1.0.4) - ffi + ffi (1.17.0-arm64-darwin) forwardable (1.3.3) getoptlong (0.2.1) - gettext (3.5.0) + gettext (3.5.1) erubi locale (>= 2.0.5) prime @@ -112,7 +110,7 @@ GEM hiera-eyaml (3.4.0) highline optimist - highline (3.1.1) + highline (3.1.2) reline hocon (1.4.0) http-accept (1.7.0) @@ -126,7 +124,7 @@ GEM json-schema (5.1.1) addressable (~> 2.8) bigdecimal (~> 3.1) - jwt (2.9.3) + jwt (2.10.1) base64 kitchen-docker (3.0.0) test-kitchen (>= 1.0.0) @@ -151,11 +149,11 @@ GEM little-plugger (1.1.4) locale (2.1.4) log4r (1.1.10) - logger (1.6.4) + logger (1.6.5) logging (2.4.0) little-plugger (~> 1.1) multi_json (~> 1.14) - metadata-json-lint (4.1.0) + metadata-json-lint (4.2.0) json-schema (>= 2.8, < 6.0) semantic_puppet (~> 1.0) spdx-licenses (~> 1.0) @@ -163,17 +161,13 @@ GEM mime-types (3.6.0) logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.1203) + mime-types-data (3.2025.0107) minitar (0.12.1) mixlib-install (3.12.30) mixlib-shellout mixlib-versioning thor - mixlib-shellout (3.3.4-universal-mingw32) - chef-utils - ffi-win32-extensions (~> 1.0.3) - win32-process (~> 0.9) - wmi-lite (~> 1.0) + mixlib-shellout (2.2.7) mixlib-versioning (1.2.12) mocha (2.7.1) ruby2_keywords (>= 0.0.5) @@ -183,7 +177,7 @@ GEM uri net-http-persistent (4.0.5) connection_pool (~> 2.2) - net-scp (4.0.0) + net-scp (4.1.0) net-ssh (>= 2.6.5, < 8.0.0) net-ssh (7.3.0) net-ssh-gateway (2.0.0) @@ -202,7 +196,7 @@ GEM parallel (1.26.3) parallel_tests (3.12.1) parallel - parser (3.3.6.0) + parser (3.3.7.0) ast (~> 2.4.1) racc pastel (0.8.0) @@ -212,19 +206,29 @@ GEM prime (0.1.3) forwardable singleton - pry (0.15.0) + pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) public_suffix (6.0.1) - puppet (8.10.0-x64-mingw32) + puppet (8.10.0) + concurrent-ruby (~> 1.0) + deep_merge (~> 1.0) + facter (>= 4.3.0, < 5) + fast_gettext (>= 2.1, < 4) + getoptlong (~> 0.2.0) + locale (~> 2.1) + multi_json (~> 1.13) + puppet-resource_api (~> 1.5) + scanf (~> 1.0) + semantic_puppet (~> 1.0) + puppet (8.10.0-universal-darwin) + CFPropertyList (>= 3.0.6, < 4) concurrent-ruby (~> 1.0) deep_merge (~> 1.0) facter (>= 4.3.0, < 5) fast_gettext (>= 2.1, < 4) - ffi (>= 1.15.5, < 1.17.0, != 1.16.2, != 1.16.1, != 1.16.0) getoptlong (~> 0.2.0) locale (~> 2.1) - minitar (~> 0.9) multi_json (~> 1.13) puppet-resource_api (~> 1.5) scanf (~> 1.0) @@ -323,18 +327,17 @@ GEM rainbow (3.1.1) rake (13.2.1) rb-readline (0.5.5) - regexp_parser (2.9.3) + regexp_parser (2.10.0) reline (0.6.0) io-console (~> 0.5) - rest-client (2.1.0-x64-mingw32) - ffi (~> 1.9) + rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) retryable (3.0.5) rexml (3.2.6) - rgen (0.9.1) + rgen (0.10.2) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -371,7 +374,7 @@ GEM rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.37.0) + rubocop-ast (1.38.0) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) @@ -389,9 +392,9 @@ GEM windows_error rubyntlm (0.6.5) base64 - rubyzip (2.3.2) + rubyzip (2.4.1) scanf (1.0.0) - semantic_puppet (1.1.0) + semantic_puppet (1.1.1) serverspec (2.42.3) multi_json rspec (~> 3.0) @@ -482,8 +485,6 @@ GEM puppet-lint-unquoted_string-check (~> 3.0) puppet-lint-variable_contains_upcase (~> 2.0) puppet-lint-version_comparison-check (~> 2.0) - win32-process (0.10.0) - ffi (>= 1.0.0) windows_error (0.1.5) winrm (2.3.9) builder (>= 2.1.2) @@ -505,10 +506,11 @@ GEM rubyzip (~> 2.0) winrm (~> 2.0) wisper (2.0.1) - wmi-lite (1.0.7) yard (0.9.36) PLATFORMS + arm64-darwin-22 + arm64-darwin-24 x64-mingw32 DEPENDENCIES diff --git a/lib/puppet/reports/datadog_reports.rb b/lib/puppet/reports/datadog_reports.rb index 75aefea2e..b33de9597 100644 --- a/lib/puppet/reports/datadog_reports.rb +++ b/lib/puppet/reports/datadog_reports.rb @@ -127,7 +127,7 @@ def process Puppet.debug "Sending metrics for #{@msg_host} to Datadog" @dog.batch_metrics do metrics.each do |metric, data| - data.values.each do |val| + data.each_value do |val| name = "puppet.#{val[1].tr(' ', '_')}.#{metric}".downcase value = val[2] @dog.emit_point(name.to_s, value, host: @msg_host.to_s) diff --git a/manifests/install_integration.pp b/manifests/install_integration.pp index ad70085dd..664064d3e 100644 --- a/manifests/install_integration.pp +++ b/manifests/install_integration.pp @@ -1,3 +1,7 @@ +# Define: datadog_agent::install_integration +# +# Definition to install an agent integration +# define datadog_agent::install_integration ( Enum['present', 'absent'] $ensure = 'present', String $integration_name = undef, diff --git a/manifests/integration.pp b/manifests/integration.pp index 4a7bf9dce..ac98ab10a 100644 --- a/manifests/integration.pp +++ b/manifests/integration.pp @@ -1,3 +1,7 @@ +# Define: datadog_agent::integration +# +# Definition for an agent integration +# define datadog_agent::integration ( Array $instances = [], Optional[Hash] $init_config = undef, diff --git a/manifests/integrations/directory.pp b/manifests/integrations/directory.pp index 0a50ae8b5..87f680b0e 100644 --- a/manifests/integrations/directory.pp +++ b/manifests/integrations/directory.pp @@ -53,7 +53,6 @@ # }, # ] # } - class datadog_agent::integrations::directory ( String $directory = '', Boolean $filegauges = false, diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index 940aea26f..5e6e8fe87 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -165,7 +165,6 @@ # 'tags' => ['production', 'wordpress'] # }] # } - class datadog_agent::integrations::http_check ( String $sitename = undef, String $url = undef, diff --git a/manifests/integrations/linux_proc_extras.pp b/manifests/integrations/linux_proc_extras.pp index 13d2fbae4..b9d848b19 100644 --- a/manifests/integrations/linux_proc_extras.pp +++ b/manifests/integrations/linux_proc_extras.pp @@ -12,7 +12,6 @@ # class { 'datadog_agent::integrations::linux_proc_extras': # tags => [ 'env:production' ], # } - class datadog_agent::integrations::linux_proc_extras ( Array $tags = [], ) inherits datadog_agent::params { diff --git a/manifests/integrations/logs.pp b/manifests/integrations/logs.pp index a7d7bfff5..d40a5fcb7 100644 --- a/manifests/integrations/logs.pp +++ b/manifests/integrations/logs.pp @@ -35,7 +35,6 @@ # Documentation: # https://docs.datadoghq.com/logs/log_collection # - class datadog_agent::integrations::logs ( Array $logs = [], ) inherits datadog_agent::params { diff --git a/manifests/integrations/nginx.pp b/manifests/integrations/nginx.pp index e97e776b4..d870ec3cd 100644 --- a/manifests/integrations/nginx.pp +++ b/manifests/integrations/nginx.pp @@ -58,7 +58,6 @@ # source: nginx # sourcecategory: 'http_web_access' # - class datadog_agent::integrations::nginx ( Array $instances = [], Optional[Array] $logs = undef, diff --git a/manifests/integrations/ntp.pp b/manifests/integrations/ntp.pp index 31f3509e2..280731eef 100644 --- a/manifests/integrations/ntp.pp +++ b/manifests/integrations/ntp.pp @@ -22,7 +22,6 @@ # host => 'pool.ntp.org', # } # - class datadog_agent::integrations::ntp ( Integer $offset_threshold = 60, String $host = undef, diff --git a/manifests/integrations/oom_kill.pp b/manifests/integrations/oom_kill.pp index ac4d6e323..5167d7640 100644 --- a/manifests/integrations/oom_kill.pp +++ b/manifests/integrations/oom_kill.pp @@ -18,7 +18,6 @@ # ], # } # - class datadog_agent::integrations::oom_kill ( Array $instances = [], ) inherits datadog_agent::params { diff --git a/manifests/integrations/php_fpm.pp b/manifests/integrations/php_fpm.pp index 31a9d65e6..2860f42a4 100644 --- a/manifests/integrations/php_fpm.pp +++ b/manifests/integrations/php_fpm.pp @@ -25,7 +25,6 @@ # ping_url => 'http://localhost/fpm_ping' # } # - class datadog_agent::integrations::php_fpm ( String $status_url = 'http://localhost/status', String $ping_url = 'http://localhost/ping', diff --git a/manifests/integrations/rabbitmq.pp b/manifests/integrations/rabbitmq.pp index 009e3b5e0..d0451611d 100644 --- a/manifests/integrations/rabbitmq.pp +++ b/manifests/integrations/rabbitmq.pp @@ -49,7 +49,6 @@ # password => 'guest', # } # - class datadog_agent::integrations::rabbitmq ( Optional[String] $url = undef, String $username = 'guest', diff --git a/manifests/integrations/snmp.pp b/manifests/integrations/snmp.pp index b8db406a0..078e1337f 100755 --- a/manifests/integrations/snmp.pp +++ b/manifests/integrations/snmp.pp @@ -49,7 +49,6 @@ # } # ], # } - class datadog_agent::integrations::snmp ( Any $mibs_folder = undef, Boolean $ignore_nonincreasing_oid = false, diff --git a/manifests/integrations/ssh.pp b/manifests/integrations/ssh.pp index 34db2202c..537e51f24 100644 --- a/manifests/integrations/ssh.pp +++ b/manifests/integrations/ssh.pp @@ -25,7 +25,6 @@ # private_key_file => '/opt/super_secret_key', # } # - class datadog_agent::integrations::ssh ( String $host = $trusted['certname'], Integer $port = 22, diff --git a/manifests/integrations/supervisord.pp b/manifests/integrations/supervisord.pp index 78353d042..2bfe91c1b 100644 --- a/manifests/integrations/supervisord.pp +++ b/manifests/integrations/supervisord.pp @@ -40,7 +40,6 @@ # # # - class datadog_agent::integrations::supervisord ( Array $instances = [{ 'servername' => 'server0', 'hostname' => 'localhost', 'port' => '9001' }], ) inherits datadog_agent::params { diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index b85ae9492..0027bdbb0 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -83,7 +83,6 @@ # 'port' => '443', # }] # } - class datadog_agent::integrations::tcp_check ( String $check_name = undef, String $host = undef, diff --git a/manifests/params.pp b/manifests/params.pp index 4dc51c67e..50ff4d2ae 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -2,7 +2,6 @@ # # This class contains the parameters for the Datadog module # - class datadog_agent::params { $datadog_site = 'datadoghq.com' $dd_groups = undef diff --git a/manifests/redhat.pp b/manifests/redhat.pp index b08d0c238..6a142dad9 100644 --- a/manifests/redhat.pp +++ b/manifests/redhat.pp @@ -2,7 +2,6 @@ # # This class contains the DataDog agent installation mechanism for Red Hat derivatives # - class datadog_agent::redhat ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, Optional[String] $agent_repo_uri = undef, diff --git a/manifests/security_agent.pp b/manifests/security_agent.pp index 9e0ed4e5e..d272ade66 100644 --- a/manifests/security_agent.pp +++ b/manifests/security_agent.pp @@ -1,3 +1,7 @@ +# Class: datadog_agent::security_agent +# +# This class defines the Datadog Security Agent configuration. +# class datadog_agent::security_agent ( Boolean $enabled = false, Optional[String] $socket = undef, diff --git a/manifests/service.pp b/manifests/service.pp index 96af7d989..d0102d108 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -2,7 +2,6 @@ # # This class declares the datadog-agent service # - class datadog_agent::service ( String $service_ensure = 'running', Variant[Boolean, Enum['manual', 'mask', 'delayed']] $service_enable = true, diff --git a/manifests/suse.pp b/manifests/suse.pp index 58d1b2075..ae9f51d6f 100644 --- a/manifests/suse.pp +++ b/manifests/suse.pp @@ -2,7 +2,6 @@ # # This class contains the DataDog agent installation mechanism for SUSE distributions # - class datadog_agent::suse ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, String $agent_version = $datadog_agent::params::agent_version, diff --git a/manifests/system_probe.pp b/manifests/system_probe.pp index 88a157c84..9e0bcc128 100644 --- a/manifests/system_probe.pp +++ b/manifests/system_probe.pp @@ -4,7 +4,6 @@ # On Windows, install the NPM driver by setting 'windows_npm_install' # to 'true on the datadog_agent class. # - class datadog_agent::system_probe ( Boolean $enabled = false, Boolean $network_enabled = false, diff --git a/manifests/ubuntu.pp b/manifests/ubuntu.pp index 483fd3ca7..073f8f33c 100644 --- a/manifests/ubuntu.pp +++ b/manifests/ubuntu.pp @@ -2,7 +2,6 @@ # # This class contains the DataDog agent installation mechanism for Debian derivatives # - class datadog_agent::ubuntu ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, String $agent_version = $datadog_agent::params::agent_version, diff --git a/manifests/windows.pp b/manifests/windows.pp index 078647270..488b605bb 100644 --- a/manifests/windows.pp +++ b/manifests/windows.pp @@ -2,7 +2,6 @@ # # This class contains the DataDog agent installation mechanism for Windows # - class datadog_agent::windows ( Integer $agent_major_version = $datadog_agent::params::default_agent_major_version, String $agent_version = $datadog_agent::params::agent_version, diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cb40a30fd..f51f1b1d3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -18,23 +18,23 @@ if RSpec::Support::OS.windows? ALL_OS = WINDOWS_OS ALL_SUPPORTED_AGENTS = [6, 7].freeze - CONF_DIR = 'C:/ProgramData/Datadog/conf.d'.freeze - DD_USER = 'ddagentuser'.freeze - DD_GROUP = 'S-1-5-32-544'.freeze - SERVICE_NAME = 'datadogagent'.freeze - PACKAGE_NAME = 'Datadog Agent'.freeze - PERMISSIONS_FILE = '0664'.freeze - PERMISSIONS_PROTECTED_FILE = '0660'.freeze + CONF_DIR = 'C:/ProgramData/Datadog/conf.d' + DD_USER = 'ddagentuser' + DD_GROUP = 'S-1-5-32-544' + SERVICE_NAME = 'datadogagent' + PACKAGE_NAME = 'Datadog Agent' + PERMISSIONS_FILE = '0664' + PERMISSIONS_PROTECTED_FILE = '0660' else ALL_OS = DEBIAN_OS + REDHAT_OS ALL_SUPPORTED_AGENTS = [5, 6, 7].freeze - CONF_DIR = '/etc/datadog-agent/conf.d'.freeze - DD_USER = 'dd-agent'.freeze - DD_GROUP = 'dd-agent'.freeze - SERVICE_NAME = 'datadog-agent'.freeze - PACKAGE_NAME = 'datadog-agent'.freeze - PERMISSIONS_FILE = '0644'.freeze - PERMISSIONS_PROTECTED_FILE = '0600'.freeze + CONF_DIR = '/etc/datadog-agent/conf.d' + DD_USER = 'dd-agent' + DD_GROUP = 'dd-agent' + SERVICE_NAME = 'datadog-agent' + PACKAGE_NAME = 'datadog-agent' + PERMISSIONS_FILE = '0644' + PERMISSIONS_PROTECTED_FILE = '0600' end def min_puppet_version(version) From 3c260f0fadf4e42fa2307f9041cb823c3027f30f Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 20:55:53 +0000 Subject: [PATCH 022/133] made sitename required --- manifests/integrations/http_check.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index d423d69b8..b7070da5f 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -166,7 +166,7 @@ # }] # } class datadog_agent::integrations::http_check ( - Optional[String] $sitename = undef, + String $sitename, Optional[String] $url = undef, Optional[String] $username = undef, Optional[Any] $password = undef, From 526174ead6e62cf75cf4bdc376dd477dd396aab6 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 20:56:23 +0000 Subject: [PATCH 023/133] making url required. --- manifests/integrations/http_check.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index b7070da5f..179d2df6d 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -167,7 +167,7 @@ # } class datadog_agent::integrations::http_check ( String $sitename, - Optional[String] $url = undef, + String $url, Optional[String] $username = undef, Optional[Any] $password = undef, Integer $timeout = 1, From 896f7d2c6daa4cc56e195ab3c46d32afd65e248c Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 20:57:43 +0000 Subject: [PATCH 024/133] correcting default on min collection interval --- manifests/integrations/http_check.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index 179d2df6d..e9a37fd65 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -172,7 +172,7 @@ Optional[Any] $password = undef, Integer $timeout = 1, String $method = 'get', - Optional[Integer] $min_collection_interval = undef, + Integer $min_collection_interval = 15, Optional[Any] $data = undef, Optional[Integer] $threshold = undef, Optional[Integer] $window = undef, From c1f6034b8a74c33521ab7652fd574f9fb74d36e5 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 21:01:41 +0000 Subject: [PATCH 025/133] making check name required. --- manifests/integrations/tcp_check.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index 92ca996b8..e6de68c19 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -84,7 +84,7 @@ # }] # } class datadog_agent::integrations::tcp_check ( - Optional[String] $check_name = undef, + String $check_name, Optional[String] $host = undef, Optional[String] $port = undef, Integer $timeout = 10, From be91e8f0e53801d5dfff39ac683feb8a0edabfcb Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 21:02:20 +0000 Subject: [PATCH 026/133] making host required --- manifests/integrations/tcp_check.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index e6de68c19..675c164cc 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -85,7 +85,7 @@ # } class datadog_agent::integrations::tcp_check ( String $check_name, - Optional[String] $host = undef, + String $host, Optional[String] $port = undef, Integer $timeout = 10, Optional[Integer] $threshold = undef, From c49198ae1185ed18e66847007ef471afc09ac274 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 28 Jan 2025 21:03:42 +0000 Subject: [PATCH 027/133] making port required --- manifests/integrations/tcp_check.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index 675c164cc..6a9f798eb 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -86,7 +86,7 @@ class datadog_agent::integrations::tcp_check ( String $check_name, String $host, - Optional[String] $port = undef, + String $port, Integer $timeout = 10, Optional[Integer] $threshold = undef, Optional[Integer] $window = undef, From cc59363d1c01e253a89a22e46b9ca4b015470481 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 28 Jan 2025 16:24:32 -0500 Subject: [PATCH 028/133] fix gemfile for ruby < 3.1 and puppet 7; bump bundler to v2.4.13 in CI --- .circleci/config.yml | 254 +++++++++++++++++++++---------------------- CONTRIBUTING.md | 5 +- Gemfile | 8 +- Gemfile.lock | 77 ++++++------- kitchen.yml | 8 +- 5 files changed, 173 insertions(+), 179 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f4280c6a..500157115 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,39 +10,39 @@ jobs: RUBY_VERSION: '2.1.9' PUPPET_VERSION: '4.6.2' steps: - # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - - run: - name: Fix git clones - command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig - - checkout - - run: - name: Install RVM - command: | - gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB - \curl -sSL https://get.rvm.io | bash -s stable - - run: - name: Install old libssl1.0-dev - command: | - ruby_major=$(echo $RUBY_VERSION | awk -F. '{ print $1 }') - ruby_minor=$(echo $RUBY_VERSION | awk -F. '{ print $2 }') - # We need libssl1.0-dev to even compile Ruby <= 2.3 with RVM; - if [ $ruby_major -eq "2" ] && [ $ruby_minor -le "3" ]; then - sudo bash -c "echo deb http://security.ubuntu.com/ubuntu bionic-security main >> /etc/apt/sources.list" - sudo apt update && apt-cache policy libssl1.0-dev - sudo apt install -y libssl1.0-dev - fi - - run: - name: Install Ruby version - command: rvm install $RUBY_VERSION - - run: - name: Install bundler - command: rvm $RUBY_VERSION --verbose do gem install bundler:1.17.3 - - run: - name: Install gem dependencies - command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle install --path .bundle - - run: - name: Run tests - command: rvm $RUBY_VERSION --verbose do bundle exec rake test + # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ + - run: + name: Fix git clones + command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - checkout + - run: + name: Install RVM + command: | + gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB + \curl -sSL https://get.rvm.io | bash -s stable + - run: + name: Install old libssl1.0-dev + command: | + ruby_major=$(echo $RUBY_VERSION | awk -F. '{ print $1 }') + ruby_minor=$(echo $RUBY_VERSION | awk -F. '{ print $2 }') + # We need libssl1.0-dev to even compile Ruby <= 2.3 with RVM; + if [ $ruby_major -eq "2" ] && [ $ruby_minor -le "3" ]; then + sudo bash -c "echo deb http://security.ubuntu.com/ubuntu bionic-security main >> /etc/apt/sources.list" + sudo apt update && apt-cache policy libssl1.0-dev + sudo apt install -y libssl1.0-dev + fi + - run: + name: Install Ruby version + command: rvm install $RUBY_VERSION + - run: + name: Install bundler + command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 + - run: + name: Install gem dependencies + command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle install --path .bundle + - run: + name: Run tests + command: rvm $RUBY_VERSION --verbose do bundle exec rake test specs-ruby21-puppet410: <<: *specs @@ -271,23 +271,23 @@ jobs: name: win/default # Comes with ruby 2.6, which is not supported on Windows as of puppet 6.10.1 shell: bash.exe steps: - # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - - run: - name: Fix git clones - command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig - - checkout - - run: - name: Run tests - command: | - set -e - choco install ruby --allow-downgrade -y --version 2.5.3.101 # Keep version in sync with next command! - export PATH=/c/tools/ruby25/bin:$PATH # Make Ruby 2.5 take precedence over the pre-installed 2.6 - ruby --version - choco install msys2 --allow-downgrade -y --version 20210604.0.0 - ridk.cmd exec pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain - gem install bundler -v 1.17.3 - rm Gemfile.lock && bundle install --path .bundle - bundle exec rake test + # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ + - run: + name: Fix git clones + command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - checkout + - run: + name: Run tests + command: | + set -e + choco install ruby --allow-downgrade -y --version 2.5.3.101 # Keep version in sync with next command! + export PATH=/c/tools/ruby25/bin:$PATH # Make Ruby 2.5 take precedence over the pre-installed 2.6 + ruby --version + choco install msys2 --allow-downgrade -y --version 20210604.0.0 + ridk.cmd exec pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain + gem install bundler -v 2.4.13 + rm Gemfile.lock && bundle install --path .bundle + bundle exec rake test environment: STRICT_VARIABLES: 'yes' #RUBY_VERSION hardcoded in install script @@ -300,28 +300,28 @@ jobs: STRICT_VARIABLES: 'yes' RUBY_VERSION: '2.5.3' steps: - # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - - run: - name: Fix git clones - command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig - - checkout - - run: - name: Install RVM - command: | - gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB - \curl -sSL https://get.rvm.io | bash -s stable - - run: - name: Install Ruby versions - command: rvm install $RUBY_VERSION - - run: - name: Install bundler - command: rvm $RUBY_VERSION --verbose do gem install bundler:1.17.3 - - run: - name: Install gem dependencies - command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle - - run: - name: Run tests - command: rvm $RUBY_VERSION --verbose do bundle exec rake test + # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ + - run: + name: Fix git clones + command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - checkout + - run: + name: Install RVM + command: | + gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB + \curl -sSL https://get.rvm.io | bash -s stable + - run: + name: Install Ruby versions + command: rvm install $RUBY_VERSION + - run: + name: Install bundler + command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 + - run: + name: Install gem dependencies + command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle + - run: + name: Run tests + command: rvm $RUBY_VERSION --verbose do bundle exec rake test kitchen-tests: machine: @@ -330,63 +330,63 @@ jobs: STRICT_VARIABLES: 'yes' RUBY_VERSION: '2.5.3' steps: - # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - - run: - name: Fix git clones - command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig - - checkout - - run: - name: Install RVM - command: | - gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB - \curl -sSL https://get.rvm.io | bash -s stable - - run: - name: Install Ruby versions - command: rvm install $RUBY_VERSION - - run: - name: Install bundler - command: rvm $RUBY_VERSION --verbose do gem install bundler:1.17.3 - - run: - name: Install gem dependencies - command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle - - run: - name: Execute Kitchen tests - command: rvm $RUBY_VERSION --verbose do bundle exec rake circle - no_output_timeout: 900 + # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ + - run: + name: Fix git clones + command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - checkout + - run: + name: Install RVM + command: | + gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB + \curl -sSL https://get.rvm.io | bash -s stable + - run: + name: Install Ruby versions + command: rvm install $RUBY_VERSION + - run: + name: Install bundler + command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 + - run: + name: Install gem dependencies + command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle + - run: + name: Execute Kitchen tests + command: rvm $RUBY_VERSION --verbose do bundle exec rake circle + no_output_timeout: 900 workflows: version: 2 build_and_test: jobs: - - specs-ruby21-puppet46 - - specs-ruby21-puppet410 - - specs-ruby21-puppet50 - - specs-ruby21-puppet53 - - specs-ruby22-puppet46 - - specs-ruby22-puppet410 - - specs-ruby22-puppet50 - - specs-ruby22-puppet53 - - specs-ruby23-puppet46 - - specs-ruby23-puppet410 - - specs-ruby23-puppet50 - - specs-ruby23-puppet53 - - specs-ruby23-puppet60 - - specs-ruby23-puppet65 - - specs-ruby24-puppet410 - - specs-ruby24-puppet50 - - specs-ruby24-puppet53 - - specs-ruby24-puppet60 - - specs-ruby24-puppet65 - - specs-ruby25-puppet410 - - specs-ruby25-puppet50 - - specs-ruby25-puppet53 - - specs-ruby25-puppet60 - - specs-ruby25-puppet65 - - specs-ruby25-puppet65-windows - - specs-ruby26-puppet60 - - specs-ruby26-puppet65 - - specs-ruby26-puppet79 - - specs-ruby26-puppet714 - - specs-ruby26-puppet725 - - verify-gemfile-lock-dependencies - - kitchen-tests + - specs-ruby21-puppet46 + - specs-ruby21-puppet410 + - specs-ruby21-puppet50 + - specs-ruby21-puppet53 + - specs-ruby22-puppet46 + - specs-ruby22-puppet410 + - specs-ruby22-puppet50 + - specs-ruby22-puppet53 + - specs-ruby23-puppet46 + - specs-ruby23-puppet410 + - specs-ruby23-puppet50 + - specs-ruby23-puppet53 + - specs-ruby23-puppet60 + - specs-ruby23-puppet65 + - specs-ruby24-puppet410 + - specs-ruby24-puppet50 + - specs-ruby24-puppet53 + - specs-ruby24-puppet60 + - specs-ruby24-puppet65 + - specs-ruby25-puppet410 + - specs-ruby25-puppet50 + - specs-ruby25-puppet53 + - specs-ruby25-puppet60 + - specs-ruby25-puppet65 + - specs-ruby25-puppet65-windows + - specs-ruby26-puppet60 + - specs-ruby26-puppet65 + - specs-ruby26-puppet79 + - specs-ruby26-puppet714 + - specs-ruby26-puppet725 + - verify-gemfile-lock-dependencies + - kitchen-tests diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 057fd29ae..14230bbbb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,8 +18,9 @@ cd puppet-datadog-agent First, to install the Ruby dependencies run: ```bash -gem install bundler:1.17.3 -bundle install --path .bundle +gem install bundler:2.4.13 +bundle config set --local path '.bundle' +bundle install ``` Afterwards, on the first run of the tests, further dependencies will be installed. diff --git a/Gemfile b/Gemfile index 980c57a18..b0d51caf1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' +ruby_version = Gem::Version.new(RUBY_VERSION.dup) + def location_for(place_or_version, fake_version = nil) git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} file_url_regex = %r{\Afile:\/\/(?.*)} @@ -42,7 +44,11 @@ group :development do gem "kitchen-verifier-serverspec" gem "rexml", '>= 3.0.0', '< 3.2.7', require: false gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] - gem "test-kitchen", '~> 3.7.0' + if ruby_version >= Gem::Version.new('2.7') && ruby_version < Gem::Version.new('3.1') + gem "test-kitchen", '~> 3.4.0', platforms: [:ruby] + else + gem "test-kitchen", '~> 3.7.0' + end end group :development, :release_prep do gem "puppet-strings", '~> 4.0', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 5db49b9e4..6e0656894 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,13 +15,14 @@ GEM aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-ec2 (1.502.0) + aws-sdk-ec2 (1.503.0) aws-sdk-core (~> 3, >= 3.216.0) aws-sigv4 (~> 1.5) aws-sigv4 (1.11.0) aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcrypt_pbkdf (1.0.1) + bcrypt_pbkdf (1.0.1-x64-mingw32) bigdecimal (3.1.9) bindata (2.5.0) bolt (4.0.0) @@ -76,22 +77,21 @@ GEM facterdb (2.1.0) facter (< 5.0.0) jgrep (~> 1.5, >= 1.5.4) - faraday (2.12.2) - faraday-net_http (>= 2.0, < 3.5) - json - logger + faraday (2.8.1) + base64 + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) - faraday-net_http (3.4.0) - net-http (>= 0.5.0) + faraday-net_http (3.0.2) faraday-net_http_persistent (2.3.0) faraday (~> 2.5) net-http-persistent (>= 4.0.4, < 5) fast_gettext (2.4.0) prime - ffi (1.17.0-arm64-darwin) + ffi (1.17.1-arm64-darwin) + ffi (1.17.1-x64-mingw32) forwardable (1.3.3) - getoptlong (0.2.1) gettext (3.5.1) erubi locale (>= 2.0.5) @@ -107,11 +107,11 @@ GEM gyoku (1.4.0) builder (>= 2.1.2) rexml (~> 3.0) + hiera (3.12.0) hiera-eyaml (3.4.0) highline optimist - highline (3.1.2) - reline + highline (2.1.0) hocon (1.4.0) http-accept (1.7.0) http-cookie (1.0.8) @@ -173,8 +173,6 @@ GEM ruby2_keywords (>= 0.0.5) molinillo (0.8.0) multi_json (1.15.0) - net-http (0.6.0) - uri net-http-persistent (4.0.5) connection_pool (~> 2.2) net-scp (4.1.0) @@ -187,8 +185,7 @@ GEM net-ssh (>= 2.0) net-telnet (0.2.0) netrc (0.11.0) - nori (2.7.1) - bigdecimal + nori (2.6.0) optimist (3.2.0) orchestrator_client (0.7.1) faraday (>= 1.4, < 3.0) @@ -201,7 +198,7 @@ GEM racc pastel (0.8.0) tty-color (~> 0.5) - pathspec (2.1.0) + pathspec (1.1.3) pluginator (1.5.0) prime (0.1.3) forwardable @@ -209,27 +206,15 @@ GEM pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (6.0.1) - puppet (8.10.0) - concurrent-ruby (~> 1.0) - deep_merge (~> 1.0) - facter (>= 4.3.0, < 5) - fast_gettext (>= 2.1, < 4) - getoptlong (~> 0.2.0) - locale (~> 2.1) - multi_json (~> 1.13) - puppet-resource_api (~> 1.5) - scanf (~> 1.0) - semantic_puppet (~> 1.0) - puppet (8.10.0-universal-darwin) - CFPropertyList (>= 3.0.6, < 4) + public_suffix (5.1.1) + puppet (7.34.0) concurrent-ruby (~> 1.0) deep_merge (~> 1.0) - facter (>= 4.3.0, < 5) - fast_gettext (>= 2.1, < 4) - getoptlong (~> 0.2.0) + facter (> 2.0.1, < 5) + fast_gettext (>= 1.1, < 3) + hiera (>= 3.2.1, < 4) locale (~> 2.1) - multi_json (~> 1.13) + multi_json (~> 1.10) puppet-resource_api (~> 1.5) scanf (~> 1.0) semantic_puppet (~> 1.0) @@ -323,18 +308,22 @@ GEM minitar (~> 0.9) multi_json (~> 1.10) puppet_forge (>= 4.1, < 6) - racc (1.8.1) + racc (1.4.16) rainbow (3.1.1) rake (13.2.1) rb-readline (0.5.5) regexp_parser (2.10.0) - reline (0.6.0) - io-console (~> 0.5) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + rest-client (2.1.0-x64-mingw32) + ffi (~> 1.9) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) retryable (3.0.5) rexml (3.2.6) rgen (0.10.2) @@ -349,9 +338,9 @@ GEM rspec-support (~> 3.13.0) rspec-github (2.4.0) rspec-core (~> 3.0) - rspec-its (2.0.0) - rspec-core (>= 3.13.0) - rspec-expectations (>= 3.13.0) + rspec-its (1.3.1) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) @@ -465,7 +454,6 @@ GEM tty-cursor (~> 0.7) unicode-display_width (2.6.0) unicode_utils (1.4.0) - uri (1.0.2) voxpupuli-puppet-lint-plugins (5.0.0) puppet-lint (~> 4.0) puppet-lint-absolute_classname-check (~> 4.0) @@ -486,15 +474,14 @@ GEM puppet-lint-variable_contains_upcase (~> 2.0) puppet-lint-version_comparison-check (~> 2.0) windows_error (0.1.5) - winrm (2.3.9) + winrm (2.3.6) builder (>= 2.1.2) erubi (~> 1.8) gssapi (~> 1.2) gyoku (~> 1.0) httpclient (~> 2.2, >= 2.2.0.2) logging (>= 1.6.1, < 3.0) - nori (~> 2.0, >= 2.7.1) - rexml (~> 3.0) + nori (~> 2.0) rubyntlm (~> 0.6.0, >= 0.6.3) winrm-elevated (1.2.3) erubi (~> 1.8) @@ -529,7 +516,7 @@ DEPENDENCIES mixlib-shellout (~> 2.2.7) parallel_tests (= 3.12.1) pry (~> 0.10) - puppet (= 8.10.0) + puppet puppet-blacksmith (~> 7.0) puppet-debugger (~> 1.0) puppet-strings (~> 4.0) diff --git a/kitchen.yml b/kitchen.yml index bcee3051d..596955d08 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -29,7 +29,7 @@ platforms: - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - gem install bundler -v '= 1.17.3' + - gem install bundler -v '= 2.4.13' # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post - cd /home && bundle install - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules @@ -50,7 +50,7 @@ platforms: - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - gem install bundler -v '= 1.17.3' + - gem install bundler -v '= 2.4.13' - cd /home && bundle install - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules @@ -72,7 +72,7 @@ platforms: - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - gem install bundler -v '= 1.17.3' + - gem install bundler -v '= 2.4.13' - cd /home && bundle install - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules @@ -90,7 +90,7 @@ 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 -v '= 1.17.3' + - gem install bundler -v '= 2.4.13' - gem install net-ssh -v '= 6.1.0' - gem install rspec-its -v '= 1.3.1' - gem install serverspec rspec From 56efc7f9ecfcbe0d95ff87b989d6a689ce36d32a Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Wed, 29 Jan 2025 13:32:59 -0500 Subject: [PATCH 029/133] update deps --- Gemfile.lock | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6e0656894..305f378d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -22,7 +22,6 @@ GEM aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcrypt_pbkdf (1.0.1) - bcrypt_pbkdf (1.0.1-x64-mingw32) bigdecimal (3.1.9) bindata (2.5.0) bolt (4.0.0) @@ -90,7 +89,6 @@ GEM fast_gettext (2.4.0) prime ffi (1.17.1-arm64-darwin) - ffi (1.17.1-x64-mingw32) forwardable (1.3.3) gettext (3.5.1) erubi @@ -120,7 +118,7 @@ GEM io-console (0.7.2) jgrep (1.5.4) jmespath (1.6.2) - json (2.6.3) + json (2.3.0) json-schema (5.1.1) addressable (~> 2.8) bigdecimal (~> 3.1) @@ -318,12 +316,6 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rest-client (2.1.0-x64-mingw32) - ffi (~> 1.9) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) retryable (3.0.5) rexml (3.2.6) rgen (0.10.2) @@ -416,7 +408,7 @@ GEM table_print (1.5.7) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - test-kitchen (3.7.0) + test-kitchen (3.4.0) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) ed25519 (~> 1.2) @@ -507,7 +499,7 @@ DEPENDENCIES dependency_checker (~> 1.0.0) facterdb (~> 2.1) io-console (= 0.7.2) - json (= 2.6.3) + json (= 2.3.0) kitchen-docker kitchen-puppet kitchen-verifier-serverspec @@ -516,12 +508,13 @@ DEPENDENCIES mixlib-shellout (~> 2.2.7) parallel_tests (= 3.12.1) pry (~> 0.10) - puppet + puppet (= 7.34.0) puppet-blacksmith (~> 7.0) puppet-debugger (~> 1.0) puppet-strings (~> 4.0) puppet_litmus (~> 1.0) puppetlabs_spec_helper (~> 8.0) + racc (~> 1.4.0) rb-readline (= 0.5.5) rexml (>= 3.0.0, < 3.2.7) rspec-puppet-facts (~> 4.0) @@ -530,7 +523,7 @@ DEPENDENCIES rubocop-rspec (= 2.19.0) serverspec (~> 2.41) simplecov-console (~> 0.9) - test-kitchen (~> 3.7.0) + test-kitchen (~> 3.4.0) voxpupuli-puppet-lint-plugins (~> 5.0) BUNDLED WITH From bd64797fb85612786779f9a678ca715fb03bf9a6 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Wed, 29 Jan 2025 13:53:18 -0500 Subject: [PATCH 030/133] exclude EOL versions from CI --- .circleci/config.yml | 386 +++++++++++++++++++++++-------------------- 1 file changed, 211 insertions(+), 175 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 500157115..fde5c5e09 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,13 +2,147 @@ version: 2.1 orbs: win: circleci/windows@2.2.0 jobs: - specs-ruby21-puppet46: &specs + # specs-ruby21-puppet46: &specs + # machine: + # image: ubuntu-2004:2024.08.1 + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.1.9' + # PUPPET_VERSION: '4.6.2' + # steps: + # # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ + # - run: + # name: Fix git clones + # command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + # - checkout + # - run: + # name: Install RVM + # command: | + # gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB + # \curl -sSL https://get.rvm.io | bash -s stable + # - run: + # name: Install old libssl1.0-dev + # command: | + # ruby_major=$(echo $RUBY_VERSION | awk -F. '{ print $1 }') + # ruby_minor=$(echo $RUBY_VERSION | awk -F. '{ print $2 }') + # # We need libssl1.0-dev to even compile Ruby <= 2.3 with RVM; + # if [ $ruby_major -eq "2" ] && [ $ruby_minor -le "3" ]; then + # sudo bash -c "echo deb http://security.ubuntu.com/ubuntu bionic-security main >> /etc/apt/sources.list" + # sudo apt update && apt-cache policy libssl1.0-dev + # sudo apt install -y libssl1.0-dev + # fi + # - run: + # name: Install Ruby version + # command: rvm install $RUBY_VERSION + # - run: + # name: Install bundler + # command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 + # - run: + # name: Install gem dependencies + # command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle install --path .bundle + # - run: + # name: Run tests + # command: rvm $RUBY_VERSION --verbose do bundle exec rake test + + # specs-ruby21-puppet410: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.1.9' + # PUPPET_VERSION: '4.10.9' + + # specs-ruby21-puppet50: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.1.9' + # PUPPET_VERSION: '5.0.1' + + # specs-ruby21-puppet53: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.1.9' + # PUPPET_VERSION: '5.3.3' + + # Puppet 6 depends on ruby >= 2.3 + #specs-ruby21-puppet60 + #specs-ruby21-puppet65 + + # specs-ruby22-puppet46: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.2.3' + # PUPPET_VERSION: '4.6.2' + + # specs-ruby22-puppet410: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.2.3' + # PUPPET_VERSION: '4.10.9' + + # specs-ruby22-puppet50: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.2.3' + # PUPPET_VERSION: '5.0.1' + + # specs-ruby22-puppet53: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.2.3' + # PUPPET_VERSION: '5.3.3' + + # Puppet 6 depends on ruby >= 2.3 + #specs-ruby22-puppet60 + #specs-ruby22-puppet65 + + # specs-ruby23-puppet46: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.3.6' + # PUPPET_VERSION: '4.6.2' + + # specs-ruby23-puppet410: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.3.6' + # PUPPET_VERSION: '4.10.9' + + # specs-ruby23-puppet50: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.3.6' + # PUPPET_VERSION: '5.0.1' + + # specs-ruby23-puppet53: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.3.6' + # PUPPET_VERSION: '5.3.3' + + # specs-ruby23-puppet60: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.3.6' + # PUPPET_VERSION: '6.0.0' + + specs-ruby23-puppet65: &specs machine: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.1.9' - PUPPET_VERSION: '4.6.2' + RUBY_VERSION: '2.3.6' + PUPPET_VERSION: '6.5.0' steps: # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - run: @@ -21,7 +155,7 @@ jobs: gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \curl -sSL https://get.rvm.io | bash -s stable - run: - name: Install old libssl1.0-dev + name: Install old libssl1.0-dev # TODO: try bumping libssl command: | ruby_major=$(echo $RUBY_VERSION | awk -F. '{ print $1 }') ruby_minor=$(echo $RUBY_VERSION | awk -F. '{ print $2 }') @@ -44,104 +178,6 @@ jobs: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test - specs-ruby21-puppet410: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.1.9' - PUPPET_VERSION: '4.10.9' - - specs-ruby21-puppet50: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.1.9' - PUPPET_VERSION: '5.0.1' - - specs-ruby21-puppet53: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.1.9' - PUPPET_VERSION: '5.3.3' - - # Puppet 6 depends on ruby >= 2.3 - #specs-ruby21-puppet60 - #specs-ruby21-puppet65 - - specs-ruby22-puppet46: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.2.3' - PUPPET_VERSION: '4.6.2' - - specs-ruby22-puppet410: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.2.3' - PUPPET_VERSION: '4.10.9' - - specs-ruby22-puppet50: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.2.3' - PUPPET_VERSION: '5.0.1' - - specs-ruby22-puppet53: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.2.3' - PUPPET_VERSION: '5.3.3' - - # Puppet 6 depends on ruby >= 2.3 - #specs-ruby22-puppet60 - #specs-ruby22-puppet65 - - specs-ruby23-puppet46: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.3.6' - PUPPET_VERSION: '4.6.2' - - specs-ruby23-puppet410: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.3.6' - PUPPET_VERSION: '4.10.9' - - specs-ruby23-puppet50: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.3.6' - PUPPET_VERSION: '5.0.1' - - specs-ruby23-puppet53: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.3.6' - PUPPET_VERSION: '5.3.3' - - specs-ruby23-puppet60: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.3.6' - PUPPET_VERSION: '6.0.0' - - specs-ruby23-puppet65: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.3.6' - PUPPET_VERSION: '6.5.0' # Puppet < 5 doesn't work with Ruby when it's compiled with libssl > 1.0 - see # https://bugzilla.redhat.com/show_bug.cgi?id=1440710 for details - but RVM @@ -155,28 +191,28 @@ jobs: # RUBY_VERSION: '2.4.3' # PUPPET_VERSION: '4.6.2' - specs-ruby24-puppet410: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.4.3' - PUPPET_VERSION: '4.10.9' + # specs-ruby24-puppet410: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.4.3' + # PUPPET_VERSION: '4.10.9' - specs-ruby24-puppet50: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.4.3' - PUPPET_VERSION: '5.0.1' + # specs-ruby24-puppet50: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.4.3' + # PUPPET_VERSION: '5.0.1' - specs-ruby24-puppet53: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.4.3' - PUPPET_VERSION: '5.3.3' + # specs-ruby24-puppet53: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.4.3' + # PUPPET_VERSION: '5.3.3' - specs-ruby24-puppet60: + # specs-ruby24-puppet60: <<: *specs environment: STRICT_VARIABLES: 'yes' @@ -197,33 +233,33 @@ jobs: # RUBY_VERSION: '2.5.3' # PUPPET_VERSION: '4.6.2' - specs-ruby25-puppet410: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.5.3' - PUPPET_VERSION: '4.10.9' + # specs-ruby25-puppet410: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '4.10.9' - specs-ruby25-puppet50: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.5.3' - PUPPET_VERSION: '5.0.1' + # specs-ruby25-puppet50: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '5.0.1' - specs-ruby25-puppet53: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.5.3' - PUPPET_VERSION: '5.3.3' + # specs-ruby25-puppet53: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '5.3.3' - specs-ruby25-puppet60: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.5.3' - PUPPET_VERSION: '6.0.0' + # specs-ruby25-puppet60: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '6.0.0' specs-ruby25-puppet65: <<: *specs @@ -232,12 +268,12 @@ jobs: RUBY_VERSION: '2.5.3' PUPPET_VERSION: '6.5.0' - specs-ruby26-puppet60: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' - PUPPET_VERSION: '6.0.0' + # specs-ruby26-puppet60: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.6.3' + # PUPPET_VERSION: '6.0.0' specs-ruby26-puppet65: <<: *specs @@ -352,38 +388,38 @@ jobs: - run: name: Execute Kitchen tests command: rvm $RUBY_VERSION --verbose do bundle exec rake circle - no_output_timeout: 900 + no_output_timeout: "900s" workflows: version: 2 build_and_test: jobs: - - specs-ruby21-puppet46 - - specs-ruby21-puppet410 - - specs-ruby21-puppet50 - - specs-ruby21-puppet53 - - specs-ruby22-puppet46 - - specs-ruby22-puppet410 - - specs-ruby22-puppet50 - - specs-ruby22-puppet53 - - specs-ruby23-puppet46 - - specs-ruby23-puppet410 - - specs-ruby23-puppet50 - - specs-ruby23-puppet53 - - specs-ruby23-puppet60 + # - specs-ruby21-puppet46 + # - specs-ruby21-puppet410 + # - specs-ruby21-puppet50 + # - specs-ruby21-puppet53 + # - specs-ruby22-puppet46 + # - specs-ruby22-puppet410 + # - specs-ruby22-puppet50 + # - specs-ruby22-puppet53 + # - specs-ruby23-puppet46 + # - specs-ruby23-puppet410 + # - specs-ruby23-puppet50 + # - specs-ruby23-puppet53 + # - specs-ruby23-puppet60 - specs-ruby23-puppet65 - - specs-ruby24-puppet410 - - specs-ruby24-puppet50 - - specs-ruby24-puppet53 - - specs-ruby24-puppet60 - - specs-ruby24-puppet65 - - specs-ruby25-puppet410 - - specs-ruby25-puppet50 - - specs-ruby25-puppet53 - - specs-ruby25-puppet60 + # - specs-ruby24-puppet410 + # - specs-ruby24-puppet50 + # - specs-ruby24-puppet53 + # - specs-ruby24-puppet60 + # - specs-ruby24-puppet65 + # - specs-ruby25-puppet410 + # - specs-ruby25-puppet50 + # - specs-ruby25-puppet53 + # - specs-ruby25-puppet60 - specs-ruby25-puppet65 - specs-ruby25-puppet65-windows - - specs-ruby26-puppet60 + # - specs-ruby26-puppet60 - specs-ruby26-puppet65 - specs-ruby26-puppet79 - specs-ruby26-puppet714 From 0217ada9f6797eeee6edd7250477902843b04568 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Wed, 29 Jan 2025 14:48:16 -0500 Subject: [PATCH 031/133] update gemfile.lock and .gitignore --- .gitignore | 1 - Gemfile.lock | 20 +++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index e8202815a..7937e9d54 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ /bin/ /doc/ /Gemfile.local -/Gemfile.lock /junit/ /log/ /pkg/ diff --git a/Gemfile.lock b/Gemfile.lock index 305f378d8..e1e6d305a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -22,6 +22,7 @@ GEM aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcrypt_pbkdf (1.0.1) + bcrypt_pbkdf (1.0.1-x64-mingw32) bigdecimal (3.1.9) bindata (2.5.0) bolt (4.0.0) @@ -88,7 +89,7 @@ GEM net-http-persistent (>= 4.0.4, < 5) fast_gettext (2.4.0) prime - ffi (1.17.1-arm64-darwin) + ffi (1.17.1) forwardable (1.3.3) gettext (3.5.1) erubi @@ -118,7 +119,7 @@ GEM io-console (0.7.2) jgrep (1.5.4) jmespath (1.6.2) - json (2.3.0) + json (2.6.3) json-schema (5.1.1) addressable (~> 2.8) bigdecimal (~> 3.1) @@ -316,6 +317,12 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + rest-client (2.1.0-x64-mingw32) + ffi (~> 1.9) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) retryable (3.0.5) rexml (3.2.6) rgen (0.10.2) @@ -408,7 +415,7 @@ GEM table_print (1.5.7) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - test-kitchen (3.4.0) + test-kitchen (3.7.0) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) ed25519 (~> 1.2) @@ -499,7 +506,7 @@ DEPENDENCIES dependency_checker (~> 1.0.0) facterdb (~> 2.1) io-console (= 0.7.2) - json (= 2.3.0) + json (= 2.6.3) kitchen-docker kitchen-puppet kitchen-verifier-serverspec @@ -508,13 +515,12 @@ DEPENDENCIES mixlib-shellout (~> 2.2.7) parallel_tests (= 3.12.1) pry (~> 0.10) - puppet (= 7.34.0) + puppet puppet-blacksmith (~> 7.0) puppet-debugger (~> 1.0) puppet-strings (~> 4.0) puppet_litmus (~> 1.0) puppetlabs_spec_helper (~> 8.0) - racc (~> 1.4.0) rb-readline (= 0.5.5) rexml (>= 3.0.0, < 3.2.7) rspec-puppet-facts (~> 4.0) @@ -523,7 +529,7 @@ DEPENDENCIES rubocop-rspec (= 2.19.0) serverspec (~> 2.41) simplecov-console (~> 0.9) - test-kitchen (~> 3.4.0) + test-kitchen (~> 3.7.0) voxpupuli-puppet-lint-plugins (~> 5.0) BUNDLED WITH From 23d62e6bd4ddc51153fa835336ebbe2b3b0e3a04 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Thu, 30 Jan 2025 15:03:34 +0000 Subject: [PATCH 032/133] Convert unless command into HereDoc command, fix issue where MSI path is not passed correctly. --- manifests/windows.pp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/manifests/windows.pp b/manifests/windows.pp index 488b605bb..fd377b9eb 100644 --- a/manifests/windows.pp +++ b/manifests/windows.pp @@ -42,18 +42,20 @@ provider => 'windows', } + $unless_cmd = @("ACCEPTABLE"/L) + \$blacklist = '928b00d2f952219732cda9ae0515351b15f9b9c1ea1d546738f9dc0fda70c336','78b2bb2b231bcc185eb73dd367bfb6cb8a5d45ba93a46a7890fd607dc9188194'; + \$fileStream = [system.io.file]::openread('${msi_full_path}'); + \$hasher = [System.Security.Cryptography.HashAlgorithm]::create('sha256'); + \$hash = \$hasher.ComputeHash(\$fileStream); + \$fileStream.close(); + \$fileStream.dispose(); + \$hexhash = [system.bitconverter]::tostring(\$hash).ToLower().replace('-',''); + if (\$blacklist.Contains(\$hexhash)) { Exit 1 } else { Exit 0 } + | ACCEPTABLE + exec { 'assert-acceptable-msi':, command => 'Exit 1', - unless => "@(ACCEPTABLE), - \$blacklist = '928b00d2f952219732cda9ae0515351b15f9b9c1ea1d546738f9dc0fda70c336','78b2bb2b231bcc185eb73dd367bfb6cb8a5d45ba93a46a7890fd607dc9188194'; - \$fileStream = [system.io.file]::openread('${msi_full_path}'); - \$hasher = [System.Security.Cryptography.HashAlgorithm]::create('sha256'); - \$hash = \$hasher.ComputeHash(\$fileStream); - \$fileStream.close(); - \$fileStream.dispose(); - \$hexhash = [system.bitconverter]::tostring(\$hash).ToLower().replace('-',''); - if (\$blacklist.Contains(\$hexhash)) { Exit 1 } else { Exit 0 } - | ACCEPTABLE", + unless => $unless_cmd, provider => 'powershell', logoutput => 'on_failure', require => File['installer'], From 28a375cbc88819cf7dd32723eade91185fd70fda Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Thu, 30 Jan 2025 15:07:45 +0000 Subject: [PATCH 033/133] Update to change log and version --- CHANGELOG.md | 7 +++++++ metadata.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a8e4c499..f61fd2e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ Changes ======= +# 4.0.0 / 2025-02-01 + +* [FEATURE] Add Support for Puppet 8 ([#823]) +* [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#823]) +* [BUGFIX] Fix issue where MSI path was not correctly parsed ([#823]) +* [FEATURE] Update to CI Builds to work with Ruby 3 + # 3.23.0 / 2024-12-09 * [FEATURE] Add support for `DD_REMOTE_POLICIES` ([#821]) diff --git a/metadata.json b/metadata.json index 9340aee81..3c7767d0f 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "datadog-datadog_agent", - "version": "3.23.0", + "version": "4.0.0", "author": "James Turnbull , Rob Terhaar , Jaime Fullaondo , Albert Vaca ", "summary": "Install the Datadog monitoring agent and report Puppet runs to Datadog", "license": "Apache-2.0", From 579585599f27e573761e29d9709ced3ce2c36609 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 30 Jan 2025 14:27:59 -0500 Subject: [PATCH 034/133] fix config --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fde5c5e09..813c2748c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -213,11 +213,11 @@ jobs: # PUPPET_VERSION: '5.3.3' # specs-ruby24-puppet60: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.4.3' - PUPPET_VERSION: '6.0.0' + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.4.3' + # PUPPET_VERSION: '6.0.0' specs-ruby24-puppet65: <<: *specs From 2e312cdbabf079265f2c3b23f2e0269fc897d515 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 30 Jan 2025 19:11:35 -0500 Subject: [PATCH 035/133] update ci specs --- .circleci/config.yml | 214 +++++++++++------------ Gemfile | 52 ++++-- Gemfile.lock | 395 +++++++++++++++++++++++-------------------- 3 files changed, 353 insertions(+), 308 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 813c2748c..56449257e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -136,12 +136,12 @@ jobs: # RUBY_VERSION: '2.3.6' # PUPPET_VERSION: '6.0.0' - specs-ruby23-puppet65: &specs + specs-ruby25-puppet65: &specs machine: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.3.6' + RUBY_VERSION: '2.5.3' PUPPET_VERSION: '6.5.0' steps: # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ @@ -154,126 +154,113 @@ jobs: command: | gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \curl -sSL https://get.rvm.io | bash -s stable - - run: - name: Install old libssl1.0-dev # TODO: try bumping libssl - command: | - ruby_major=$(echo $RUBY_VERSION | awk -F. '{ print $1 }') - ruby_minor=$(echo $RUBY_VERSION | awk -F. '{ print $2 }') - # We need libssl1.0-dev to even compile Ruby <= 2.3 with RVM; - if [ $ruby_major -eq "2" ] && [ $ruby_minor -le "3" ]; then - sudo bash -c "echo deb http://security.ubuntu.com/ubuntu bionic-security main >> /etc/apt/sources.list" - sudo apt update && apt-cache policy libssl1.0-dev - sudo apt install -y libssl1.0-dev - fi - run: name: Install Ruby version command: rvm install $RUBY_VERSION - run: name: Install bundler - command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 + command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.3.26 - run: name: Install gem dependencies command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle install --path .bundle - run: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test - - - # Puppet < 5 doesn't work with Ruby when it's compiled with libssl > 1.0 - see - # https://bugzilla.redhat.com/show_bug.cgi?id=1440710 for details - but RVM - # refuses to compile with older libssl. We could use --autolibs=0 RVM option, - # but then we'd have to manually install all deps ourselves and maintain that - # solution... So we just disable specs-ruby24-puppet46 and specs-ruby25-puppet46. - # specs-ruby24-puppet46: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '4.6.2' - - # specs-ruby24-puppet410: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '4.10.9' - - # specs-ruby24-puppet50: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '5.0.1' - - # specs-ruby24-puppet53: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '5.3.3' - - # specs-ruby24-puppet60: + # Puppet < 5 doesn't work with Ruby when it's compiled with libssl > 1.0 - see + # https://bugzilla.redhat.com/show_bug.cgi?id=1440710 for details - but RVM + # refuses to compile with older libssl. We could use --autolibs=0 RVM option, + # but then we'd have to manually install all deps ourselves and maintain that + # solution... So we just disable specs-ruby24-puppet46 and specs-ruby25-puppet46. + # specs-ruby24-puppet46: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.4.3' + # PUPPET_VERSION: '4.6.2' + + # specs-ruby24-puppet410: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.4.3' + # PUPPET_VERSION: '4.10.9' + + # specs-ruby24-puppet50: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.4.3' + # PUPPET_VERSION: '5.0.1' + + # specs-ruby24-puppet53: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.4.3' + # PUPPET_VERSION: '5.3.3' + + # specs-ruby24-puppet60: # <<: *specs # environment: # STRICT_VARIABLES: 'yes' # RUBY_VERSION: '2.4.3' # PUPPET_VERSION: '6.0.0' - specs-ruby24-puppet65: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.4.3' - PUPPET_VERSION: '6.5.0' - - # specs-ruby25-puppet46: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '4.6.2' - - # specs-ruby25-puppet410: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '4.10.9' - - # specs-ruby25-puppet50: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '5.0.1' - - # specs-ruby25-puppet53: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '5.3.3' - - # specs-ruby25-puppet60: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '6.0.0' - - specs-ruby25-puppet65: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.5.3' - PUPPET_VERSION: '6.5.0' - - # specs-ruby26-puppet60: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.6.3' - # PUPPET_VERSION: '6.0.0' + # specs-ruby24-puppet65: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.4.3' + # PUPPET_VERSION: '6.5.0' + + # specs-ruby25-puppet46: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '4.6.2' + + # specs-ruby25-puppet410: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '4.10.9' + + # specs-ruby25-puppet50: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '5.0.1' + + # specs-ruby25-puppet53: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '5.3.3' + + # specs-ruby25-puppet60: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '6.0.0' + + # specs-ruby25-puppet65: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.5.3' + # PUPPET_VERSION: '6.5.0' + + # specs-ruby26-puppet60: + # <<: *specs + # environment: + # STRICT_VARIABLES: 'yes' + # RUBY_VERSION: '2.6.3' + # PUPPET_VERSION: '6.0.0' specs-ruby26-puppet65: <<: *specs @@ -281,6 +268,7 @@ jobs: STRICT_VARIABLES: 'yes' RUBY_VERSION: '2.6.3' PUPPET_VERSION: '6.5.0' + specs-ruby26-puppet79: <<: *specs environment: @@ -302,6 +290,20 @@ jobs: RUBY_VERSION: '2.6.3' PUPPET_VERSION: '7.25.0' + specs-ruby27-puppet725: + <<: *specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '2.7.2' + PUPPET_VERSION: '7.25.0' + + specs-ruby31-puppet734: + <<: *specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '3.0.0' + PUPPET_VERSION: '7.34.0' + specs-ruby25-puppet65-windows: &windows-specs executor: name: win/default # Comes with ruby 2.6, which is not supported on Windows as of puppet 6.10.1 @@ -407,7 +409,7 @@ workflows: # - specs-ruby23-puppet50 # - specs-ruby23-puppet53 # - specs-ruby23-puppet60 - - specs-ruby23-puppet65 + # - specs-ruby23-puppet65 # - specs-ruby24-puppet410 # - specs-ruby24-puppet50 # - specs-ruby24-puppet53 diff --git a/Gemfile b/Gemfile index b0d51caf1..abdc6e5d6 100644 --- a/Gemfile +++ b/Gemfile @@ -23,40 +23,60 @@ group :development do gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "deep_merge", '~> 1.2.2', require: false - gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false - gem "facterdb", '~> 2.1', require: false - gem "metadata-json-lint", '~> 4.0', require: false - gem "rspec-puppet-facts", '~> 4.0', require: false - gem "dependency_checker", '~> 1.0.0', require: false gem "parallel_tests", '= 3.12.1', require: false gem "pry", '~> 0.10', require: false gem "simplecov-console", '~> 0.9', require: false gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '~> 1.50.0', require: false - gem "rubocop-performance", '= 1.16.0', require: false - gem "rubocop-rspec", '= 2.19.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "io-console", '= 0.7.2', require: false gem "bcrypt_pbkdf", '= 1.0.1', require: false - gem "librarian-puppet", '~> 5.0' gem "kitchen-puppet" gem "kitchen-docker" gem "kitchen-verifier-serverspec" gem "rexml", '>= 3.0.0', '< 3.2.7', require: false gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] - if ruby_version >= Gem::Version.new('2.7') && ruby_version < Gem::Version.new('3.1') - gem "test-kitchen", '~> 3.4.0', platforms: [:ruby] + if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') + gem "test-kitchen", '~> 3.0.0', platforms: [:ruby] + gem "rubocop", '~> 1.19', require: false + gem "rubocop-rspec", '= 2.10.0', require: false + gem "facterdb", '~> 1.21', require: false + gem "rspec-puppet-facts", '~> 1.10.0', require: false + gem "rubocop-performance", '~> 1.11', require: false + gem "librarian-puppet", '= 4.0.1' + gem "io-console", '= 0.5.9', require: false + gem "metadata-json-lint", '~> 3.0.3', require: false + gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false + gem "dependency_checker", '= 0.3.0', require: false else + gem "facterdb", '~> 2.1', require: false gem "test-kitchen", '~> 3.7.0' + gem "rubocop", '~> 1.50.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false + gem "rspec-puppet-facts", '~> 4.0', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "librarian-puppet", '~> 5.0' + gem "io-console", '= 0.7.2', require: false + gem "metadata-json-lint", '~> 4.0', require: false + gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false + gem "dependency_checker", '~> 1.0.0', require: false end end group :development, :release_prep do - gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 8.0', require: false - gem "puppet-blacksmith", '~> 7.0', require: false + if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('2.7') + gem "puppetlabs_spec_helper", '~> 5.0.3', require: false + gem "puppet-blacksmith", '= 6.1.1', require: false + gem "puppet-strings", '= 2.9.0', require: false + else + gem "puppetlabs_spec_helper", '~> 8.0', require: false + gem "puppet-blacksmith", '~> 7.0', require: false + gem "puppet-strings", '~> 4.0', require: false + end end group :system_tests do - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('2.7') + gem "puppet_litmus", '~> 0.36.2', require: false, platforms: [:ruby, :x64_mingw] + else + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + end gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "serverspec", '~> 2.41', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index e1e6d305a..ef7ce7ea6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,9 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.6) + CFPropertyList (3.0.7) + base64 + nkf rexml addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) @@ -9,8 +11,8 @@ GEM ast (2.4.2) awesome_print (1.9.2) aws-eventstream (1.3.0) - aws-partitions (1.1043.0) - aws-sdk-core (3.217.0) + aws-partitions (1.1044.0) + aws-sdk-core (3.217.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) @@ -22,10 +24,8 @@ GEM aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcrypt_pbkdf (1.0.1) - bcrypt_pbkdf (1.0.1-x64-mingw32) - bigdecimal (3.1.9) bindata (2.5.0) - bolt (4.0.0) + bolt (3.30.0) CFPropertyList (>= 2.2) addressable (~> 2.5) aws-sdk-ec2 (~> 1) @@ -38,28 +38,26 @@ GEM net-scp (>= 1.2, < 5.0) net-ssh (>= 4.0, < 8.0) net-ssh-krb (~> 0.5) - orchestrator_client (~> 0.7) + orchestrator_client (~> 0.5) puppet (>= 6.18.0) puppet-resource_api (>= 1.8.1) puppet-strings (>= 2.3.0, < 5.0) puppetfile-resolver (>= 0.6.2, < 1.0) - r10k (>= 3.10, < 5) + r10k (~> 3.10) ruby_smb (~> 1.0) terminal-table (~> 3.0) winrm (~> 2.0) winrm-fs (~> 1.3) builder (3.3.0) - chef-utils (18.6.2) - concurrent-ruby + chef-utils (16.6.14) coderay (1.1.3) colored2 (3.1.2) concurrent-ruby (1.3.5) - connection_pool (2.5.0) - cri (2.15.12) + cri (2.15.11) deep_merge (1.2.2) - dependency_checker (1.0.1) + dependency_checker (0.3.0) parallel - puppet_forge (>= 2.2, < 6.0) + puppet_forge (>= 2.2, < 4.0) rake (~> 13.0) semantic_puppet (~> 1.0) diff-lcs (1.5.1) @@ -67,29 +65,48 @@ GEM docker-api (2.4.0) excon (>= 0.64.0) multi_json - domain_name (0.6.20240107) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) ed25519 (1.3.0) erubi (1.13.1) - excon (1.2.3) + excon (0.109.0) facter (4.10.0) hocon (~> 1.3) thor (>= 1.0.1, < 1.3) - facterdb (2.1.0) + facterdb (1.21.0) facter (< 5.0.0) - jgrep (~> 1.5, >= 1.5.4) - faraday (2.8.1) - base64 - faraday-net_http (>= 2.0, < 3.1) + jgrep + faraday (1.10.4) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) - faraday-follow_redirects (0.3.0) - faraday (>= 1, < 3) - faraday-net_http (3.0.2) - faraday-net_http_persistent (2.3.0) - faraday (~> 2.5) - net-http-persistent (>= 4.0.4, < 5) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.1.0) + multipart-post (~> 2.0) + faraday-net_http (1.0.2) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.1) + faraday (~> 1.0) fast_gettext (2.4.0) prime ffi (1.17.1) + ffi-compiler (1.3.2) + ffi (>= 1.15.5) + rake forwardable (1.3.3) gettext (3.5.1) erubi @@ -112,19 +129,25 @@ GEM optimist highline (2.1.0) hocon (1.4.0) + honeycomb-beeline (3.1.0) + libhoney (>= 2.3.0) + http (5.0.4) + addressable (~> 2.8) + http-cookie (~> 1.0) + http-form_data (~> 2.2) + llhttp-ffi (~> 0.4.0) http-accept (1.7.0) http-cookie (1.0.8) domain_name (~> 0.5) + http-form_data (2.3.0) httpclient (2.8.3) - io-console (0.7.2) + io-console (0.5.9) jgrep (1.5.4) jmespath (1.6.2) - json (2.6.3) - json-schema (5.1.1) - addressable (~> 2.8) - bigdecimal (~> 3.1) - jwt (2.10.1) - base64 + json (2.1.0) + json-schema (4.3.1) + addressable (>= 2.8) + jwt (2.7.1) kitchen-docker (3.0.0) test-kitchen (>= 1.0.0) kitchen-puppet (3.7.0) @@ -134,9 +157,13 @@ GEM kitchen-verifier-serverspec (0.7.2) net-ssh (>= 3) test-kitchen (>= 1.4) - librarian-puppet (5.0.0) + libhoney (2.4.0) + addressable (~> 2.0) + excon + http (>= 2.0, < 6.0) + librarian-puppet (4.0.1) librarianp (>= 0.6.3) - puppet_forge (>= 2.1, < 5) + puppet_forge (>= 2.1, < 4) rsync librarianp (1.1.2) thor (~> 1.0) @@ -146,15 +173,17 @@ GEM tty-box (~> 0.6) tty-prompt (~> 0.20) little-plugger (1.1.4) + llhttp-ffi (0.4.0) + ffi-compiler (~> 1.0) + rake (~> 13.0) locale (2.1.4) log4r (1.1.10) logger (1.6.5) logging (2.4.0) little-plugger (~> 1.1) multi_json (~> 1.14) - metadata-json-lint (4.2.0) - json-schema (>= 2.8, < 6.0) - semantic_puppet (~> 1.0) + metadata-json-lint (3.0.3) + json-schema (>= 2.8, < 5.0) spdx-licenses (~> 1.0) method_source (1.1.0) mime-types (3.6.0) @@ -168,15 +197,13 @@ GEM thor mixlib-shellout (2.2.7) mixlib-versioning (1.2.12) - mocha (2.7.1) - ruby2_keywords (>= 0.0.5) + mocha (1.16.1) molinillo (0.8.0) multi_json (1.15.0) - net-http-persistent (4.0.5) - connection_pool (~> 2.2) - net-scp (4.1.0) - net-ssh (>= 2.6.5, < 8.0.0) - net-ssh (7.3.0) + multipart-post (2.4.1) + net-scp (3.0.0) + net-ssh (>= 2.6.5, < 7.0.0) + net-ssh (6.1.0) net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) net-ssh-krb (0.5.1) @@ -184,12 +211,13 @@ GEM net-ssh (>= 2.0) net-telnet (0.2.0) netrc (0.11.0) + nkf (0.2.0) nori (2.6.0) optimist (3.2.0) orchestrator_client (0.7.1) faraday (>= 1.4, < 3.0) faraday-net_http_persistent (>= 1.0, < 3.0) - parallel (1.26.3) + parallel (1.24.0) parallel_tests (3.12.1) parallel parser (3.3.7.0) @@ -197,7 +225,7 @@ GEM racc pastel (0.8.0) tty-color (~> 0.5) - pathspec (1.1.3) + pathspec (0.2.1) pluginator (1.5.0) prime (0.1.3) forwardable @@ -205,7 +233,7 @@ GEM pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.1.1) + public_suffix (4.0.7) puppet (7.34.0) concurrent-ruby (~> 1.0) deep_merge (~> 1.0) @@ -217,97 +245,101 @@ GEM puppet-resource_api (~> 1.5) scanf (~> 1.0) semantic_puppet (~> 1.0) - puppet-blacksmith (7.1.0) - puppet-modulebuilder (~> 1.0) + puppet-blacksmith (6.1.1) + puppet-modulebuilder (~> 0.2) rest-client (~> 2.0) - puppet-debugger (1.4.0) + puppet-debugger (1.3.0) awesome_print (~> 1.7) bundler facterdb (>= 0.4.0) pluginator (~> 1.5.0) - puppet (>= 6) + puppet (>= 5.5) rb-readline (>= 0.5.5) table_print (>= 1.0.0) - tty-pager (~> 0.14) - puppet-lint (4.2.4) - puppet-lint-absolute_classname-check (4.0.0) - puppet-lint (>= 3.0, < 5) - puppet-lint-anchor-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-file_ensure-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-leading_zero-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-lookup_in_parameter-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-manifest_whitespace-check (0.3.0) + tty-pager (~> 0.13) + puppet-lint (3.4.0) + puppet-lint-absolute_classname-check (3.1.0) + puppet-lint (>= 1.0, < 4) + puppet-lint-anchor-check (1.1.0) + puppet-lint (>= 1.1, < 4) + puppet-lint-file_ensure-check (1.1.0) + puppet-lint (>= 1.0, < 4) + puppet-lint-leading_zero-check (1.1.0) + puppet-lint (>= 1.0, < 4.0) + puppet-lint-lookup_in_parameter-check (1.1.0) + puppet-lint (>= 2.0, < 4) + puppet-lint-manifest_whitespace-check (0.2.9) + puppet-lint (>= 1.0, < 4) + puppet-lint-optional_default-check (1.1.0) + puppet-lint (>= 2.1, < 4) + puppet-lint-param-docs (1.7.6) + puppet-lint (>= 1.1, < 4.0) + puppet-lint-param-types (1.0.0) + puppet-lint (>= 1.1, < 4) + puppet-lint-params_empty_string-check (1.1.0) + puppet-lint (>= 2.5, < 4) + puppet-lint-resource_reference_syntax (1.2.0) + puppet-lint (>= 1.0, < 4) + puppet-lint-strict_indent-check (2.1.0) + puppet-lint (>= 1.0, < 4) + puppet-lint-topscope-variable-check (1.2.0) + puppet-lint (>= 2.0, < 4) + puppet-lint-trailing_comma-check (1.0.0) + puppet-lint (>= 1.0, < 4) + puppet-lint-unquoted_string-check (2.2.0) + puppet-lint (>= 2.1, < 4) + puppet-lint-variable_contains_upcase (1.4.0) puppet-lint (>= 1.0, < 5) - puppet-lint-optional_default-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-param-docs (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-param-types (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-params_empty_string-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-resource_reference_syntax (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-strict_indent-check (3.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-topscope-variable-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-trailing_comma-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-unquoted_string-check (3.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-variable_contains_upcase (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-version_comparison-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-modulebuilder (1.1.0) + puppet-lint-version_comparison-check (1.1.0) + puppet-lint (>= 1.0, < 4) + puppet-modulebuilder (0.3.0) minitar (~> 0.9) - pathspec (>= 0.2.1, < 3.0.0) + pathspec (>= 0.2.1, < 2.0.0) puppet-resource_api (1.9.0) hocon (>= 1.0) - puppet-strings (4.1.3) - rgen (~> 0.9) - yard (~> 0.9, < 0.9.37) - puppet-syntax (4.1.1) - puppet (>= 7, < 9) - rake (~> 13.1) - puppet_forge (4.1.0) - faraday (~> 2.0) - faraday-follow_redirects (~> 0.3.0) + puppet-strings (2.9.0) + rgen + yard (~> 0.9.5) + puppet-syntax (3.3.0) + puppet (>= 5) + rake + puppet_forge (3.2.0) + faraday (~> 1.3) + faraday_middleware (~> 1.0) minitar semantic_puppet (~> 1.0) - puppet_litmus (1.6.1) - bolt (~> 4.0) + puppet_litmus (0.36.2) + bolt (~> 3.0) docker-api (>= 1.34, < 3.0.0) + honeycomb-beeline parallel - puppet-modulebuilder (>= 0.3.0) + puppet-modulebuilder (>= 0.2.1, < 1.0.0) retryable (~> 3.0) rspec + rspec_honeycomb_formatter tty-spinner (>= 0.5.0, < 1.0.0) puppetfile-resolver (0.6.3) molinillo (~> 0.6) semantic_puppet (~> 1.0) - puppetlabs_spec_helper (8.0.0) - mocha (>= 1.0, < 3) - pathspec (>= 0.2, < 3) - puppet-lint (~> 4.0) - puppet-syntax (~> 4.1, >= 4.1.1) + puppetlabs_spec_helper (5.0.3) + mocha (~> 1.0) + pathspec (>= 0.2, < 2.0.0) + puppet-lint (>= 2.5.2, < 4.0.0) + puppet-syntax (~> 3.0) rspec-github (~> 2.0) - rspec-puppet (~> 5.0) - r10k (4.1.0) + rspec-puppet (~> 2.0) + r10k (3.16.2) colored2 (= 3.1.2) cri (>= 2.15.10) - gettext-setup (>= 0.24, < 2.0) - jwt (>= 2.2.3, < 3) + fast_gettext (>= 1.1.0, < 3.0.0) + gettext (>= 3.0.2, < 4.0.0) + gettext-setup (>= 0.24, < 2.0.0) + jwt (>= 2.2.3, < 2.8.0) log4r (= 1.1.10) minitar (~> 0.9) multi_json (~> 1.10) - puppet_forge (>= 4.1, < 6) - racc (1.4.16) + puppet_forge (>= 2.3.0, < 4.0.0) + racc (1.8.1) rainbow (3.1.1) rake (13.2.1) rb-readline (0.5.5) @@ -317,12 +349,6 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rest-client (2.1.0-x64-mingw32) - ffi (~> 1.9) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) retryable (3.0.5) rexml (3.2.6) rgen (0.10.2) @@ -343,46 +369,44 @@ GEM rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-puppet (5.0.0) - rspec (~> 3.0) - rspec-puppet-facts (4.0.0) - deep_merge (~> 1.2) - facter (< 5) - facterdb (~> 2.1) - puppet (>= 7, < 9) + rspec-puppet (2.12.0) + rspec + rspec-puppet-facts (1.10.0) + facter + facterdb (>= 0.5.0) + json + puppet rspec-support (3.13.2) + rspec_honeycomb_formatter (0.2.1) + honeycomb-beeline + rspec-core (~> 3.0) rsync (1.0.9) - rubocop (1.50.2) - json (~> 2.3) + rubocop (1.28.2) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rexml + rubocop-ast (>= 1.17.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.38.0) - parser (>= 3.3.1.0) - rubocop-capybara (2.21.0) - rubocop (~> 1.41) - rubocop-performance (1.16.0) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.17.0) + parser (>= 3.1.1.0) + rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rspec (2.19.0) - rubocop (~> 1.33) - rubocop-capybara (~> 2.17) + rubocop-rspec (2.10.0) + rubocop (~> 1.19) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) ruby_smb (1.1.0) bindata rubyntlm windows_error - rubyntlm (0.6.5) - base64 + rubyntlm (0.6.3) rubyzip (2.4.1) scanf (1.0.0) - semantic_puppet (1.1.1) + semantic_puppet (1.0.4) serverspec (2.42.3) multi_json rspec (~> 3.0) @@ -415,15 +439,15 @@ GEM table_print (1.5.7) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - test-kitchen (3.7.0) + test-kitchen (3.0.0) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) ed25519 (~> 1.2) license-acceptance (>= 1.0.11, < 3.0) mixlib-install (~> 3.6) mixlib-shellout (>= 1.2, < 4.0) - net-scp (>= 1.1, < 5.0) - net-ssh (>= 2.9, < 8.0) + net-scp (>= 1.1, < 4.0) + net-ssh (>= 2.9, < 7.0) net-ssh-gateway (>= 1.2, < 3.0) thor (>= 0.19, < 2.0) winrm (~> 2.0) @@ -451,27 +475,28 @@ GEM tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) + unf (0.2.0) unicode-display_width (2.6.0) unicode_utils (1.4.0) - voxpupuli-puppet-lint-plugins (5.0.0) - puppet-lint (~> 4.0) - puppet-lint-absolute_classname-check (~> 4.0) - puppet-lint-anchor-check (~> 2.0) - puppet-lint-file_ensure-check (~> 2.0) - puppet-lint-leading_zero-check (~> 2.0) - puppet-lint-lookup_in_parameter-check (~> 2.0) - puppet-lint-manifest_whitespace-check (~> 0.3, < 1.0.0) - puppet-lint-optional_default-check (~> 2.0) - puppet-lint-param-docs (~> 2.0) - puppet-lint-param-types (~> 2.0) - puppet-lint-params_empty_string-check (~> 2.0) - puppet-lint-resource_reference_syntax (~> 2.0) - puppet-lint-strict_indent-check (~> 3.0) - puppet-lint-topscope-variable-check (~> 2.0) - puppet-lint-trailing_comma-check (~> 2.0) - puppet-lint-unquoted_string-check (~> 3.0) - puppet-lint-variable_contains_upcase (~> 2.0) - puppet-lint-version_comparison-check (~> 2.0) + voxpupuli-puppet-lint-plugins (4.0.0) + puppet-lint (~> 3.1) + puppet-lint-absolute_classname-check (~> 3.1) + puppet-lint-anchor-check (~> 1.1) + puppet-lint-file_ensure-check (~> 1.1) + puppet-lint-leading_zero-check (~> 1.0) + puppet-lint-lookup_in_parameter-check (~> 1.0) + puppet-lint-manifest_whitespace-check (~> 0.2.7, < 1.0.0) + puppet-lint-optional_default-check (~> 1.1) + puppet-lint-param-docs (>= 1.7.6, < 2.0.0) + puppet-lint-param-types (~> 1.0) + puppet-lint-params_empty_string-check (~> 1.0) + puppet-lint-resource_reference_syntax (~> 1.1) + puppet-lint-strict_indent-check (~> 2.1) + puppet-lint-topscope-variable-check (~> 1.1) + puppet-lint-trailing_comma-check (~> 1.0) + puppet-lint-unquoted_string-check (~> 2.2) + puppet-lint-variable_contains_upcase (~> 1.2) + puppet-lint-version_comparison-check (~> 1.1) windows_error (0.1.5) winrm (2.3.6) builder (>= 2.1.2) @@ -492,45 +517,43 @@ GEM rubyzip (~> 2.0) winrm (~> 2.0) wisper (2.0.1) - yard (0.9.36) + yard (0.9.37) PLATFORMS - arm64-darwin-22 - arm64-darwin-24 - x64-mingw32 + x86_64-linux DEPENDENCIES CFPropertyList (< 3.0.7) bcrypt_pbkdf (= 1.0.1) deep_merge (~> 1.2.2) - dependency_checker (~> 1.0.0) - facterdb (~> 2.1) - io-console (= 0.7.2) - json (= 2.6.3) + dependency_checker (= 0.3.0) + facterdb (~> 1.21) + io-console (= 0.5.9) + json (= 2.1.0) kitchen-docker kitchen-puppet kitchen-verifier-serverspec - librarian-puppet (~> 5.0) - metadata-json-lint (~> 4.0) + librarian-puppet (= 4.0.1) + metadata-json-lint (~> 3.0.3) mixlib-shellout (~> 2.2.7) parallel_tests (= 3.12.1) pry (~> 0.10) puppet - puppet-blacksmith (~> 7.0) + puppet-blacksmith (= 6.1.1) puppet-debugger (~> 1.0) - puppet-strings (~> 4.0) - puppet_litmus (~> 1.0) - puppetlabs_spec_helper (~> 8.0) + puppet-strings (= 2.9.0) + puppet_litmus (~> 0.36.2) + puppetlabs_spec_helper (~> 5.0.3) rb-readline (= 0.5.5) rexml (>= 3.0.0, < 3.2.7) - rspec-puppet-facts (~> 4.0) - rubocop (~> 1.50.0) - rubocop-performance (= 1.16.0) - rubocop-rspec (= 2.19.0) + rspec-puppet-facts (~> 1.10.0) + rubocop (~> 1.19) + rubocop-performance (~> 1.11) + rubocop-rspec (= 2.10.0) serverspec (~> 2.41) simplecov-console (~> 0.9) - test-kitchen (~> 3.7.0) - voxpupuli-puppet-lint-plugins (~> 5.0) + test-kitchen (~> 3.0.0) + voxpupuli-puppet-lint-plugins (~> 4.0) BUNDLED WITH - 2.4.13 + 2.3.26 From bf6d3758fe117cd27bc86ee7d235ac676c7c18d6 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 30 Jan 2025 19:24:23 -0500 Subject: [PATCH 036/133] use ruby 2.6+ puppet 6.5+ in ci --- .circleci/config.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 56449257e..55734cbf9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -136,12 +136,12 @@ jobs: # RUBY_VERSION: '2.3.6' # PUPPET_VERSION: '6.0.0' - specs-ruby25-puppet65: &specs + specs-ruby26-puppet65: &specs machine: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.5.3' + RUBY_VERSION: '2.6.3' PUPPET_VERSION: '6.5.0' steps: # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ @@ -159,7 +159,7 @@ jobs: command: rvm install $RUBY_VERSION - run: name: Install bundler - command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.3.26 + command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 - run: name: Install gem dependencies command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle install --path .bundle @@ -262,13 +262,6 @@ jobs: # RUBY_VERSION: '2.6.3' # PUPPET_VERSION: '6.0.0' - specs-ruby26-puppet65: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' - PUPPET_VERSION: '6.5.0' - specs-ruby26-puppet79: <<: *specs environment: @@ -304,7 +297,7 @@ jobs: RUBY_VERSION: '3.0.0' PUPPET_VERSION: '7.34.0' - specs-ruby25-puppet65-windows: &windows-specs + specs-ruby26-puppet79-windows: &windows-specs executor: name: win/default # Comes with ruby 2.6, which is not supported on Windows as of puppet 6.10.1 shell: bash.exe @@ -318,10 +311,8 @@ jobs: name: Run tests command: | set -e - choco install ruby --allow-downgrade -y --version 2.5.3.101 # Keep version in sync with next command! - export PATH=/c/tools/ruby25/bin:$PATH # Make Ruby 2.5 take precedence over the pre-installed 2.6 ruby --version - choco install msys2 --allow-downgrade -y --version 20210604.0.0 + choco install msys2 -y ridk.cmd exec pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain gem install bundler -v 2.4.13 rm Gemfile.lock && bundle install --path .bundle @@ -329,7 +320,7 @@ jobs: environment: STRICT_VARIABLES: 'yes' #RUBY_VERSION hardcoded in install script - PUPPET_VERSION: '6.5.0' + PUPPET_VERSION: '7.9.0' verify-gemfile-lock-dependencies: machine: @@ -419,8 +410,8 @@ workflows: # - specs-ruby25-puppet50 # - specs-ruby25-puppet53 # - specs-ruby25-puppet60 - - specs-ruby25-puppet65 - - specs-ruby25-puppet65-windows + # - specs-ruby25-puppet65 + - specs-ruby26-puppet79-windows # - specs-ruby26-puppet60 - specs-ruby26-puppet65 - specs-ruby26-puppet79 From e948616b06e3f5be13b5dad274a25a10363c74dc Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 30 Jan 2025 19:36:28 -0500 Subject: [PATCH 037/133] remove gemfile.lock before installing bundler --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55734cbf9..f66cf4f84 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -159,10 +159,10 @@ jobs: command: rvm install $RUBY_VERSION - run: name: Install bundler - command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 + command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 - run: name: Install gem dependencies - command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle install --path .bundle + command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle - run: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test From 6f21b9c2502da819d977b16fc4edb24c0559ab71 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 30 Jan 2025 20:02:19 -0500 Subject: [PATCH 038/133] clean up circleci, update gemfile.lock --- .circleci/config.yml | 258 +------------------------------------------ Gemfile.lock | 33 +++--- 2 files changed, 20 insertions(+), 271 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f66cf4f84..73e24db11 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,140 +2,6 @@ version: 2.1 orbs: win: circleci/windows@2.2.0 jobs: - # specs-ruby21-puppet46: &specs - # machine: - # image: ubuntu-2004:2024.08.1 - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.1.9' - # PUPPET_VERSION: '4.6.2' - # steps: - # # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - # - run: - # name: Fix git clones - # command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig - # - checkout - # - run: - # name: Install RVM - # command: | - # gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB - # \curl -sSL https://get.rvm.io | bash -s stable - # - run: - # name: Install old libssl1.0-dev - # command: | - # ruby_major=$(echo $RUBY_VERSION | awk -F. '{ print $1 }') - # ruby_minor=$(echo $RUBY_VERSION | awk -F. '{ print $2 }') - # # We need libssl1.0-dev to even compile Ruby <= 2.3 with RVM; - # if [ $ruby_major -eq "2" ] && [ $ruby_minor -le "3" ]; then - # sudo bash -c "echo deb http://security.ubuntu.com/ubuntu bionic-security main >> /etc/apt/sources.list" - # sudo apt update && apt-cache policy libssl1.0-dev - # sudo apt install -y libssl1.0-dev - # fi - # - run: - # name: Install Ruby version - # command: rvm install $RUBY_VERSION - # - run: - # name: Install bundler - # command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 - # - run: - # name: Install gem dependencies - # command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle install --path .bundle - # - run: - # name: Run tests - # command: rvm $RUBY_VERSION --verbose do bundle exec rake test - - # specs-ruby21-puppet410: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.1.9' - # PUPPET_VERSION: '4.10.9' - - # specs-ruby21-puppet50: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.1.9' - # PUPPET_VERSION: '5.0.1' - - # specs-ruby21-puppet53: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.1.9' - # PUPPET_VERSION: '5.3.3' - - # Puppet 6 depends on ruby >= 2.3 - #specs-ruby21-puppet60 - #specs-ruby21-puppet65 - - # specs-ruby22-puppet46: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.2.3' - # PUPPET_VERSION: '4.6.2' - - # specs-ruby22-puppet410: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.2.3' - # PUPPET_VERSION: '4.10.9' - - # specs-ruby22-puppet50: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.2.3' - # PUPPET_VERSION: '5.0.1' - - # specs-ruby22-puppet53: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.2.3' - # PUPPET_VERSION: '5.3.3' - - # Puppet 6 depends on ruby >= 2.3 - #specs-ruby22-puppet60 - #specs-ruby22-puppet65 - - # specs-ruby23-puppet46: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.3.6' - # PUPPET_VERSION: '4.6.2' - - # specs-ruby23-puppet410: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.3.6' - # PUPPET_VERSION: '4.10.9' - - # specs-ruby23-puppet50: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.3.6' - # PUPPET_VERSION: '5.0.1' - - # specs-ruby23-puppet53: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.3.6' - # PUPPET_VERSION: '5.3.3' - - # specs-ruby23-puppet60: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.3.6' - # PUPPET_VERSION: '6.0.0' - specs-ruby26-puppet65: &specs machine: image: ubuntu-2004:2024.08.1 @@ -166,101 +32,6 @@ jobs: - run: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test - # Puppet < 5 doesn't work with Ruby when it's compiled with libssl > 1.0 - see - # https://bugzilla.redhat.com/show_bug.cgi?id=1440710 for details - but RVM - # refuses to compile with older libssl. We could use --autolibs=0 RVM option, - # but then we'd have to manually install all deps ourselves and maintain that - # solution... So we just disable specs-ruby24-puppet46 and specs-ruby25-puppet46. - # specs-ruby24-puppet46: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '4.6.2' - - # specs-ruby24-puppet410: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '4.10.9' - - # specs-ruby24-puppet50: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '5.0.1' - - # specs-ruby24-puppet53: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '5.3.3' - - # specs-ruby24-puppet60: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '6.0.0' - - # specs-ruby24-puppet65: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.4.3' - # PUPPET_VERSION: '6.5.0' - - # specs-ruby25-puppet46: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '4.6.2' - - # specs-ruby25-puppet410: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '4.10.9' - - # specs-ruby25-puppet50: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '5.0.1' - - # specs-ruby25-puppet53: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '5.3.3' - - # specs-ruby25-puppet60: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '6.0.0' - - # specs-ruby25-puppet65: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.5.3' - # PUPPET_VERSION: '6.5.0' - - # specs-ruby26-puppet60: - # <<: *specs - # environment: - # STRICT_VARIABLES: 'yes' - # RUBY_VERSION: '2.6.3' - # PUPPET_VERSION: '6.0.0' specs-ruby26-puppet79: <<: *specs @@ -327,7 +98,7 @@ jobs: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.5.3' + RUBY_VERSION: '2.6.3' steps: # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - run: @@ -357,7 +128,7 @@ jobs: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.5.3' + RUBY_VERSION: '2.6.3' steps: # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - run: @@ -387,32 +158,7 @@ workflows: version: 2 build_and_test: jobs: - # - specs-ruby21-puppet46 - # - specs-ruby21-puppet410 - # - specs-ruby21-puppet50 - # - specs-ruby21-puppet53 - # - specs-ruby22-puppet46 - # - specs-ruby22-puppet410 - # - specs-ruby22-puppet50 - # - specs-ruby22-puppet53 - # - specs-ruby23-puppet46 - # - specs-ruby23-puppet410 - # - specs-ruby23-puppet50 - # - specs-ruby23-puppet53 - # - specs-ruby23-puppet60 - # - specs-ruby23-puppet65 - # - specs-ruby24-puppet410 - # - specs-ruby24-puppet50 - # - specs-ruby24-puppet53 - # - specs-ruby24-puppet60 - # - specs-ruby24-puppet65 - # - specs-ruby25-puppet410 - # - specs-ruby25-puppet50 - # - specs-ruby25-puppet53 - # - specs-ruby25-puppet60 - # - specs-ruby25-puppet65 - specs-ruby26-puppet79-windows - # - specs-ruby26-puppet60 - specs-ruby26-puppet65 - specs-ruby26-puppet79 - specs-ruby26-puppet714 diff --git a/Gemfile.lock b/Gemfile.lock index ef7ce7ea6..b2752709c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,11 +49,12 @@ GEM winrm (~> 2.0) winrm-fs (~> 1.3) builder (3.3.0) - chef-utils (16.6.14) + chef-utils (18.6.2) + concurrent-ruby coderay (1.1.3) colored2 (3.1.2) concurrent-ruby (1.3.5) - cri (2.15.11) + cri (2.15.12) deep_merge (1.2.2) dependency_checker (0.3.0) parallel @@ -131,11 +132,12 @@ GEM hocon (1.4.0) honeycomb-beeline (3.1.0) libhoney (>= 2.3.0) - http (5.0.4) + http (5.2.0) addressable (~> 2.8) + base64 (~> 0.1) http-cookie (~> 1.0) http-form_data (~> 2.2) - llhttp-ffi (~> 0.4.0) + llhttp-ffi (~> 0.5.0) http-accept (1.7.0) http-cookie (1.0.8) domain_name (~> 0.5) @@ -173,7 +175,7 @@ GEM tty-box (~> 0.6) tty-prompt (~> 0.20) little-plugger (1.1.4) - llhttp-ffi (0.4.0) + llhttp-ffi (0.5.0) ffi-compiler (~> 1.0) rake (~> 13.0) locale (2.1.4) @@ -225,7 +227,7 @@ GEM racc pastel (0.8.0) tty-color (~> 0.5) - pathspec (0.2.1) + pathspec (1.0.0) pluginator (1.5.0) prime (0.1.3) forwardable @@ -233,7 +235,7 @@ GEM pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.7) + public_suffix (5.1.1) puppet (7.34.0) concurrent-ruby (~> 1.0) deep_merge (~> 1.0) @@ -381,18 +383,18 @@ GEM honeycomb-beeline rspec-core (~> 3.0) rsync (1.0.9) - rubocop (1.28.2) + rubocop (1.31.0) parallel (~> 1.10) parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.17.0, < 2.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.18.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.17.0) - parser (>= 3.1.1.0) - rubocop-performance (1.13.3) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-performance (1.17.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rspec (2.10.0) @@ -403,7 +405,8 @@ GEM bindata rubyntlm windows_error - rubyntlm (0.6.3) + rubyntlm (0.6.5) + base64 rubyzip (2.4.1) scanf (1.0.0) semantic_puppet (1.0.4) @@ -556,4 +559,4 @@ DEPENDENCIES voxpupuli-puppet-lint-plugins (~> 4.0) BUNDLED WITH - 2.3.26 + 2.4.13 From ce706218248915f3c19f8b46bed9913949817900 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 30 Jan 2025 20:14:48 -0500 Subject: [PATCH 039/133] rm .vscode --- .vscode/extensions.json | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 6da8d472f..000000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "recommendations": [ - "puppet.puppet-vscode", - "Shopify.ruby-lsp" - ] -} From 0bb30c765f8d9c221a7c02f842f616216aa97a57 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 31 Jan 2025 11:31:26 -0500 Subject: [PATCH 040/133] use ruby 2.7+ puppet 6.5+ in ci --- .circleci/config.yml | 60 ++-- .fixtures.yml | 8 +- .rubocop.yml | 636 +------------------------------------------ Gemfile | 4 +- Gemfile.lock | 80 +++--- 5 files changed, 82 insertions(+), 706 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 73e24db11..53d542214 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,18 +2,14 @@ version: 2.1 orbs: win: circleci/windows@2.2.0 jobs: - specs-ruby26-puppet65: &specs + specs-ruby27-puppet65: &specs machine: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' + RUBY_VERSION: '2.7.5' PUPPET_VERSION: '6.5.0' steps: - # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - - run: - name: Fix git clones - command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig - checkout - run: name: Install RVM @@ -33,32 +29,25 @@ jobs: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test - specs-ruby26-puppet79: + specs-ruby27-puppet79: <<: *specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' + RUBY_VERSION: '2.7.5' PUPPET_VERSION: '7.9.0' - specs-ruby26-puppet714: + specs-ruby27-puppet714: <<: *specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' + RUBY_VERSION: '2.7.5' PUPPET_VERSION: '7.14.0' - specs-ruby26-puppet725: - <<: *specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' - PUPPET_VERSION: '7.25.0' - specs-ruby27-puppet725: <<: *specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.7.2' + RUBY_VERSION: '2.7.5' PUPPET_VERSION: '7.25.0' specs-ruby31-puppet734: @@ -68,20 +57,19 @@ jobs: RUBY_VERSION: '3.0.0' PUPPET_VERSION: '7.34.0' - specs-ruby26-puppet79-windows: &windows-specs + specs-ruby27-puppet79-windows: + # &windows-specs executor: - name: win/default # Comes with ruby 2.6, which is not supported on Windows as of puppet 6.10.1 + name: win/default shell: bash.exe steps: - # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - - run: - name: Fix git clones - command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig - checkout - run: name: Run tests command: | set -e + choco install ruby --allow-downgrade -y --version=2.7.5.1 # Keep version in sync with next command! + export PATH=/c/tools/ruby27/bin:$PATH # Make Ruby 2.7 take precedence over the pre-installed version ruby --version choco install msys2 -y ridk.cmd exec pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain @@ -98,12 +86,8 @@ jobs: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' + RUBY_VERSION: '2.7.5' steps: - # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - - run: - name: Fix git clones - command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig - checkout - run: name: Install RVM @@ -128,12 +112,8 @@ jobs: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' + RUBY_VERSION: '2.7.5' steps: - # See https://github.blog/2021-09-01-improving-git-protocol-security-github/ - - run: - name: Fix git clones - command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig - checkout - run: name: Install RVM @@ -155,13 +135,13 @@ jobs: no_output_timeout: "900s" workflows: - version: 2 build_and_test: jobs: - - specs-ruby26-puppet79-windows - - specs-ruby26-puppet65 - - specs-ruby26-puppet79 - - specs-ruby26-puppet714 - - specs-ruby26-puppet725 + - specs-ruby27-puppet79-windows + - specs-ruby27-puppet65 + - specs-ruby27-puppet79 + - specs-ruby27-puppet714 + - specs-ruby27-puppet725 + - specs-ruby31-puppet734 - verify-gemfile-lock-dependencies - kitchen-tests diff --git a/.fixtures.yml b/.fixtures.yml index e8d3a33ff..651a28dfb 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,16 +1,16 @@ fixtures: repositories: stdlib: - repo: "git://github.com/puppetlabs/puppetlabs-stdlib.git" + repo: "https://github.com/puppetlabs/puppetlabs-stdlib.git" # TODO: why git: and not https:? ref: "4.25.0" concat: - repo: "git://github.com/puppetlabs/puppetlabs-concat.git" + repo: "https://github.com/puppetlabs/puppetlabs-concat.git" ref: "4.1.1" apt: - repo: "git://github.com/puppetlabs/puppetlabs-apt.git" + repo: "https://github.com/puppetlabs/puppetlabs-apt.git" ref: "4.5.0" puppetserver_gem: - repo: "git://github.com/puppetlabs/puppetlabs-puppetserver_gem.git" + repo: "https://github.com/puppetlabs/puppetlabs-puppetserver_gem.git" ref: "1.0.0" forge_modules: yumrepo_core: diff --git a/.rubocop.yml b/.rubocop.yml index 21b82b99b..5fcf67c13 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,7 @@ require: - rubocop-performance - rubocop-rspec AllCops: + DisabledByDefault: true NewCops: enable DisplayCopNames: true TargetRubyVersion: '2.6' @@ -23,8 +24,7 @@ Layout/LineLength: Description: People have wide screens, use them. Max: 200 RSpec/BeforeAfterAll: - Description: Beware of using after(:all) as it may cause state to leak between tests. - A necessary evil in acceptance testing. + Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing. Exclude: - spec/acceptance/**/*.rb RSpec/HookArgument: @@ -34,8 +34,7 @@ RSpec/DescribeSymbol: Exclude: - spec/unit/facter/**/*.rb Style/BlockDelimiters: - Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to - be consistent then. + Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then. EnforcedStyle: braces_for_chaining Style/ClassAndModuleChildren: Description: Compact style reduces the required amount of indentation. @@ -47,8 +46,7 @@ Style/FormatString: Description: Following the main puppet project's style, prefer the % format format. EnforcedStyle: percent Style/FormatStringToken: - Description: Following the main puppet project's style, prefer the simpler template - tokens over annotated ones. + Description: Following the main puppet project's style, prefer the simpler template tokens over annotated ones. EnforcedStyle: template Style/Lambda: Description: Prefer the keyword for easier discoverability. @@ -57,17 +55,13 @@ Style/RegexpLiteral: Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168 EnforcedStyle: percent_r Style/TernaryParentheses: - Description: Checks for use of parentheses around ternary conditions. Enforce parentheses - on complex expressions for better readability, but seriously consider breaking - it up. + Description: Checks for use of parentheses around ternary conditions. Enforce parentheses on complex expressions for better readability, but seriously consider breaking it up. EnforcedStyle: require_parentheses_when_complex Style/TrailingCommaInArguments: - Description: Prefer always trailing comma on multiline argument lists. This makes - diffs, and re-ordering nicer. + Description: Prefer always trailing comma on multiline argument lists. This makes diffs, and re-ordering nicer. EnforcedStyleForMultiline: comma Style/TrailingCommaInArrayLiteral: - Description: Prefer always trailing comma on multiline literals. This makes diffs, - and re-ordering nicer. + Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer. EnforcedStyleForMultiline: comma Style/SymbolArray: Description: Using percent style obscures symbolic intent of array's contents. @@ -112,619 +106,3 @@ Style/MethodCalledOnDoEndBlock: Enabled: true Style/StringMethods: Enabled: true -Bundler/GemFilename: - Enabled: false -Bundler/InsecureProtocolSource: - Enabled: false -Capybara/CurrentPathExpectation: - Enabled: false -Capybara/VisibilityMatcher: - Enabled: false -Gemspec/DuplicatedAssignment: - Enabled: false -Gemspec/OrderedDependencies: - Enabled: false -Gemspec/RequiredRubyVersion: - Enabled: false -Gemspec/RubyVersionGlobalsUsage: - Enabled: false -Layout/ArgumentAlignment: - Enabled: false -Layout/BeginEndAlignment: - Enabled: false -Layout/ClosingHeredocIndentation: - Enabled: false -Layout/EmptyComment: - Enabled: false -Layout/EmptyLineAfterGuardClause: - Enabled: false -Layout/EmptyLinesAroundArguments: - Enabled: false -Layout/EmptyLinesAroundAttributeAccessor: - Enabled: false -Layout/EndOfLine: - Enabled: false -Layout/FirstArgumentIndentation: - Enabled: false -Layout/HashAlignment: - Enabled: false -Layout/HeredocIndentation: - Enabled: false -Layout/LeadingEmptyLines: - Enabled: false -Layout/SpaceAroundMethodCallOperator: - Enabled: false -Layout/SpaceInsideArrayLiteralBrackets: - Enabled: false -Layout/SpaceInsideReferenceBrackets: - Enabled: false -Lint/BigDecimalNew: - Enabled: false -Lint/BooleanSymbol: - Enabled: false -Lint/ConstantDefinitionInBlock: - Enabled: false -Lint/DeprecatedOpenSSLConstant: - Enabled: false -Lint/DisjunctiveAssignmentInConstructor: - Enabled: false -Lint/DuplicateElsifCondition: - Enabled: false -Lint/DuplicateRequire: - Enabled: false -Lint/DuplicateRescueException: - Enabled: false -Lint/EmptyConditionalBody: - Enabled: false -Lint/EmptyFile: - Enabled: false -Lint/ErbNewArguments: - Enabled: false -Lint/FloatComparison: - Enabled: false -Lint/HashCompareByIdentity: - Enabled: false -Lint/IdentityComparison: - Enabled: false -Lint/InterpolationCheck: - Enabled: false -Lint/MissingCopEnableDirective: - Enabled: false -Lint/MixedRegexpCaptureTypes: - Enabled: false -Lint/NestedPercentLiteral: - Enabled: false -Lint/NonDeterministicRequireOrder: - Enabled: false -Lint/OrderedMagicComments: - Enabled: false -Lint/OutOfRangeRegexpRef: - Enabled: false -Lint/RaiseException: - Enabled: false -Lint/RedundantCopEnableDirective: - Enabled: false -Lint/RedundantRequireStatement: - Enabled: false -Lint/RedundantSafeNavigation: - Enabled: false -Lint/RedundantWithIndex: - Enabled: false -Lint/RedundantWithObject: - Enabled: false -Lint/RegexpAsCondition: - Enabled: false -Lint/ReturnInVoidContext: - Enabled: false -Lint/SafeNavigationConsistency: - Enabled: false -Lint/SafeNavigationWithEmpty: - Enabled: false -Lint/SelfAssignment: - Enabled: false -Lint/SendWithMixinArgument: - Enabled: false -Lint/ShadowedArgument: - Enabled: false -Lint/StructNewOverride: - Enabled: false -Lint/ToJSON: - Enabled: false -Lint/TopLevelReturnWithArgument: - Enabled: false -Lint/TrailingCommaInAttributeDeclaration: - Enabled: false -Lint/UnreachableLoop: - Enabled: false -Lint/UriEscapeUnescape: - Enabled: false -Lint/UriRegexp: - Enabled: false -Lint/UselessMethodDefinition: - Enabled: false -Lint/UselessTimes: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/BlockLength: - Enabled: false -Metrics/BlockNesting: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/ParameterLists: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Migration/DepartmentName: - Enabled: false -Naming/AccessorMethodName: - Enabled: false -Naming/BlockParameterName: - Enabled: false -Naming/HeredocDelimiterCase: - Enabled: false -Naming/HeredocDelimiterNaming: - Enabled: false -Naming/MemoizedInstanceVariableName: - Enabled: false -Naming/MethodParameterName: - Enabled: false -Naming/RescuedExceptionsVariableName: - Enabled: false -Naming/VariableNumber: - Enabled: false -Performance/BindCall: - Enabled: false -Performance/DeletePrefix: - Enabled: false -Performance/DeleteSuffix: - Enabled: false -Performance/InefficientHashSearch: - Enabled: false -Performance/UnfreezeString: - Enabled: false -Performance/UriDefaultParser: - Enabled: false -RSpec/Be: - Enabled: false -RSpec/Capybara/FeatureMethods: - Enabled: false -RSpec/ContainExactly: - Enabled: false -RSpec/ContextMethod: - Enabled: false -RSpec/ContextWording: - Enabled: false -RSpec/DescribeClass: - Enabled: false -RSpec/EmptyHook: - Enabled: false -RSpec/EmptyLineAfterExample: - Enabled: false -RSpec/EmptyLineAfterExampleGroup: - Enabled: false -RSpec/EmptyLineAfterHook: - Enabled: false -RSpec/ExampleLength: - Enabled: false -RSpec/ExampleWithoutDescription: - Enabled: false -RSpec/ExpectChange: - Enabled: false -RSpec/ExpectInHook: - Enabled: false -RSpec/FactoryBot/AttributeDefinedStatically: - Enabled: false -RSpec/FactoryBot/CreateList: - Enabled: false -RSpec/FactoryBot/FactoryClassName: - Enabled: false -RSpec/HooksBeforeExamples: - Enabled: false -RSpec/ImplicitBlockExpectation: - Enabled: false -RSpec/ImplicitSubject: - Enabled: false -RSpec/LeakyConstantDeclaration: - Enabled: false -RSpec/LetBeforeExamples: - Enabled: false -RSpec/MatchArray: - Enabled: false -RSpec/MissingExampleGroupArgument: - Enabled: false -RSpec/MultipleExpectations: - Enabled: false -RSpec/MultipleMemoizedHelpers: - Enabled: false -RSpec/MultipleSubjects: - Enabled: false -RSpec/NestedGroups: - Enabled: false -RSpec/PredicateMatcher: - Enabled: false -RSpec/ReceiveCounts: - Enabled: false -RSpec/ReceiveNever: - Enabled: false -RSpec/RepeatedExampleGroupBody: - Enabled: false -RSpec/RepeatedExampleGroupDescription: - Enabled: false -RSpec/RepeatedIncludeExample: - Enabled: false -RSpec/ReturnFromStub: - Enabled: false -RSpec/SharedExamples: - Enabled: false -RSpec/StubbedMock: - Enabled: false -RSpec/UnspecifiedException: - Enabled: false -RSpec/VariableDefinition: - Enabled: false -RSpec/VoidExpect: - Enabled: false -RSpec/Yield: - Enabled: false -Security/Open: - Enabled: false -Style/AccessModifierDeclarations: - Enabled: false -Style/AccessorGrouping: - Enabled: false -Style/BisectedAttrAccessor: - Enabled: false -Style/CaseLikeIf: - Enabled: false -Style/ClassEqualityComparison: - Enabled: false -Style/ColonMethodDefinition: - Enabled: false -Style/CombinableLoops: - Enabled: false -Style/CommentedKeyword: - Enabled: false -Style/Dir: - Enabled: false -Style/DoubleCopDisableDirective: - Enabled: false -Style/EmptyBlockParameter: - Enabled: false -Style/EmptyLambdaParameter: - Enabled: false -Style/Encoding: - Enabled: false -Style/EvalWithLocation: - Enabled: false -Style/ExpandPathArguments: - Enabled: false -Style/ExplicitBlockArgument: - Enabled: false -Style/ExponentialNotation: - Enabled: false -Style/FloatDivision: - Enabled: false -Style/FrozenStringLiteralComment: - Enabled: false -Style/GlobalStdStream: - Enabled: false -Style/HashAsLastArrayItem: - Enabled: false -Style/HashLikeCase: - Enabled: false -Style/HashTransformKeys: - Enabled: false -Style/HashTransformValues: - Enabled: false -Style/IfUnlessModifier: - Enabled: false -Style/KeywordParametersOrder: - Enabled: false -Style/MinMax: - Enabled: false -Style/MixinUsage: - Enabled: false -Style/MultilineWhenThen: - Enabled: false -Style/NegatedUnless: - Enabled: false -Style/NumericPredicate: - Enabled: false -Style/OptionalBooleanParameter: - Enabled: false -Style/OrAssignment: - Enabled: false -Style/RandomWithOffset: - Enabled: false -Style/RedundantAssignment: - Enabled: false -Style/RedundantCondition: - Enabled: false -Style/RedundantConditional: - Enabled: false -Style/RedundantFetchBlock: - Enabled: false -Style/RedundantFileExtensionInRequire: - Enabled: false -Style/RedundantRegexpCharacterClass: - Enabled: false -Style/RedundantRegexpEscape: - Enabled: false -Style/RedundantSelfAssignment: - Enabled: false -Style/RedundantSort: - Enabled: false -Style/RescueStandardError: - Enabled: false -Style/SingleArgumentDig: - Enabled: false -Style/SlicingWithRange: - Enabled: false -Style/SoleNestedConditional: - Enabled: false -Style/StderrPuts: - Enabled: false -Style/StringConcatenation: - Enabled: false -Style/Strip: - Enabled: false -Style/SymbolProc: - Enabled: false -Style/TrailingBodyOnClass: - Enabled: false -Style/TrailingBodyOnMethodDefinition: - Enabled: false -Style/TrailingBodyOnModule: - Enabled: false -Style/TrailingCommaInHashLiteral: - Enabled: false -Style/TrailingMethodEndStatement: - Enabled: false -Style/UnpackFirst: - Enabled: false -Capybara/MatchStyle: - Enabled: false -Capybara/NegationMatcher: - Enabled: false -Capybara/SpecificActions: - Enabled: false -Capybara/SpecificFinders: - Enabled: false -Capybara/SpecificMatcher: - Enabled: false -Gemspec/DeprecatedAttributeAssignment: - Enabled: false -Gemspec/DevelopmentDependencies: - Enabled: false -Gemspec/RequireMFA: - Enabled: false -Layout/LineContinuationLeadingSpace: - Enabled: false -Layout/LineContinuationSpacing: - Enabled: false -Layout/LineEndStringConcatenationIndentation: - Enabled: false -Layout/SpaceBeforeBrackets: - Enabled: false -Lint/AmbiguousAssignment: - Enabled: false -Lint/AmbiguousOperatorPrecedence: - Enabled: false -Lint/AmbiguousRange: - Enabled: false -Lint/ConstantOverwrittenInRescue: - Enabled: false -Lint/DeprecatedConstants: - Enabled: false -Lint/DuplicateBranch: - Enabled: false -Lint/DuplicateMagicComment: - Enabled: false -Lint/DuplicateMatchPattern: - Enabled: false -Lint/DuplicateRegexpCharacterClassElement: - Enabled: false -Lint/EmptyBlock: - Enabled: false -Lint/EmptyClass: - Enabled: false -Lint/EmptyInPattern: - Enabled: false -Lint/IncompatibleIoSelectWithFiberScheduler: - Enabled: false -Lint/LambdaWithoutLiteralBlock: - Enabled: false -Lint/NoReturnInBeginEndBlocks: - Enabled: false -Lint/NonAtomicFileOperation: - Enabled: false -Lint/NumberedParameterAssignment: - Enabled: false -Lint/OrAssignmentToConstant: - Enabled: false -Lint/RedundantDirGlobSort: - Enabled: false -Lint/RefinementImportMethods: - Enabled: false -Lint/RequireRangeParentheses: - Enabled: false -Lint/RequireRelativeSelfPath: - Enabled: false -Lint/SymbolConversion: - Enabled: false -Lint/ToEnumArguments: - Enabled: false -Lint/TripleQuotes: - Enabled: false -Lint/UnexpectedBlockArity: - Enabled: false -Lint/UnmodifiedReduceAccumulator: - Enabled: false -Lint/UselessRescue: - Enabled: false -Lint/UselessRuby2Keywords: - Enabled: false -Metrics/CollectionLiteralLength: - Enabled: false -Naming/BlockForwarding: - Enabled: false -Performance/CollectionLiteralInLoop: - Enabled: false -Performance/ConcurrentMonotonicTime: - Enabled: false -Performance/MapCompact: - Enabled: false -Performance/RedundantEqualityComparisonBlock: - Enabled: false -Performance/RedundantSplitRegexpArgument: - Enabled: false -Performance/StringIdentifierArgument: - Enabled: false -RSpec/BeEq: - Enabled: false -RSpec/BeNil: - Enabled: false -RSpec/ChangeByZero: - Enabled: false -RSpec/ClassCheck: - Enabled: false -RSpec/DuplicatedMetadata: - Enabled: false -RSpec/ExcessiveDocstringSpacing: - Enabled: false -RSpec/FactoryBot/ConsistentParenthesesStyle: - Enabled: false -RSpec/FactoryBot/FactoryNameStyle: - Enabled: false -RSpec/FactoryBot/SyntaxMethods: - Enabled: false -RSpec/IdenticalEqualityAssertion: - Enabled: false -RSpec/NoExpectationExample: - Enabled: false -RSpec/PendingWithoutReason: - Enabled: false -RSpec/Rails/AvoidSetupHook: - Enabled: false -RSpec/Rails/HaveHttpStatus: - Enabled: false -RSpec/Rails/InferredSpecType: - Enabled: false -RSpec/Rails/MinitestAssertions: - Enabled: false -RSpec/Rails/TravelAround: - Enabled: false -RSpec/RedundantAround: - Enabled: false -RSpec/SkipBlockInsideExample: - Enabled: false -RSpec/SortMetadata: - Enabled: false -RSpec/SubjectDeclaration: - Enabled: false -RSpec/VerifiedDoubleReference: - Enabled: false -Security/CompoundHash: - Enabled: false -Security/IoMethods: - Enabled: false -Style/ArgumentsForwarding: - Enabled: false -Style/ArrayIntersect: - Enabled: false -Style/CollectionCompact: - Enabled: false -Style/ComparableClamp: - Enabled: false -Style/ConcatArrayLiterals: - Enabled: false -Style/DataInheritance: - Enabled: false -Style/DirEmpty: - Enabled: false -Style/DocumentDynamicEvalDefinition: - Enabled: false -Style/EmptyHeredoc: - Enabled: false -Style/EndlessMethod: - Enabled: false -Style/EnvHome: - Enabled: false -Style/FetchEnvVar: - Enabled: false -Style/FileEmpty: - Enabled: false -Style/FileRead: - Enabled: false -Style/FileWrite: - Enabled: false -Style/HashConversion: - Enabled: false -Style/HashExcept: - Enabled: false -Style/IfWithBooleanLiteralBranches: - Enabled: false -Style/InPatternThen: - Enabled: false -Style/MagicCommentFormat: - Enabled: false -Style/MapCompactWithConditionalBlock: - Enabled: false -Style/MapToHash: - Enabled: false -Style/MapToSet: - Enabled: false -Style/MinMaxComparison: - Enabled: false -Style/MultilineInPatternThen: - Enabled: false -Style/NegatedIfElseCondition: - Enabled: false -Style/NestedFileDirname: - Enabled: false -Style/NilLambda: - Enabled: false -Style/NumberedParameters: - Enabled: false -Style/NumberedParametersLimit: - Enabled: false -Style/ObjectThen: - Enabled: false -Style/OpenStructUse: - Enabled: false -Style/OperatorMethodCall: - Enabled: false -Style/QuotedSymbols: - Enabled: false -Style/RedundantArgument: - Enabled: false -Style/RedundantConstantBase: - Enabled: false -Style/RedundantDoubleSplatHashBraces: - Enabled: false -Style/RedundantEach: - Enabled: false -Style/RedundantHeredocDelimiterQuotes: - Enabled: false -Style/RedundantInitialize: - Enabled: false -Style/RedundantLineContinuation: - Enabled: false -Style/RedundantSelfAssignmentBranch: - Enabled: false -Style/RedundantStringEscape: - Enabled: false -Style/SelectByRegexp: - Enabled: false -Style/StringChars: - Enabled: false -Style/SwapValues: - Enabled: false diff --git a/Gemfile b/Gemfile index abdc6e5d6..64d16dbc2 100644 --- a/Gemfile +++ b/Gemfile @@ -61,7 +61,7 @@ group :development do end end group :development, :release_prep do - if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('2.7') + if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') gem "puppetlabs_spec_helper", '~> 5.0.3', require: false gem "puppet-blacksmith", '= 6.1.1', require: false gem "puppet-strings", '= 2.9.0', require: false @@ -72,7 +72,7 @@ group :development, :release_prep do end end group :system_tests do - if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('2.7') + if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') gem "puppet_litmus", '~> 0.36.2', require: false, platforms: [:ruby, :x64_mingw] else gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] diff --git a/Gemfile.lock b/Gemfile.lock index b2752709c..d02acffb7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.7) - base64 - nkf - rexml + CFPropertyList (2.3.6) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ansi (1.5.0) @@ -54,6 +51,7 @@ GEM coderay (1.1.3) colored2 (3.1.2) concurrent-ruby (1.3.5) + connection_pool (2.5.0) cri (2.15.12) deep_merge (1.2.2) dependency_checker (0.3.0) @@ -66,38 +64,41 @@ GEM docker-api (2.4.0) excon (>= 0.64.0) multi_json - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) + domain_name (0.6.20240107) ed25519 (1.3.0) erubi (1.13.1) - excon (0.109.0) + excon (1.2.3) facter (4.10.0) hocon (~> 1.3) thor (>= 1.0.1, < 1.3) - facterdb (1.21.0) + facterdb (1.27.0) facter (< 5.0.0) - jgrep - faraday (1.10.4) + jgrep (~> 1.5, >= 1.5.4) + faraday (1.9.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) + faraday-httpclient (< 3) faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) + faraday-net_http (< 3) + faraday-net_http_persistent (< 3) + faraday-patron (< 3) faraday-rack (~> 1.0) faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) - faraday-httpclient (1.0.1) + faraday-httpclient (2.0.1) + httpclient (>= 2.2) faraday-multipart (1.1.0) multipart-post (~> 2.0) - faraday-net_http (1.0.2) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) + faraday-net_http (2.1.0) + faraday-net_http_persistent (2.0.2) + faraday-net_http (< 3) + net-http-persistent (~> 4.0) + faraday-patron (2.0.1) + patron (>= 0.4.2) faraday-rack (1.0.0) faraday-retry (1.0.3) faraday_middleware (1.2.1) @@ -146,7 +147,7 @@ GEM io-console (0.5.9) jgrep (1.5.4) jmespath (1.6.2) - json (2.1.0) + json (2.3.0) json-schema (4.3.1) addressable (>= 2.8) jwt (2.7.1) @@ -203,6 +204,8 @@ GEM molinillo (0.8.0) multi_json (1.15.0) multipart-post (2.4.1) + net-http-persistent (4.0.5) + connection_pool (~> 2.2) net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) net-ssh (6.1.0) @@ -213,7 +216,6 @@ GEM net-ssh (>= 2.0) net-telnet (0.2.0) netrc (0.11.0) - nkf (0.2.0) nori (2.6.0) optimist (3.2.0) orchestrator_client (0.7.1) @@ -227,7 +229,8 @@ GEM racc pastel (0.8.0) tty-color (~> 0.5) - pathspec (1.0.0) + pathspec (1.1.3) + patron (0.13.3) pluginator (1.5.0) prime (0.1.3) forwardable @@ -247,6 +250,18 @@ GEM puppet-resource_api (~> 1.5) scanf (~> 1.0) semantic_puppet (~> 1.0) + puppet (7.34.0-universal-darwin) + CFPropertyList (~> 2.2) + concurrent-ruby (~> 1.0) + deep_merge (~> 1.0) + facter (> 2.0.1, < 5) + fast_gettext (>= 1.1, < 3) + hiera (>= 3.2.1, < 4) + locale (~> 2.1) + multi_json (~> 1.10) + puppet-resource_api (~> 1.5) + scanf (~> 1.0) + semantic_puppet (~> 1.0) puppet-blacksmith (6.1.1) puppet-modulebuilder (~> 0.2) rest-client (~> 2.0) @@ -341,7 +356,7 @@ GEM minitar (~> 0.9) multi_json (~> 1.10) puppet_forge (>= 2.3.0, < 4.0.0) - racc (1.8.1) + racc (1.4.16) rainbow (3.1.1) rake (13.2.1) rb-readline (0.5.5) @@ -383,18 +398,19 @@ GEM honeycomb-beeline rspec-core (~> 3.0) rsync (1.0.9) - rubocop (1.31.0) + rubocop (1.50.2) + json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.18.0, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-performance (1.17.1) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.38.0) + parser (>= 3.3.1.0) + rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rspec (2.10.0) @@ -478,7 +494,6 @@ GEM tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) - unf (0.2.0) unicode-display_width (2.6.0) unicode_utils (1.4.0) voxpupuli-puppet-lint-plugins (4.0.0) @@ -523,6 +538,8 @@ GEM yard (0.9.37) PLATFORMS + arm64-darwin-21 + arm64-darwin-24 x86_64-linux DEPENDENCIES @@ -532,7 +549,7 @@ DEPENDENCIES dependency_checker (= 0.3.0) facterdb (~> 1.21) io-console (= 0.5.9) - json (= 2.1.0) + json (= 2.3.0) kitchen-docker kitchen-puppet kitchen-verifier-serverspec @@ -547,6 +564,7 @@ DEPENDENCIES puppet-strings (= 2.9.0) puppet_litmus (~> 0.36.2) puppetlabs_spec_helper (~> 5.0.3) + racc (~> 1.4.0) rb-readline (= 0.5.5) rexml (>= 3.0.0, < 3.2.7) rspec-puppet-facts (~> 1.10.0) From d04904580c418960ea92d58816a5e9d4f18ecfe1 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 31 Jan 2025 12:09:56 -0500 Subject: [PATCH 041/133] update Gemfile.lock --- .circleci/config.yml | 6 +++--- Gemfile.lock | 51 ++++++++++++++++++-------------------------- 2 files changed, 24 insertions(+), 33 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53d542214..cf5c78369 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,7 @@ jobs: command: rvm install $RUBY_VERSION - run: name: Install bundler - command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 + command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' && gem install bundler:2.4.13 - run: name: Install gem dependencies command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle @@ -99,7 +99,7 @@ jobs: command: rvm install $RUBY_VERSION - run: name: Install bundler - command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 + command: rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' && gem install bundler:2.4.13 - run: name: Install gem dependencies command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle @@ -125,7 +125,7 @@ jobs: command: rvm install $RUBY_VERSION - run: name: Install bundler - command: rvm $RUBY_VERSION --verbose do bundle config set --local path '.bundle' && gem install bundler:2.4.13 + command: rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' && gem install bundler:2.4.13 - run: name: Install gem dependencies command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle diff --git a/Gemfile.lock b/Gemfile.lock index d02acffb7..47b42b06a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,10 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.3.6) + CFPropertyList (3.0.7) + base64 + nkf + rexml addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ansi (1.5.0) @@ -105,7 +108,7 @@ GEM faraday (~> 1.0) fast_gettext (2.4.0) prime - ffi (1.17.1) + ffi (1.17.1-arm64-darwin) ffi-compiler (1.3.2) ffi (>= 1.15.5) rake @@ -160,6 +163,7 @@ GEM kitchen-verifier-serverspec (0.7.2) net-ssh (>= 3) test-kitchen (>= 1.4) + language_server-protocol (3.17.0.4) libhoney (2.4.0) addressable (~> 2.0) excon @@ -216,12 +220,13 @@ GEM net-ssh (>= 2.0) net-telnet (0.2.0) netrc (0.11.0) + nkf (0.2.0) nori (2.6.0) optimist (3.2.0) orchestrator_client (0.7.1) faraday (>= 1.4, < 3.0) faraday-net_http_persistent (>= 1.0, < 3.0) - parallel (1.24.0) + parallel (1.26.3) parallel_tests (3.12.1) parallel parser (3.3.7.0) @@ -250,30 +255,18 @@ GEM puppet-resource_api (~> 1.5) scanf (~> 1.0) semantic_puppet (~> 1.0) - puppet (7.34.0-universal-darwin) - CFPropertyList (~> 2.2) - concurrent-ruby (~> 1.0) - deep_merge (~> 1.0) - facter (> 2.0.1, < 5) - fast_gettext (>= 1.1, < 3) - hiera (>= 3.2.1, < 4) - locale (~> 2.1) - multi_json (~> 1.10) - puppet-resource_api (~> 1.5) - scanf (~> 1.0) - semantic_puppet (~> 1.0) puppet-blacksmith (6.1.1) puppet-modulebuilder (~> 0.2) rest-client (~> 2.0) - puppet-debugger (1.3.0) + puppet-debugger (1.4.0) awesome_print (~> 1.7) bundler facterdb (>= 0.4.0) pluginator (~> 1.5.0) - puppet (>= 5.5) + puppet (>= 6) rb-readline (>= 0.5.5) table_print (>= 1.0.0) - tty-pager (~> 0.13) + tty-pager (~> 0.14) puppet-lint (3.4.0) puppet-lint-absolute_classname-check (3.1.0) puppet-lint (>= 1.0, < 4) @@ -398,21 +391,21 @@ GEM honeycomb-beeline rspec-core (~> 3.0) rsync (1.0.9) - rubocop (1.50.2) + rubocop (1.71.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) + unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.38.0) parser (>= 3.3.1.0) - rubocop-performance (1.16.0) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + rubocop-performance (1.23.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-rspec (2.10.0) rubocop (~> 1.19) ruby-progressbar (1.13.0) @@ -425,7 +418,7 @@ GEM base64 rubyzip (2.4.1) scanf (1.0.0) - semantic_puppet (1.0.4) + semantic_puppet (1.1.1) serverspec (2.42.3) multi_json rspec (~> 3.0) @@ -539,8 +532,6 @@ GEM PLATFORMS arm64-darwin-21 - arm64-darwin-24 - x86_64-linux DEPENDENCIES CFPropertyList (< 3.0.7) From b774e197f88512b539a584ccc4b2367dccb0575f Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 31 Jan 2025 12:51:44 -0500 Subject: [PATCH 042/133] debug bundler version --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf5c78369..d8c754b3d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,7 +99,13 @@ jobs: command: rvm install $RUBY_VERSION - run: name: Install bundler - command: rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' && gem install bundler:2.4.13 + command: | + rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' && gem install bundler:2.4.13 + ruby --version + bundler --version + export PATH=$GEM_HOME/bin:$PATH + ruby --version + bundler --version - run: name: Install gem dependencies command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle From 9e4ac835cea3c7d302218d529c4ae7f2f4fe0a0d Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 31 Jan 2025 15:54:17 -0500 Subject: [PATCH 043/133] add linux deps for ci --- .circleci/config.yml | 131 ++++++++++++++++++++++-------- Gemfile | 4 +- Gemfile.lock | 189 +++++++++++++++++++------------------------ 3 files changed, 184 insertions(+), 140 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d8c754b3d..e079f0498 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,6 +11,12 @@ jobs: PUPPET_VERSION: '6.5.0' steps: - checkout + - run: + name: Install libcurl4 and openssl + command: | + # Needed to bundle install a puppet_litmus gem dependency + sudo apt update + sudo apt install -y libcurl4 curl libcurl4-openssl-dev - run: name: Install RVM command: | @@ -21,7 +27,16 @@ jobs: command: rvm install $RUBY_VERSION - run: name: Install bundler - command: rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' && gem install bundler:2.4.13 + command: | + rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' + rvm $RUBY_VERSION --verbose do gem install bundler:2.4.13 + rvm $RUBY_VERSION --verbose do bundle -v + - run: + name: Install gem dependencies + command: | + rvm $RUBY_VERSION --verbose do bundle -v + rvm $RUBY_VERSION --verbose do bundle install + - run: name: Install gem dependencies command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle @@ -50,37 +65,65 @@ jobs: RUBY_VERSION: '2.7.5' PUPPET_VERSION: '7.25.0' - specs-ruby31-puppet734: + specs-ruby26-puppet65: <<: *specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '3.0.0' - PUPPET_VERSION: '7.34.0' + RUBY_VERSION: '2.6.3' + PUPPET_VERSION: '6.5.0' - specs-ruby27-puppet79-windows: - # &windows-specs - executor: - name: win/default - shell: bash.exe - steps: - - checkout - - run: - name: Run tests - command: | - set -e - choco install ruby --allow-downgrade -y --version=2.7.5.1 # Keep version in sync with next command! - export PATH=/c/tools/ruby27/bin:$PATH # Make Ruby 2.7 take precedence over the pre-installed version - ruby --version - choco install msys2 -y - ridk.cmd exec pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain - gem install bundler -v 2.4.13 - rm Gemfile.lock && bundle install --path .bundle - bundle exec rake test + specs-ruby26-puppet79: + <<: *specs environment: STRICT_VARIABLES: 'yes' - #RUBY_VERSION hardcoded in install script + RUBY_VERSION: '2.6.3' PUPPET_VERSION: '7.9.0' + specs-ruby26-puppet714: + <<: *specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '2.6.3' + PUPPET_VERSION: '7.14.0' + + specs-ruby26-puppet725: + <<: *specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '2.6.3' + PUPPET_VERSION: '7.25.0' + + specs-ruby31-puppet734: + <<: *specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '3.0.0' + PUPPET_VERSION: '7.34.0' + + # specs-ruby27-puppet79-windows: + # # &windows-specs + # executor: + # name: win/default + # shell: bash.exe + # steps: + # - checkout + # - run: + # name: Run tests + # command: | + # set -e + # choco install ruby --allow-downgrade -y --version=2.7.5.1 # Keep version in sync with next command! + # export PATH=/c/tools/ruby27/bin:$PATH # Make Ruby 2.7 take precedence over the pre-installed version + # ruby --version + # choco install msys2 -y + # ridk.cmd exec pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain + # gem install bundler -v 2.4.13 + # rm Gemfile.lock && bundle install --path .bundle + # bundle exec rake test + # environment: + # STRICT_VARIABLES: 'yes' + # #RUBY_VERSION hardcoded in install script + # PUPPET_VERSION: '7.9.0' + verify-gemfile-lock-dependencies: machine: image: ubuntu-2004:2024.08.1 @@ -89,6 +132,12 @@ jobs: RUBY_VERSION: '2.7.5' steps: - checkout + - run: + name: Install libcurl4 and openssl + command: | + # Needed to bundle install a puppet_litmus gem dependency + sudo apt update + sudo apt install -y libcurl4 curl libcurl4-openssl-dev - run: name: Install RVM command: | @@ -100,15 +149,14 @@ jobs: - run: name: Install bundler command: | - rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' && gem install bundler:2.4.13 - ruby --version - bundler --version - export PATH=$GEM_HOME/bin:$PATH - ruby --version - bundler --version + rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' + rvm $RUBY_VERSION --verbose do gem install bundler:2.4.13 + rvm $RUBY_VERSION --verbose do bundle -v - run: name: Install gem dependencies - command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle + command: | + rvm $RUBY_VERSION --verbose do bundle -v + rvm $RUBY_VERSION --verbose do bundle install - run: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test @@ -121,6 +169,12 @@ jobs: RUBY_VERSION: '2.7.5' steps: - checkout + - run: + name: Install libcurl4 and openssl + command: | + # Needed to bundle install a puppet_litmus gem dependency + sudo apt update + sudo apt install -y libcurl4 curl libcurl4-openssl-dev - run: name: Install RVM command: | @@ -131,10 +185,15 @@ jobs: command: rvm install $RUBY_VERSION - run: name: Install bundler - command: rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' && gem install bundler:2.4.13 + command: | + rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' + rvm $RUBY_VERSION --verbose do gem install bundler:2.4.13 + rvm $RUBY_VERSION --verbose do bundle -v - run: name: Install gem dependencies - command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle + command: | + rvm $RUBY_VERSION --verbose do bundle -v + rvm $RUBY_VERSION --verbose do bundle install - run: name: Execute Kitchen tests command: rvm $RUBY_VERSION --verbose do bundle exec rake circle @@ -143,7 +202,11 @@ jobs: workflows: build_and_test: jobs: - - specs-ruby27-puppet79-windows + - specs-ruby26-puppet65 + - specs-ruby26-puppet79 + - specs-ruby26-puppet714 + - specs-ruby26-puppet725 + # - specs-ruby27-puppet79-windows # puppet_litmus requires a dependency patron, which doesn't run on windows - specs-ruby27-puppet65 - specs-ruby27-puppet79 - specs-ruby27-puppet714 diff --git a/Gemfile b/Gemfile index 64d16dbc2..57059192f 100644 --- a/Gemfile +++ b/Gemfile @@ -35,7 +35,7 @@ group :development do gem "rexml", '>= 3.0.0', '< 3.2.7', require: false gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') - gem "test-kitchen", '~> 3.0.0', platforms: [:ruby] + gem "test-kitchen", '= 3.0.0', platforms: [:ruby] gem "rubocop", '~> 1.19', require: false gem "rubocop-rspec", '= 2.10.0', require: false gem "facterdb", '~> 1.21', require: false @@ -73,7 +73,7 @@ group :development, :release_prep do end group :system_tests do if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') - gem "puppet_litmus", '~> 0.36.2', require: false, platforms: [:ruby, :x64_mingw] + gem "puppet_litmus", '= 0.0.1', require: false, platforms: [:ruby, :x64_mingw] else gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] end diff --git a/Gemfile.lock b/Gemfile.lock index 47b42b06a..0476f16ce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.7) - base64 - nkf - rexml + CFPropertyList (2.3.6) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ansi (1.5.0) @@ -25,35 +22,34 @@ GEM base64 (0.2.0) bcrypt_pbkdf (1.0.1) bindata (2.5.0) - bolt (3.30.0) - CFPropertyList (>= 2.2) + bolt (1.49.0) + CFPropertyList (~> 2.2) addressable (~> 2.5) aws-sdk-ec2 (~> 1) concurrent-ruby (~> 1.0) - ffi (>= 1.9.25, < 2.0.0) hiera-eyaml (~> 3) - jwt (~> 2.2) logging (~> 2.2) minitar (~> 0.6) - net-scp (>= 1.2, < 5.0) - net-ssh (>= 4.0, < 8.0) + net-scp (~> 1.2) + net-ssh (>= 4.0) net-ssh-krb (~> 0.5) - orchestrator_client (~> 0.5) - puppet (>= 6.18.0) + orchestrator_client (~> 0.4) + puppet (>= 6.11.0, < 7) puppet-resource_api (>= 1.8.1) - puppet-strings (>= 2.3.0, < 5.0) - puppetfile-resolver (>= 0.6.2, < 1.0) - r10k (~> 3.10) + puppet-strings (~> 2.3) + r10k (~> 3.1) ruby_smb (~> 1.0) - terminal-table (~> 3.0) + terminal-table (~> 1.8) winrm (~> 2.0) winrm-fs (~> 1.3) builder (3.3.0) chef-utils (18.6.2) concurrent-ruby + childprocess (0.7.1) + ffi (~> 1.0, >= 1.0.11) coderay (1.1.3) colored2 (3.1.2) - concurrent-ruby (1.3.5) + concurrent-ruby (1.1.10) connection_pool (2.5.0) cri (2.15.12) deep_merge (1.2.2) @@ -62,18 +58,14 @@ GEM puppet_forge (>= 2.2, < 4.0) rake (~> 13.0) semantic_puppet (~> 1.0) - diff-lcs (1.5.1) + diff-lcs (1.3) docile (1.4.1) - docker-api (2.4.0) - excon (>= 0.64.0) - multi_json domain_name (0.6.20240107) ed25519 (1.3.0) erubi (1.13.1) - excon (1.2.3) - facter (4.10.0) - hocon (~> 1.3) - thor (>= 1.0.1, < 1.3) + facter (2.5.7) + facter (2.5.7-universal-darwin) + CFPropertyList (~> 2.2) facterdb (1.27.0) facter (< 5.0.0) jgrep (~> 1.5, >= 1.5.4) @@ -106,22 +98,14 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.1) faraday (~> 1.0) - fast_gettext (2.4.0) - prime - ffi (1.17.1-arm64-darwin) - ffi-compiler (1.3.2) - ffi (>= 1.15.5) - rake - forwardable (1.3.3) - gettext (3.5.1) - erubi + fast_gettext (1.1.2) + ffi (1.17.1) + gettext (3.2.9) locale (>= 2.0.5) - prime - racc text (>= 1.3.0) - gettext-setup (1.1.0) - fast_gettext (~> 2.1) - gettext (~> 3.4) + gettext-setup (0.34) + fast_gettext (~> 1.1.0) + gettext (>= 3.0.2, < 3.3.0) locale gssapi (1.3.1) ffi (>= 1.0.1) @@ -133,26 +117,19 @@ GEM highline optimist highline (2.1.0) + hitimes (1.3.0) hocon (1.4.0) - honeycomb-beeline (3.1.0) - libhoney (>= 2.3.0) - http (5.2.0) - addressable (~> 2.8) - base64 (~> 0.1) - http-cookie (~> 1.0) - http-form_data (~> 2.2) - llhttp-ffi (~> 0.5.0) http-accept (1.7.0) http-cookie (1.0.8) domain_name (~> 0.5) - http-form_data (2.3.0) httpclient (2.8.3) io-console (0.5.9) jgrep (1.5.4) jmespath (1.6.2) json (2.3.0) - json-schema (4.3.1) - addressable (>= 2.8) + json-schema (2.8.0) + addressable (>= 2.4) + json_pure (2.1.0) jwt (2.7.1) kitchen-docker (3.0.0) test-kitchen (>= 1.0.0) @@ -163,11 +140,6 @@ GEM kitchen-verifier-serverspec (0.7.2) net-ssh (>= 3) test-kitchen (>= 1.4) - language_server-protocol (3.17.0.4) - libhoney (2.4.0) - addressable (~> 2.0) - excon - http (>= 2.0, < 6.0) librarian-puppet (4.0.1) librarianp (>= 0.6.3) puppet_forge (>= 2.1, < 4) @@ -180,9 +152,6 @@ GEM tty-box (~> 0.6) tty-prompt (~> 0.20) little-plugger (1.1.4) - llhttp-ffi (0.5.0) - ffi-compiler (~> 1.0) - rake (~> 13.0) locale (2.1.4) log4r (1.1.10) logger (1.6.5) @@ -205,13 +174,12 @@ GEM mixlib-shellout (2.2.7) mixlib-versioning (1.2.12) mocha (1.16.1) - molinillo (0.8.0) multi_json (1.15.0) multipart-post (2.4.1) net-http-persistent (4.0.5) connection_pool (~> 2.2) - net-scp (3.0.0) - net-ssh (>= 2.6.5, < 7.0.0) + net-scp (1.2.1) + net-ssh (>= 2.6.5) net-ssh (6.1.0) net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) @@ -220,7 +188,6 @@ GEM net-ssh (>= 2.0) net-telnet (0.2.0) netrc (0.11.0) - nkf (0.2.0) nori (2.6.0) optimist (3.2.0) orchestrator_client (0.7.1) @@ -234,26 +201,54 @@ GEM racc pastel (0.8.0) tty-color (~> 0.5) - pathspec (1.1.3) + pathspec (0.2.1) patron (0.13.3) + pdk (1.18.1) + bundler (>= 1.15.0, < 3.0.0) + childprocess (~> 0.7.1) + concurrent-ruby (~> 1.1.5) + cri (~> 2.10) + deep_merge (~> 1.1) + diff-lcs (= 1.3) + facter (~> 2.5.1) + ffi (>= 1.9.25, < 2.0.0) + gettext-setup (~> 0.24) + hitimes (= 1.3.0) + httpclient (~> 2.8.3) + json-schema (= 2.8.0) + json_pure (~> 2.1.0) + minitar (~> 0.6) + pathspec (~> 0.2.1) + tty-prompt (~> 0.13) + tty-spinner (~> 0.5) + tty-which (~> 0.3) pluginator (1.5.0) - prime (0.1.3) - forwardable - singleton pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) public_suffix (5.1.1) - puppet (7.34.0) - concurrent-ruby (~> 1.0) + puppet (6.29.0) + concurrent-ruby (~> 1.0, < 1.2.0) + deep_merge (~> 1.0) + facter (> 2.0.1, < 5) + fast_gettext (~> 1.1) + hiera (>= 3.2.1, < 4) + httpclient (~> 2.8) + locale (~> 2.1) + multi_json (~> 1.10) + puppet-resource_api (~> 1.5) + semantic_puppet (~> 1.0) + puppet (6.29.0-universal-darwin) + CFPropertyList (~> 2.2) + concurrent-ruby (~> 1.0, < 1.2.0) deep_merge (~> 1.0) facter (> 2.0.1, < 5) - fast_gettext (>= 1.1, < 3) + fast_gettext (~> 1.1) hiera (>= 3.2.1, < 4) + httpclient (~> 2.8) locale (~> 2.1) multi_json (~> 1.10) puppet-resource_api (~> 1.5) - scanf (~> 1.0) semantic_puppet (~> 1.0) puppet-blacksmith (6.1.1) puppet-modulebuilder (~> 0.2) @@ -318,19 +313,9 @@ GEM faraday_middleware (~> 1.0) minitar semantic_puppet (~> 1.0) - puppet_litmus (0.36.2) - bolt (~> 3.0) - docker-api (>= 1.34, < 3.0.0) - honeycomb-beeline - parallel - puppet-modulebuilder (>= 0.2.1, < 1.0.0) - retryable (~> 3.0) - rspec - rspec_honeycomb_formatter - tty-spinner (>= 0.5.0, < 1.0.0) - puppetfile-resolver (0.6.3) - molinillo (~> 0.6) - semantic_puppet (~> 1.0) + puppet_litmus (0.0.1) + bolt (>= 1.13.1, < 2.0.0) + pdk (>= 1.10.0, < 2.0.0) puppetlabs_spec_helper (5.0.3) mocha (~> 1.0) pathspec (>= 0.2, < 2.0.0) @@ -359,7 +344,6 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - retryable (3.0.5) rexml (3.2.6) rgen (0.10.2) rspec (3.13.0) @@ -387,25 +371,22 @@ GEM json puppet rspec-support (3.13.2) - rspec_honeycomb_formatter (0.2.1) - honeycomb-beeline - rspec-core (~> 3.0) rsync (1.0.9) - rubocop (1.71.1) + rubocop (1.42.0) json (~> 2.3) - language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.3.0.2) + parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.38.0, < 2.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 4.0) + unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.38.0) parser (>= 3.3.1.0) - rubocop-performance (1.23.1) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-performance (1.19.1) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) rubocop-rspec (2.10.0) rubocop (~> 1.19) ruby-progressbar (1.13.0) @@ -417,7 +398,6 @@ GEM rubyntlm (0.6.5) base64 rubyzip (2.4.1) - scanf (1.0.0) semantic_puppet (1.1.1) serverspec (2.42.3) multi_json @@ -435,7 +415,6 @@ GEM terminal-table simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) - singleton (0.3.0) spdx-licenses (1.3.0) specinfra (2.91.0) base64 @@ -449,8 +428,8 @@ GEM unicode_utils (~> 1.4) strings-ansi (0.2.0) table_print (1.5.7) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) test-kitchen (3.0.0) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) @@ -466,7 +445,7 @@ GEM winrm-elevated (~> 1.0) winrm-fs (~> 1.1) text (1.3.1) - thor (1.2.2) + thor (1.3.2) tomlrb (2.0.3) tty-box (0.7.0) pastel (~> 0.8) @@ -487,7 +466,8 @@ GEM tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) - unicode-display_width (2.6.0) + tty-which (0.5.0) + unicode-display_width (1.8.0) unicode_utils (1.4.0) voxpupuli-puppet-lint-plugins (4.0.0) puppet-lint (~> 3.1) @@ -532,6 +512,7 @@ GEM PLATFORMS arm64-darwin-21 + x86_64-linux DEPENDENCIES CFPropertyList (< 3.0.7) @@ -553,7 +534,7 @@ DEPENDENCIES puppet-blacksmith (= 6.1.1) puppet-debugger (~> 1.0) puppet-strings (= 2.9.0) - puppet_litmus (~> 0.36.2) + puppet_litmus (= 0.0.1) puppetlabs_spec_helper (~> 5.0.3) racc (~> 1.4.0) rb-readline (= 0.5.5) @@ -564,7 +545,7 @@ DEPENDENCIES rubocop-rspec (= 2.10.0) serverspec (~> 2.41) simplecov-console (~> 0.9) - test-kitchen (~> 3.0.0) + test-kitchen (= 3.0.0) voxpupuli-puppet-lint-plugins (~> 4.0) BUNDLED WITH From b47a62b4eda1a2d8c451ec84cde15828a25df86c Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 31 Jan 2025 16:36:22 -0500 Subject: [PATCH 044/133] config.yml cleanup --- .circleci/config.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e079f0498..281a624b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: name: Install libcurl4 and openssl command: | # Needed to bundle install a puppet_litmus gem dependency - sudo apt update + sudo apt update -y sudo apt install -y libcurl4 curl libcurl4-openssl-dev - run: name: Install RVM @@ -30,16 +30,9 @@ jobs: command: | rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' rvm $RUBY_VERSION --verbose do gem install bundler:2.4.13 - rvm $RUBY_VERSION --verbose do bundle -v - - run: - name: Install gem dependencies - command: | - rvm $RUBY_VERSION --verbose do bundle -v - rvm $RUBY_VERSION --verbose do bundle install - - run: name: Install gem dependencies - command: rvm $RUBY_VERSION --verbose do bundle install --path .bundle + command: rvm $RUBY_VERSION --verbose do bundle install - run: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test @@ -136,7 +129,7 @@ jobs: name: Install libcurl4 and openssl command: | # Needed to bundle install a puppet_litmus gem dependency - sudo apt update + sudo apt update -y sudo apt install -y libcurl4 curl libcurl4-openssl-dev - run: name: Install RVM @@ -151,12 +144,9 @@ jobs: command: | rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' rvm $RUBY_VERSION --verbose do gem install bundler:2.4.13 - rvm $RUBY_VERSION --verbose do bundle -v - run: name: Install gem dependencies - command: | - rvm $RUBY_VERSION --verbose do bundle -v - rvm $RUBY_VERSION --verbose do bundle install + command: rvm $RUBY_VERSION --verbose do bundle install - run: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test @@ -188,12 +178,9 @@ jobs: command: | rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' rvm $RUBY_VERSION --verbose do gem install bundler:2.4.13 - rvm $RUBY_VERSION --verbose do bundle -v - run: name: Install gem dependencies - command: | - rvm $RUBY_VERSION --verbose do bundle -v - rvm $RUBY_VERSION --verbose do bundle install + command: rvm $RUBY_VERSION --verbose do bundle install - run: name: Execute Kitchen tests command: rvm $RUBY_VERSION --verbose do bundle exec rake circle @@ -206,7 +193,7 @@ workflows: - specs-ruby26-puppet79 - specs-ruby26-puppet714 - specs-ruby26-puppet725 - # - specs-ruby27-puppet79-windows # puppet_litmus requires a dependency patron, which doesn't run on windows + # - specs-ruby27-puppet79-windows # puppet_litmus requires a dependency "patron", which doesn't run on windows - specs-ruby27-puppet65 - specs-ruby27-puppet79 - specs-ruby27-puppet714 From c66d7515d3d33094bdd12c0b93e86717c1b75f68 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Mon, 3 Feb 2025 18:05:59 -0500 Subject: [PATCH 045/133] review suggestions --- .gitignore | 1 - .pdkignore | 1 - .rubocop | 1 + .rubocop.yml | 619 +++++++++++++++++++++++++++++++++++++++- .vscode/extensions.json | 6 + Gemfile | 2 +- Gemfile.lock | 71 +++-- 7 files changed, 668 insertions(+), 33 deletions(-) create mode 100644 .rubocop create mode 100644 .vscode/extensions.json diff --git a/.gitignore b/.gitignore index 7937e9d54..40fdc6aa1 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,6 @@ environments/**/.vagrant /inventory.yaml .kitchen -.vscode /spec/fixtures/litmus_inventory.yaml .resource_types diff --git a/.pdkignore b/.pdkignore index a9d5282b0..21e52a2a1 100644 --- a/.pdkignore +++ b/.pdkignore @@ -50,7 +50,6 @@ bolt-debug.log /..yml /.yardopts /spec/ -/.vscode/ /.sync.yml /.devcontainer/ /.github/ diff --git a/.rubocop b/.rubocop new file mode 100644 index 000000000..55d3c4ae1 --- /dev/null +++ b/.rubocop @@ -0,0 +1 @@ +--ignore-unrecognized-cops \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index 5fcf67c13..df7937e05 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,10 +3,9 @@ require: - rubocop-performance - rubocop-rspec AllCops: - DisabledByDefault: true NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.6' + TargetRubyVersion: '2.7' Include: - "**/*.rb" Exclude: @@ -106,3 +105,619 @@ Style/MethodCalledOnDoEndBlock: Enabled: true Style/StringMethods: Enabled: true +Bundler/GemFilename: + Enabled: false +Bundler/InsecureProtocolSource: + Enabled: false +Capybara/CurrentPathExpectation: + Enabled: false +Capybara/VisibilityMatcher: + Enabled: false +Gemspec/DuplicatedAssignment: + Enabled: false +Gemspec/OrderedDependencies: + Enabled: false +Gemspec/RequiredRubyVersion: + Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false +Layout/ArgumentAlignment: + Enabled: false +Layout/BeginEndAlignment: + Enabled: false +Layout/ClosingHeredocIndentation: + Enabled: false +Layout/EmptyComment: + Enabled: false +Layout/EmptyLineAfterGuardClause: + Enabled: false +Layout/EmptyLinesAroundArguments: + Enabled: false +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false +Layout/EndOfLine: + Enabled: false +Layout/FirstArgumentIndentation: + Enabled: false +Layout/HashAlignment: + Enabled: false +Layout/HeredocIndentation: + Enabled: false +Layout/LeadingEmptyLines: + Enabled: false +Layout/SpaceAroundMethodCallOperator: + Enabled: false +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false +Layout/SpaceInsideReferenceBrackets: + Enabled: false +Lint/BigDecimalNew: + Enabled: false +Lint/BooleanSymbol: + Enabled: false +Lint/ConstantDefinitionInBlock: + Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false +Lint/DisjunctiveAssignmentInConstructor: + Enabled: false +Lint/DuplicateElsifCondition: + Enabled: false +Lint/DuplicateRequire: + Enabled: false +Lint/DuplicateRescueException: + Enabled: false +Lint/EmptyConditionalBody: + Enabled: false +Lint/EmptyFile: + Enabled: false +Lint/ErbNewArguments: + Enabled: false +Lint/FloatComparison: + Enabled: false +Lint/HashCompareByIdentity: + Enabled: false +Lint/IdentityComparison: + Enabled: false +Lint/InterpolationCheck: + Enabled: false +Lint/MissingCopEnableDirective: + Enabled: false +Lint/MixedRegexpCaptureTypes: + Enabled: false +Lint/NestedPercentLiteral: + Enabled: false +Lint/NonDeterministicRequireOrder: + Enabled: false +Lint/OrderedMagicComments: + Enabled: false +Lint/OutOfRangeRegexpRef: + Enabled: false +Lint/RaiseException: + Enabled: false +Lint/RedundantCopEnableDirective: + Enabled: false +Lint/RedundantRequireStatement: + Enabled: false +Lint/RedundantSafeNavigation: + Enabled: false +Lint/RedundantWithIndex: + Enabled: false +Lint/RedundantWithObject: + Enabled: false +Lint/RegexpAsCondition: + Enabled: false +Lint/ReturnInVoidContext: + Enabled: false +Lint/SafeNavigationConsistency: + Enabled: false +Lint/SafeNavigationWithEmpty: + Enabled: false +Lint/SelfAssignment: + Enabled: false +Lint/SendWithMixinArgument: + Enabled: false +Lint/ShadowedArgument: + Enabled: false +Lint/StructNewOverride: + Enabled: false +Lint/ToJSON: + Enabled: false +Lint/TopLevelReturnWithArgument: + Enabled: false +Lint/TrailingCommaInAttributeDeclaration: + Enabled: false +Lint/UnreachableLoop: + Enabled: false +Lint/UriEscapeUnescape: + Enabled: false +Lint/UriRegexp: + Enabled: false +Lint/UselessMethodDefinition: + Enabled: false +Lint/UselessTimes: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/BlockLength: + Enabled: false +Metrics/BlockNesting: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/ParameterLists: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Migration/DepartmentName: + Enabled: false +Naming/AccessorMethodName: + Enabled: false +Naming/BlockParameterName: + Enabled: false +Naming/HeredocDelimiterCase: + Enabled: false +Naming/HeredocDelimiterNaming: + Enabled: false +Naming/MemoizedInstanceVariableName: + Enabled: false +Naming/MethodParameterName: + Enabled: false +Naming/RescuedExceptionsVariableName: + Enabled: false +Naming/VariableNumber: + Enabled: false +Performance/BindCall: + Enabled: false +Performance/DeletePrefix: + Enabled: false +Performance/DeleteSuffix: + Enabled: false +Performance/InefficientHashSearch: + Enabled: false +Performance/UnfreezeString: + Enabled: false +Performance/UriDefaultParser: + Enabled: false +RSpec/Be: + Enabled: false +RSpec/Capybara/FeatureMethods: + Enabled: false +RSpec/ContainExactly: + Enabled: false +RSpec/ContextMethod: + Enabled: false +RSpec/ContextWording: + Enabled: false +RSpec/DescribeClass: + Enabled: false +RSpec/EmptyHook: + Enabled: false +RSpec/EmptyLineAfterExample: + Enabled: false +RSpec/EmptyLineAfterExampleGroup: + Enabled: false +RSpec/EmptyLineAfterHook: + Enabled: false +RSpec/ExampleLength: + Enabled: false +RSpec/ExampleWithoutDescription: + Enabled: false +RSpec/ExpectChange: + Enabled: false +RSpec/ExpectInHook: + Enabled: false +RSpec/FactoryBot/AttributeDefinedStatically: + Enabled: false +RSpec/FactoryBot/CreateList: + Enabled: false +RSpec/FactoryBot/FactoryClassName: + Enabled: false +RSpec/HooksBeforeExamples: + Enabled: false +RSpec/ImplicitBlockExpectation: + Enabled: false +RSpec/ImplicitSubject: + Enabled: false +RSpec/LeakyConstantDeclaration: + Enabled: false +RSpec/LetBeforeExamples: + Enabled: false +RSpec/MatchArray: + Enabled: false +RSpec/MissingExampleGroupArgument: + Enabled: false +RSpec/MultipleExpectations: + Enabled: false +RSpec/MultipleMemoizedHelpers: + Enabled: false +RSpec/MultipleSubjects: + Enabled: false +RSpec/NestedGroups: + Enabled: false +RSpec/PredicateMatcher: + Enabled: false +RSpec/ReceiveCounts: + Enabled: false +RSpec/ReceiveNever: + Enabled: false +RSpec/RepeatedExampleGroupBody: + Enabled: false +RSpec/RepeatedExampleGroupDescription: + Enabled: false +RSpec/RepeatedIncludeExample: + Enabled: false +RSpec/ReturnFromStub: + Enabled: false +RSpec/SharedExamples: + Enabled: false +RSpec/StubbedMock: + Enabled: false +RSpec/UnspecifiedException: + Enabled: false +RSpec/VariableDefinition: + Enabled: false +RSpec/VoidExpect: + Enabled: false +RSpec/Yield: + Enabled: false +Security/Open: + Enabled: false +Style/AccessModifierDeclarations: + Enabled: false +Style/AccessorGrouping: + Enabled: false +Style/BisectedAttrAccessor: + Enabled: false +Style/CaseLikeIf: + Enabled: false +Style/ClassEqualityComparison: + Enabled: false +Style/ColonMethodDefinition: + Enabled: false +Style/CombinableLoops: + Enabled: false +Style/CommentedKeyword: + Enabled: false +Style/Dir: + Enabled: false +Style/DoubleCopDisableDirective: + Enabled: false +Style/EmptyBlockParameter: + Enabled: false +Style/EmptyLambdaParameter: + Enabled: false +Style/Encoding: + Enabled: false +Style/EvalWithLocation: + Enabled: false +Style/ExpandPathArguments: + Enabled: false +Style/ExplicitBlockArgument: + Enabled: false +Style/ExponentialNotation: + Enabled: false +Style/FloatDivision: + Enabled: false +Style/FrozenStringLiteralComment: + Enabled: false +Style/GlobalStdStream: + Enabled: false +Style/HashAsLastArrayItem: + Enabled: false +Style/HashLikeCase: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: + Enabled: false +Style/IfUnlessModifier: + Enabled: false +Style/KeywordParametersOrder: + Enabled: false +Style/MinMax: + Enabled: false +Style/MixinUsage: + Enabled: false +Style/MultilineWhenThen: + Enabled: false +Style/NegatedUnless: + Enabled: false +Style/NumericPredicate: + Enabled: false +Style/OptionalBooleanParameter: + Enabled: false +Style/OrAssignment: + Enabled: false +Style/RandomWithOffset: + Enabled: false +Style/RedundantAssignment: + Enabled: false +Style/RedundantCondition: + Enabled: false +Style/RedundantConditional: + Enabled: false +Style/RedundantFetchBlock: + Enabled: false +Style/RedundantFileExtensionInRequire: + Enabled: false +Style/RedundantRegexpCharacterClass: + Enabled: false +Style/RedundantRegexpEscape: + Enabled: false +Style/RedundantSelfAssignment: + Enabled: false +Style/RedundantSort: + Enabled: false +Style/RescueStandardError: + Enabled: false +Style/SingleArgumentDig: + Enabled: false +Style/SlicingWithRange: + Enabled: false +Style/SoleNestedConditional: + Enabled: false +Style/StderrPuts: + Enabled: false +Style/StringConcatenation: + Enabled: false +Style/Strip: + Enabled: false +Style/SymbolProc: + Enabled: false +Style/TrailingBodyOnClass: + Enabled: false +Style/TrailingBodyOnMethodDefinition: + Enabled: false +Style/TrailingBodyOnModule: + Enabled: false +Style/TrailingCommaInHashLiteral: + Enabled: false +Style/TrailingMethodEndStatement: + Enabled: false +Style/UnpackFirst: + Enabled: false +Capybara/MatchStyle: + Enabled: false +Capybara/NegationMatcher: + Enabled: false +Capybara/SpecificActions: + Enabled: false +Capybara/SpecificFinders: + Enabled: false +Capybara/SpecificMatcher: + Enabled: false +Gemspec/DeprecatedAttributeAssignment: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false +Gemspec/RequireMFA: + Enabled: false +Layout/LineContinuationLeadingSpace: + Enabled: false +Layout/LineContinuationSpacing: + Enabled: false +Layout/LineEndStringConcatenationIndentation: + Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false +Lint/AmbiguousAssignment: + Enabled: false +Lint/AmbiguousOperatorPrecedence: + Enabled: false +Lint/AmbiguousRange: + Enabled: false +Lint/ConstantOverwrittenInRescue: + Enabled: false +Lint/DeprecatedConstants: + Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateMagicComment: + Enabled: false +Lint/DuplicateMatchPattern: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/EmptyInPattern: + Enabled: false +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false +Lint/LambdaWithoutLiteralBlock: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/NonAtomicFileOperation: + Enabled: false +Lint/NumberedParameterAssignment: + Enabled: false +Lint/OrAssignmentToConstant: + Enabled: false +Lint/RedundantDirGlobSort: + Enabled: false +Lint/RefinementImportMethods: + Enabled: false +Lint/RequireRangeParentheses: + Enabled: false +Lint/RequireRelativeSelfPath: + Enabled: false +Lint/SymbolConversion: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/TripleQuotes: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Lint/UselessRescue: + Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false +Naming/BlockForwarding: + Enabled: false +Performance/CollectionLiteralInLoop: + Enabled: false +Performance/ConcurrentMonotonicTime: + Enabled: false +Performance/MapCompact: + Enabled: false +Performance/RedundantEqualityComparisonBlock: + Enabled: false +Performance/RedundantSplitRegexpArgument: + Enabled: false +Performance/StringIdentifierArgument: + Enabled: false +RSpec/BeEq: + Enabled: false +RSpec/BeNil: + Enabled: false +RSpec/ChangeByZero: + Enabled: false +RSpec/ClassCheck: + Enabled: false +RSpec/DuplicatedMetadata: + Enabled: false +RSpec/ExcessiveDocstringSpacing: + Enabled: false +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false +RSpec/FactoryBot/FactoryNameStyle: + Enabled: false +RSpec/FactoryBot/SyntaxMethods: + Enabled: false +RSpec/IdenticalEqualityAssertion: + Enabled: false +RSpec/NoExpectationExample: + Enabled: false +RSpec/PendingWithoutReason: + Enabled: false +RSpec/Rails/AvoidSetupHook: + Enabled: false +RSpec/Rails/HaveHttpStatus: + Enabled: false +RSpec/Rails/InferredSpecType: + Enabled: false +RSpec/Rails/MinitestAssertions: + Enabled: false +RSpec/Rails/TravelAround: + Enabled: false +RSpec/RedundantAround: + Enabled: false +RSpec/SkipBlockInsideExample: + Enabled: false +RSpec/SortMetadata: + Enabled: false +RSpec/SubjectDeclaration: + Enabled: false +RSpec/VerifiedDoubleReference: + Enabled: false +Security/CompoundHash: + Enabled: false +Security/IoMethods: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false +Style/ArrayIntersect: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/ComparableClamp: + Enabled: false +Style/ConcatArrayLiterals: + Enabled: false +Style/DataInheritance: + Enabled: false +Style/DirEmpty: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/EmptyHeredoc: + Enabled: false +Style/EndlessMethod: + Enabled: false +Style/EnvHome: + Enabled: false +Style/FetchEnvVar: + Enabled: false +Style/FileEmpty: + Enabled: false +Style/FileRead: + Enabled: false +Style/FileWrite: + Enabled: false +Style/HashConversion: + Enabled: false +Style/HashExcept: + Enabled: false +Style/IfWithBooleanLiteralBranches: + Enabled: false +Style/InPatternThen: + Enabled: false +Style/MagicCommentFormat: + Enabled: false +Style/MapCompactWithConditionalBlock: + Enabled: false +Style/MapToHash: + Enabled: false +Style/MapToSet: + Enabled: false +Style/MinMaxComparison: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NestedFileDirname: + Enabled: false +Style/NilLambda: + Enabled: false +Style/NumberedParameters: + Enabled: false +Style/NumberedParametersLimit: + Enabled: false +Style/ObjectThen: + Enabled: false +Style/OpenStructUse: + Enabled: false +Style/OperatorMethodCall: + Enabled: false +Style/QuotedSymbols: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/RedundantConstantBase: + Enabled: false +Style/RedundantDoubleSplatHashBraces: + Enabled: false +Style/RedundantEach: + Enabled: false +Style/RedundantHeredocDelimiterQuotes: + Enabled: false +Style/RedundantInitialize: + Enabled: false +Style/RedundantLineContinuation: + Enabled: false +Style/RedundantSelfAssignmentBranch: + Enabled: false +Style/RedundantStringEscape: + Enabled: false +Style/SelectByRegexp: + Enabled: false +Style/StringChars: + Enabled: false +Style/SwapValues: + Enabled: false diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..fa8d5056e --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "puppet.puppet-vscode", + "Shopify.ruby-lsp" + ] + } diff --git a/Gemfile b/Gemfile index 57059192f..2624b25a6 100644 --- a/Gemfile +++ b/Gemfile @@ -36,7 +36,7 @@ group :development do gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') gem "test-kitchen", '= 3.0.0', platforms: [:ruby] - gem "rubocop", '~> 1.19', require: false + gem "rubocop", '~> 1.30', require: false gem "rubocop-rspec", '= 2.10.0', require: false gem "facterdb", '~> 1.21', require: false gem "rspec-puppet-facts", '~> 1.10.0', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 0476f16ce..6ef885e82 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -21,6 +21,7 @@ GEM aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcrypt_pbkdf (1.0.1) + bcrypt_pbkdf (1.0.1-x64-mingw32) bindata (2.5.0) bolt (1.49.0) CFPropertyList (~> 2.2) @@ -50,7 +51,6 @@ GEM coderay (1.1.3) colored2 (3.1.2) concurrent-ruby (1.1.10) - connection_pool (2.5.0) cri (2.15.12) deep_merge (1.2.2) dependency_checker (0.3.0) @@ -63,43 +63,41 @@ GEM domain_name (0.6.20240107) ed25519 (1.3.0) erubi (1.13.1) - facter (2.5.7) facter (2.5.7-universal-darwin) CFPropertyList (~> 2.2) + facter (2.5.7-x64-mingw32) + ffi (~> 1.9) facterdb (1.27.0) facter (< 5.0.0) jgrep (~> 1.5, >= 1.5.4) - faraday (1.9.0) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) - faraday-httpclient (< 3) + faraday-httpclient (~> 1.0) faraday-multipart (~> 1.0) - faraday-net_http (< 3) - faraday-net_http_persistent (< 3) - faraday-patron (< 3) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) faraday-rack (~> 1.0) faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) - faraday-httpclient (2.0.1) - httpclient (>= 2.2) + faraday-httpclient (1.0.1) faraday-multipart (1.1.0) multipart-post (~> 2.0) - faraday-net_http (2.1.0) - faraday-net_http_persistent (2.0.2) - faraday-net_http (< 3) - net-http-persistent (~> 4.0) - faraday-patron (2.0.1) - patron (>= 0.4.2) + faraday-net_http (1.0.2) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) faraday_middleware (1.2.1) faraday (~> 1.0) fast_gettext (1.1.2) - ffi (1.17.1) + ffi (1.17.1-arm64-darwin) + ffi (1.17.1-x64-mingw32) gettext (3.2.9) locale (>= 2.0.5) text (>= 1.3.0) @@ -176,8 +174,6 @@ GEM mocha (1.16.1) multi_json (1.15.0) multipart-post (2.4.1) - net-http-persistent (4.0.5) - connection_pool (~> 2.2) net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (6.1.0) @@ -202,7 +198,6 @@ GEM pastel (0.8.0) tty-color (~> 0.5) pathspec (0.2.1) - patron (0.13.3) pdk (1.18.1) bundler (>= 1.15.0, < 3.0.0) childprocess (~> 0.7.1) @@ -223,11 +218,12 @@ GEM tty-spinner (~> 0.5) tty-which (~> 0.3) pluginator (1.5.0) - pry (0.15.2) + pry (0.15.0) coderay (~> 1.1) method_source (~> 1.0) public_suffix (5.1.1) - puppet (6.29.0) + puppet (6.29.0-universal-darwin) + CFPropertyList (~> 2.2) concurrent-ruby (~> 1.0, < 1.2.0) deep_merge (~> 1.0) facter (> 2.0.1, < 5) @@ -238,18 +234,23 @@ GEM multi_json (~> 1.10) puppet-resource_api (~> 1.5) semantic_puppet (~> 1.0) - puppet (6.29.0-universal-darwin) - CFPropertyList (~> 2.2) + puppet (6.29.0-x64-mingw32) concurrent-ruby (~> 1.0, < 1.2.0) deep_merge (~> 1.0) facter (> 2.0.1, < 5) fast_gettext (~> 1.1) + ffi (> 1.9.24, < 2) hiera (>= 3.2.1, < 4) httpclient (~> 2.8) locale (~> 2.1) + minitar (~> 0.9) multi_json (~> 1.10) puppet-resource_api (~> 1.5) semantic_puppet (~> 1.0) + win32-dir (>= 0.4.9, <= 0.7.2) + win32-process (= 0.7.5) + win32-security (= 0.2.5) + win32-service (= 0.8.8) puppet-blacksmith (6.1.1) puppet-modulebuilder (~> 0.2) rest-client (~> 2.0) @@ -344,6 +345,12 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + rest-client (2.1.0-x64-mingw32) + ffi (~> 1.9) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) rexml (3.2.6) rgen (0.10.2) rspec (3.13.0) @@ -398,7 +405,7 @@ GEM rubyntlm (0.6.5) base64 rubyzip (2.4.1) - semantic_puppet (1.1.1) + semantic_puppet (1.1.0) serverspec (2.42.3) multi_json rspec (~> 3.0) @@ -445,7 +452,7 @@ GEM winrm-elevated (~> 1.0) winrm-fs (~> 1.1) text (1.3.1) - thor (1.3.2) + thor (1.2.2) tomlrb (2.0.3) tty-box (0.7.0) pastel (~> 0.8) @@ -488,6 +495,14 @@ GEM puppet-lint-unquoted_string-check (~> 2.2) puppet-lint-variable_contains_upcase (~> 1.2) puppet-lint-version_comparison-check (~> 1.1) + win32-dir (0.7.2) + ffi (>= 1.0.0) + win32-process (0.7.5) + ffi (>= 1.0.0) + win32-security (0.2.5) + ffi + win32-service (0.8.8) + ffi windows_error (0.1.5) winrm (2.3.6) builder (>= 2.1.2) @@ -511,8 +526,8 @@ GEM yard (0.9.37) PLATFORMS - arm64-darwin-21 - x86_64-linux + arm64-darwin-24 + x64-mingw32 DEPENDENCIES CFPropertyList (< 3.0.7) @@ -540,7 +555,7 @@ DEPENDENCIES rb-readline (= 0.5.5) rexml (>= 3.0.0, < 3.2.7) rspec-puppet-facts (~> 1.10.0) - rubocop (~> 1.19) + rubocop (~> 1.30) rubocop-performance (~> 1.11) rubocop-rspec (= 2.10.0) serverspec (~> 2.41) From 9043ccbcfdc72ed3688764865551e49186cd4e69 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Mon, 3 Feb 2025 18:27:47 -0500 Subject: [PATCH 046/133] update gemfile.lock and target ruby version for rubocop --- .rubocop | 2 +- .rubocop.yml | 2 +- Gemfile.lock | 509 +++++++++++++++++++++++++-------------------------- 3 files changed, 252 insertions(+), 261 deletions(-) diff --git a/.rubocop b/.rubocop index 55d3c4ae1..fc40e8e2e 100644 --- a/.rubocop +++ b/.rubocop @@ -1 +1 @@ ---ignore-unrecognized-cops \ No newline at end of file +--ignore-unrecognized-cops diff --git a/.rubocop.yml b/.rubocop.yml index df7937e05..d464e5c3d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.7' + TargetRubyVersion: '2.6' Include: - "**/*.rb" Exclude: diff --git a/Gemfile.lock b/Gemfile.lock index 6ef885e82..e5b77842e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,134 +1,132 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.3.6) + CFPropertyList (3.0.6) + rexml addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ansi (1.5.0) ast (2.4.2) awesome_print (1.9.2) aws-eventstream (1.3.0) - aws-partitions (1.1044.0) - aws-sdk-core (3.217.1) + aws-partitions (1.1027.0) + aws-sdk-core (3.214.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-ec2 (1.503.0) - aws-sdk-core (~> 3, >= 3.216.0) + aws-sdk-ec2 (1.498.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sigv4 (1.11.0) + aws-sigv4 (1.10.1) aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcrypt_pbkdf (1.0.1) bcrypt_pbkdf (1.0.1-x64-mingw32) + bigdecimal (3.1.8) bindata (2.5.0) - bolt (1.49.0) - CFPropertyList (~> 2.2) + bolt (4.0.0) + CFPropertyList (>= 2.2) addressable (~> 2.5) aws-sdk-ec2 (~> 1) concurrent-ruby (~> 1.0) + ffi (>= 1.9.25, < 2.0.0) hiera-eyaml (~> 3) + jwt (~> 2.2) logging (~> 2.2) minitar (~> 0.6) - net-scp (~> 1.2) - net-ssh (>= 4.0) + net-scp (>= 1.2, < 5.0) + net-ssh (>= 4.0, < 8.0) net-ssh-krb (~> 0.5) - orchestrator_client (~> 0.4) - puppet (>= 6.11.0, < 7) + orchestrator_client (~> 0.7) + puppet (>= 6.18.0) puppet-resource_api (>= 1.8.1) - puppet-strings (~> 2.3) - r10k (~> 3.1) + puppet-strings (>= 2.3.0, < 5.0) + puppetfile-resolver (>= 0.6.2, < 1.0) + r10k (>= 3.10, < 5) ruby_smb (~> 1.0) - terminal-table (~> 1.8) + terminal-table (~> 3.0) winrm (~> 2.0) winrm-fs (~> 1.3) builder (3.3.0) chef-utils (18.6.2) concurrent-ruby - childprocess (0.7.1) - ffi (~> 1.0, >= 1.0.11) coderay (1.1.3) colored2 (3.1.2) - concurrent-ruby (1.1.10) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) cri (2.15.12) deep_merge (1.2.2) - dependency_checker (0.3.0) + dependency_checker (1.0.1) parallel - puppet_forge (>= 2.2, < 4.0) + puppet_forge (>= 2.2, < 6.0) rake (~> 13.0) semantic_puppet (~> 1.0) - diff-lcs (1.3) + diff-lcs (1.5.1) docile (1.4.1) + docker-api (2.4.0) + excon (>= 0.64.0) + multi_json domain_name (0.6.20240107) ed25519 (1.3.0) erubi (1.13.1) - facter (2.5.7-universal-darwin) - CFPropertyList (~> 2.2) - facter (2.5.7-x64-mingw32) - ffi (~> 1.9) - facterdb (1.27.0) + excon (1.2.2) + facter (4.10.0) + hocon (~> 1.3) + thor (>= 1.0.1, < 1.3) + facterdb (2.1.0) facter (< 5.0.0) jgrep (~> 1.5, >= 1.5.4) - faraday (1.10.4) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.1.0) - multipart-post (~> 2.0) - faraday-net_http (1.0.2) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - faraday_middleware (1.2.1) - faraday (~> 1.0) - fast_gettext (1.1.2) - ffi (1.17.1-arm64-darwin) - ffi (1.17.1-x64-mingw32) - gettext (3.2.9) + faraday (2.12.2) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-follow_redirects (0.3.0) + faraday (>= 1, < 3) + faraday-net_http (3.4.0) + net-http (>= 0.5.0) + faraday-net_http_persistent (2.3.0) + faraday (~> 2.5) + net-http-persistent (>= 4.0.4, < 5) + fast_gettext (2.4.0) + prime + ffi (1.16.3) + forwardable (1.3.3) + getoptlong (0.2.1) + gettext (3.5.0) + erubi locale (>= 2.0.5) + prime + racc text (>= 1.3.0) - gettext-setup (0.34) - fast_gettext (~> 1.1.0) - gettext (>= 3.0.2, < 3.3.0) + gettext-setup (1.1.0) + fast_gettext (~> 2.1) + gettext (~> 3.4) locale gssapi (1.3.1) ffi (>= 1.0.1) gyoku (1.4.0) builder (>= 2.1.2) rexml (~> 3.0) - hiera (3.12.0) hiera-eyaml (3.4.0) highline optimist - highline (2.1.0) - hitimes (1.3.0) + highline (3.1.1) + reline hocon (1.4.0) http-accept (1.7.0) http-cookie (1.0.8) domain_name (~> 0.5) httpclient (2.8.3) - io-console (0.5.9) + io-console (0.7.2) jgrep (1.5.4) jmespath (1.6.2) - json (2.3.0) - json-schema (2.8.0) - addressable (>= 2.4) - json_pure (2.1.0) - jwt (2.7.1) + json (2.6.3) + json-schema (5.1.1) + addressable (~> 2.8) + bigdecimal (~> 3.1) + jwt (2.9.3) + base64 kitchen-docker (3.0.0) test-kitchen (>= 1.0.0) kitchen-puppet (3.7.0) @@ -138,9 +136,9 @@ GEM kitchen-verifier-serverspec (0.7.2) net-ssh (>= 3) test-kitchen (>= 1.4) - librarian-puppet (4.0.1) + librarian-puppet (5.0.0) librarianp (>= 0.6.3) - puppet_forge (>= 2.1, < 4) + puppet_forge (>= 2.1, < 5) rsync librarianp (1.1.2) thor (~> 1.0) @@ -152,18 +150,19 @@ GEM little-plugger (1.1.4) locale (2.1.4) log4r (1.1.10) - logger (1.6.5) + logger (1.6.4) logging (2.4.0) little-plugger (~> 1.1) multi_json (~> 1.14) - metadata-json-lint (3.0.3) - json-schema (>= 2.8, < 5.0) + metadata-json-lint (4.1.0) + json-schema (>= 2.8, < 6.0) + semantic_puppet (~> 1.0) spdx-licenses (~> 1.0) method_source (1.1.0) mime-types (3.6.0) logger mime-types-data (~> 3.2015) - mime-types-data (3.2025.0107) + mime-types-data (3.2024.1203) minitar (0.12.1) mixlib-install (3.12.30) mixlib-shellout @@ -171,12 +170,17 @@ GEM thor mixlib-shellout (2.2.7) mixlib-versioning (1.2.12) - mocha (1.16.1) + mocha (2.7.1) + ruby2_keywords (>= 0.0.5) + molinillo (0.8.0) multi_json (1.15.0) - multipart-post (2.4.1) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-ssh (6.1.0) + net-http (0.6.0) + uri + net-http-persistent (4.0.5) + connection_pool (~> 2.2) + net-scp (4.0.0) + net-ssh (>= 2.6.5, < 8.0.0) + net-ssh (7.3.0) net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) net-ssh-krb (0.5.1) @@ -184,7 +188,8 @@ GEM net-ssh (>= 2.0) net-telnet (0.2.0) netrc (0.11.0) - nori (2.6.0) + nori (2.7.1) + bigdecimal optimist (3.2.0) orchestrator_client (0.7.1) faraday (>= 1.4, < 3.0) @@ -192,67 +197,47 @@ GEM parallel (1.26.3) parallel_tests (3.12.1) parallel - parser (3.3.7.0) + parser (3.3.6.0) ast (~> 2.4.1) racc pastel (0.8.0) tty-color (~> 0.5) - pathspec (0.2.1) - pdk (1.18.1) - bundler (>= 1.15.0, < 3.0.0) - childprocess (~> 0.7.1) - concurrent-ruby (~> 1.1.5) - cri (~> 2.10) - deep_merge (~> 1.1) - diff-lcs (= 1.3) - facter (~> 2.5.1) - ffi (>= 1.9.25, < 2.0.0) - gettext-setup (~> 0.24) - hitimes (= 1.3.0) - httpclient (~> 2.8.3) - json-schema (= 2.8.0) - json_pure (~> 2.1.0) - minitar (~> 0.6) - pathspec (~> 0.2.1) - tty-prompt (~> 0.13) - tty-spinner (~> 0.5) - tty-which (~> 0.3) + pathspec (2.1.0) pluginator (1.5.0) + prime (0.1.3) + forwardable + singleton pry (0.15.0) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.1.1) - puppet (6.29.0-universal-darwin) - CFPropertyList (~> 2.2) - concurrent-ruby (~> 1.0, < 1.2.0) + public_suffix (6.0.1) + puppet (8.10.0-universal-darwin) + CFPropertyList (>= 3.0.6, < 4) + concurrent-ruby (~> 1.0) deep_merge (~> 1.0) - facter (> 2.0.1, < 5) - fast_gettext (~> 1.1) - hiera (>= 3.2.1, < 4) - httpclient (~> 2.8) + facter (>= 4.3.0, < 5) + fast_gettext (>= 2.1, < 4) + getoptlong (~> 0.2.0) locale (~> 2.1) - multi_json (~> 1.10) + multi_json (~> 1.13) puppet-resource_api (~> 1.5) + scanf (~> 1.0) semantic_puppet (~> 1.0) - puppet (6.29.0-x64-mingw32) - concurrent-ruby (~> 1.0, < 1.2.0) + puppet (8.10.0-x64-mingw32) + concurrent-ruby (~> 1.0) deep_merge (~> 1.0) - facter (> 2.0.1, < 5) - fast_gettext (~> 1.1) - ffi (> 1.9.24, < 2) - hiera (>= 3.2.1, < 4) - httpclient (~> 2.8) + facter (>= 4.3.0, < 5) + fast_gettext (>= 2.1, < 4) + ffi (>= 1.15.5, < 1.17.0, != 1.16.2, != 1.16.1, != 1.16.0) + getoptlong (~> 0.2.0) locale (~> 2.1) minitar (~> 0.9) - multi_json (~> 1.10) + multi_json (~> 1.13) puppet-resource_api (~> 1.5) + scanf (~> 1.0) semantic_puppet (~> 1.0) - win32-dir (>= 0.4.9, <= 0.7.2) - win32-process (= 0.7.5) - win32-security (= 0.2.5) - win32-service (= 0.8.8) - puppet-blacksmith (6.1.1) - puppet-modulebuilder (~> 0.2) + puppet-blacksmith (7.1.0) + puppet-modulebuilder (~> 1.0) rest-client (~> 2.0) puppet-debugger (1.4.0) awesome_print (~> 1.7) @@ -263,83 +248,91 @@ GEM rb-readline (>= 0.5.5) table_print (>= 1.0.0) tty-pager (~> 0.14) - puppet-lint (3.4.0) - puppet-lint-absolute_classname-check (3.1.0) - puppet-lint (>= 1.0, < 4) - puppet-lint-anchor-check (1.1.0) - puppet-lint (>= 1.1, < 4) - puppet-lint-file_ensure-check (1.1.0) - puppet-lint (>= 1.0, < 4) - puppet-lint-leading_zero-check (1.1.0) - puppet-lint (>= 1.0, < 4.0) - puppet-lint-lookup_in_parameter-check (1.1.0) - puppet-lint (>= 2.0, < 4) - puppet-lint-manifest_whitespace-check (0.2.9) - puppet-lint (>= 1.0, < 4) - puppet-lint-optional_default-check (1.1.0) - puppet-lint (>= 2.1, < 4) - puppet-lint-param-docs (1.7.6) - puppet-lint (>= 1.1, < 4.0) - puppet-lint-param-types (1.0.0) - puppet-lint (>= 1.1, < 4) - puppet-lint-params_empty_string-check (1.1.0) - puppet-lint (>= 2.5, < 4) - puppet-lint-resource_reference_syntax (1.2.0) - puppet-lint (>= 1.0, < 4) - puppet-lint-strict_indent-check (2.1.0) - puppet-lint (>= 1.0, < 4) - puppet-lint-topscope-variable-check (1.2.0) - puppet-lint (>= 2.0, < 4) - puppet-lint-trailing_comma-check (1.0.0) - puppet-lint (>= 1.0, < 4) - puppet-lint-unquoted_string-check (2.2.0) - puppet-lint (>= 2.1, < 4) - puppet-lint-variable_contains_upcase (1.4.0) + puppet-lint (4.2.4) + puppet-lint-absolute_classname-check (4.0.0) + puppet-lint (>= 3.0, < 5) + puppet-lint-anchor-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-file_ensure-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-leading_zero-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-lookup_in_parameter-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-manifest_whitespace-check (0.3.0) puppet-lint (>= 1.0, < 5) - puppet-lint-version_comparison-check (1.1.0) - puppet-lint (>= 1.0, < 4) - puppet-modulebuilder (0.3.0) + puppet-lint-optional_default-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-param-docs (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-param-types (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-params_empty_string-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-resource_reference_syntax (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-strict_indent-check (3.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-topscope-variable-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-trailing_comma-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-unquoted_string-check (3.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-variable_contains_upcase (2.0.0) + puppet-lint (>= 3, < 5) + puppet-lint-version_comparison-check (2.0.0) + puppet-lint (>= 3, < 5) + puppet-modulebuilder (1.1.0) minitar (~> 0.9) - pathspec (>= 0.2.1, < 2.0.0) + pathspec (>= 0.2.1, < 3.0.0) puppet-resource_api (1.9.0) hocon (>= 1.0) - puppet-strings (2.9.0) - rgen - yard (~> 0.9.5) - puppet-syntax (3.3.0) - puppet (>= 5) - rake - puppet_forge (3.2.0) - faraday (~> 1.3) - faraday_middleware (~> 1.0) + puppet-strings (4.1.3) + rgen (~> 0.9) + yard (~> 0.9, < 0.9.37) + puppet-syntax (4.1.1) + puppet (>= 7, < 9) + rake (~> 13.1) + puppet_forge (4.1.0) + faraday (~> 2.0) + faraday-follow_redirects (~> 0.3.0) minitar semantic_puppet (~> 1.0) - puppet_litmus (0.0.1) - bolt (>= 1.13.1, < 2.0.0) - pdk (>= 1.10.0, < 2.0.0) - puppetlabs_spec_helper (5.0.3) - mocha (~> 1.0) - pathspec (>= 0.2, < 2.0.0) - puppet-lint (>= 2.5.2, < 4.0.0) - puppet-syntax (~> 3.0) + puppet_litmus (1.6.1) + bolt (~> 4.0) + docker-api (>= 1.34, < 3.0.0) + parallel + puppet-modulebuilder (>= 0.3.0) + retryable (~> 3.0) + rspec + tty-spinner (>= 0.5.0, < 1.0.0) + puppetfile-resolver (0.6.3) + molinillo (~> 0.6) + semantic_puppet (~> 1.0) + puppetlabs_spec_helper (8.0.0) + mocha (>= 1.0, < 3) + pathspec (>= 0.2, < 3) + puppet-lint (~> 4.0) + puppet-syntax (~> 4.1, >= 4.1.1) rspec-github (~> 2.0) - rspec-puppet (~> 2.0) - r10k (3.16.2) + rspec-puppet (~> 5.0) + r10k (4.1.0) colored2 (= 3.1.2) cri (>= 2.15.10) - fast_gettext (>= 1.1.0, < 3.0.0) - gettext (>= 3.0.2, < 4.0.0) - gettext-setup (>= 0.24, < 2.0.0) - jwt (>= 2.2.3, < 2.8.0) + gettext-setup (>= 0.24, < 2.0) + jwt (>= 2.2.3, < 3) log4r (= 1.1.10) minitar (~> 0.9) multi_json (~> 1.10) - puppet_forge (>= 2.3.0, < 4.0.0) - racc (1.4.16) + puppet_forge (>= 4.1, < 6) + racc (1.8.1) rainbow (3.1.1) rake (13.2.1) rb-readline (0.5.5) - regexp_parser (2.10.0) + regexp_parser (2.9.3) + reline (0.6.0) + io-console (~> 0.5) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) @@ -351,8 +344,9 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + retryable (3.0.5) rexml (3.2.6) - rgen (0.10.2) + rgen (0.9.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -364,38 +358,41 @@ GEM rspec-support (~> 3.13.0) rspec-github (2.4.0) rspec-core (~> 3.0) - rspec-its (1.3.1) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) + rspec-its (2.0.0) + rspec-core (>= 3.13.0) + rspec-expectations (>= 3.13.0) rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-puppet (2.12.0) - rspec - rspec-puppet-facts (1.10.0) - facter - facterdb (>= 0.5.0) - json - puppet + rspec-puppet (5.0.0) + rspec (~> 3.0) + rspec-puppet-facts (4.0.0) + deep_merge (~> 1.2) + facter (< 5) + facterdb (~> 2.1) + puppet (>= 7, < 9) rspec-support (3.13.2) rsync (1.0.9) - rubocop (1.42.0) + rubocop (1.50.2) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.38.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.37.0) parser (>= 3.3.1.0) - rubocop-performance (1.19.1) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rspec (2.10.0) - rubocop (~> 1.19) + rubocop-rspec (2.19.0) + rubocop (~> 1.33) + rubocop-capybara (~> 2.17) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) ruby_smb (1.1.0) @@ -404,7 +401,8 @@ GEM windows_error rubyntlm (0.6.5) base64 - rubyzip (2.4.1) + rubyzip (2.3.2) + scanf (1.0.0) semantic_puppet (1.1.0) serverspec (2.42.3) multi_json @@ -422,6 +420,7 @@ GEM terminal-table simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) + singleton (0.3.0) spdx-licenses (1.3.0) specinfra (2.91.0) base64 @@ -435,17 +434,17 @@ GEM unicode_utils (~> 1.4) strings-ansi (0.2.0) table_print (1.5.7) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - test-kitchen (3.0.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + test-kitchen (3.7.0) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) ed25519 (~> 1.2) license-acceptance (>= 1.0.11, < 3.0) mixlib-install (~> 3.6) mixlib-shellout (>= 1.2, < 4.0) - net-scp (>= 1.1, < 4.0) - net-ssh (>= 2.9, < 7.0) + net-scp (>= 1.1, < 5.0) + net-ssh (>= 2.9, < 8.0) net-ssh-gateway (>= 1.2, < 3.0) thor (>= 0.19, < 2.0) winrm (~> 2.0) @@ -473,45 +472,38 @@ GEM tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) - tty-which (0.5.0) - unicode-display_width (1.8.0) + unicode-display_width (2.6.0) unicode_utils (1.4.0) - voxpupuli-puppet-lint-plugins (4.0.0) - puppet-lint (~> 3.1) - puppet-lint-absolute_classname-check (~> 3.1) - puppet-lint-anchor-check (~> 1.1) - puppet-lint-file_ensure-check (~> 1.1) - puppet-lint-leading_zero-check (~> 1.0) - puppet-lint-lookup_in_parameter-check (~> 1.0) - puppet-lint-manifest_whitespace-check (~> 0.2.7, < 1.0.0) - puppet-lint-optional_default-check (~> 1.1) - puppet-lint-param-docs (>= 1.7.6, < 2.0.0) - puppet-lint-param-types (~> 1.0) - puppet-lint-params_empty_string-check (~> 1.0) - puppet-lint-resource_reference_syntax (~> 1.1) - puppet-lint-strict_indent-check (~> 2.1) - puppet-lint-topscope-variable-check (~> 1.1) - puppet-lint-trailing_comma-check (~> 1.0) - puppet-lint-unquoted_string-check (~> 2.2) - puppet-lint-variable_contains_upcase (~> 1.2) - puppet-lint-version_comparison-check (~> 1.1) - win32-dir (0.7.2) - ffi (>= 1.0.0) - win32-process (0.7.5) - ffi (>= 1.0.0) - win32-security (0.2.5) - ffi - win32-service (0.8.8) - ffi + uri (1.0.2) + voxpupuli-puppet-lint-plugins (5.0.0) + puppet-lint (~> 4.0) + puppet-lint-absolute_classname-check (~> 4.0) + puppet-lint-anchor-check (~> 2.0) + puppet-lint-file_ensure-check (~> 2.0) + puppet-lint-leading_zero-check (~> 2.0) + puppet-lint-lookup_in_parameter-check (~> 2.0) + puppet-lint-manifest_whitespace-check (~> 0.3, < 1.0.0) + puppet-lint-optional_default-check (~> 2.0) + puppet-lint-param-docs (~> 2.0) + puppet-lint-param-types (~> 2.0) + puppet-lint-params_empty_string-check (~> 2.0) + puppet-lint-resource_reference_syntax (~> 2.0) + puppet-lint-strict_indent-check (~> 3.0) + puppet-lint-topscope-variable-check (~> 2.0) + puppet-lint-trailing_comma-check (~> 2.0) + puppet-lint-unquoted_string-check (~> 3.0) + puppet-lint-variable_contains_upcase (~> 2.0) + puppet-lint-version_comparison-check (~> 2.0) windows_error (0.1.5) - winrm (2.3.6) + winrm (2.3.9) builder (>= 2.1.2) erubi (~> 1.8) gssapi (~> 1.2) gyoku (~> 1.0) httpclient (~> 2.2, >= 2.2.0.2) logging (>= 1.6.1, < 3.0) - nori (~> 2.0) + nori (~> 2.0, >= 2.7.1) + rexml (~> 3.0) rubyntlm (~> 0.6.0, >= 0.6.3) winrm-elevated (1.2.3) erubi (~> 1.8) @@ -523,7 +515,7 @@ GEM rubyzip (~> 2.0) winrm (~> 2.0) wisper (2.0.1) - yard (0.9.37) + yard (0.9.36) PLATFORMS arm64-darwin-24 @@ -533,35 +525,34 @@ DEPENDENCIES CFPropertyList (< 3.0.7) bcrypt_pbkdf (= 1.0.1) deep_merge (~> 1.2.2) - dependency_checker (= 0.3.0) - facterdb (~> 1.21) - io-console (= 0.5.9) - json (= 2.3.0) + dependency_checker (~> 1.0.0) + facterdb (~> 2.1) + io-console (= 0.7.2) + json (= 2.6.3) kitchen-docker kitchen-puppet kitchen-verifier-serverspec - librarian-puppet (= 4.0.1) - metadata-json-lint (~> 3.0.3) + librarian-puppet (~> 5.0) + metadata-json-lint (~> 4.0) mixlib-shellout (~> 2.2.7) parallel_tests (= 3.12.1) pry (~> 0.10) puppet - puppet-blacksmith (= 6.1.1) + puppet-blacksmith (~> 7.0) puppet-debugger (~> 1.0) - puppet-strings (= 2.9.0) - puppet_litmus (= 0.0.1) - puppetlabs_spec_helper (~> 5.0.3) - racc (~> 1.4.0) + puppet-strings (~> 4.0) + puppet_litmus (~> 1.0) + puppetlabs_spec_helper (~> 8.0) rb-readline (= 0.5.5) rexml (>= 3.0.0, < 3.2.7) - rspec-puppet-facts (~> 1.10.0) - rubocop (~> 1.30) - rubocop-performance (~> 1.11) - rubocop-rspec (= 2.10.0) + rspec-puppet-facts (~> 4.0) + rubocop (~> 1.50.0) + rubocop-performance (= 1.16.0) + rubocop-rspec (= 2.19.0) serverspec (~> 2.41) simplecov-console (~> 0.9) - test-kitchen (= 3.0.0) - voxpupuli-puppet-lint-plugins (~> 4.0) + test-kitchen (~> 3.7.0) + voxpupuli-puppet-lint-plugins (~> 5.0) BUNDLED WITH 2.4.13 From 60a7f4022c0a6611c9befbc323d4991378f501d8 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 4 Feb 2025 07:43:45 +0000 Subject: [PATCH 047/133] merge changes from pr --- Gemfile.lock | 558 ------------------------ manifests/integrations/elasticsearch.pp | 2 +- 2 files changed, 1 insertion(+), 559 deletions(-) delete mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index e5b77842e..000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,558 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.6) - rexml - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) - ansi (1.5.0) - ast (2.4.2) - awesome_print (1.9.2) - aws-eventstream (1.3.0) - aws-partitions (1.1027.0) - aws-sdk-core (3.214.0) - aws-eventstream (~> 1, >= 1.3.0) - aws-partitions (~> 1, >= 1.992.0) - aws-sigv4 (~> 1.9) - jmespath (~> 1, >= 1.6.1) - aws-sdk-ec2 (1.498.0) - aws-sdk-core (~> 3, >= 3.210.0) - aws-sigv4 (~> 1.5) - aws-sigv4 (1.10.1) - aws-eventstream (~> 1, >= 1.0.2) - base64 (0.2.0) - bcrypt_pbkdf (1.0.1) - bcrypt_pbkdf (1.0.1-x64-mingw32) - bigdecimal (3.1.8) - bindata (2.5.0) - bolt (4.0.0) - CFPropertyList (>= 2.2) - addressable (~> 2.5) - aws-sdk-ec2 (~> 1) - concurrent-ruby (~> 1.0) - ffi (>= 1.9.25, < 2.0.0) - hiera-eyaml (~> 3) - jwt (~> 2.2) - logging (~> 2.2) - minitar (~> 0.6) - net-scp (>= 1.2, < 5.0) - net-ssh (>= 4.0, < 8.0) - net-ssh-krb (~> 0.5) - orchestrator_client (~> 0.7) - puppet (>= 6.18.0) - puppet-resource_api (>= 1.8.1) - puppet-strings (>= 2.3.0, < 5.0) - puppetfile-resolver (>= 0.6.2, < 1.0) - r10k (>= 3.10, < 5) - ruby_smb (~> 1.0) - terminal-table (~> 3.0) - winrm (~> 2.0) - winrm-fs (~> 1.3) - builder (3.3.0) - chef-utils (18.6.2) - concurrent-ruby - coderay (1.1.3) - colored2 (3.1.2) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) - cri (2.15.12) - deep_merge (1.2.2) - dependency_checker (1.0.1) - parallel - puppet_forge (>= 2.2, < 6.0) - rake (~> 13.0) - semantic_puppet (~> 1.0) - diff-lcs (1.5.1) - docile (1.4.1) - docker-api (2.4.0) - excon (>= 0.64.0) - multi_json - domain_name (0.6.20240107) - ed25519 (1.3.0) - erubi (1.13.1) - excon (1.2.2) - facter (4.10.0) - hocon (~> 1.3) - thor (>= 1.0.1, < 1.3) - facterdb (2.1.0) - facter (< 5.0.0) - jgrep (~> 1.5, >= 1.5.4) - faraday (2.12.2) - faraday-net_http (>= 2.0, < 3.5) - json - logger - faraday-follow_redirects (0.3.0) - faraday (>= 1, < 3) - faraday-net_http (3.4.0) - net-http (>= 0.5.0) - faraday-net_http_persistent (2.3.0) - faraday (~> 2.5) - net-http-persistent (>= 4.0.4, < 5) - fast_gettext (2.4.0) - prime - ffi (1.16.3) - forwardable (1.3.3) - getoptlong (0.2.1) - gettext (3.5.0) - erubi - locale (>= 2.0.5) - prime - racc - text (>= 1.3.0) - gettext-setup (1.1.0) - fast_gettext (~> 2.1) - gettext (~> 3.4) - locale - gssapi (1.3.1) - ffi (>= 1.0.1) - gyoku (1.4.0) - builder (>= 2.1.2) - rexml (~> 3.0) - hiera-eyaml (3.4.0) - highline - optimist - highline (3.1.1) - reline - hocon (1.4.0) - http-accept (1.7.0) - http-cookie (1.0.8) - domain_name (~> 0.5) - httpclient (2.8.3) - io-console (0.7.2) - jgrep (1.5.4) - jmespath (1.6.2) - json (2.6.3) - json-schema (5.1.1) - addressable (~> 2.8) - bigdecimal (~> 3.1) - jwt (2.9.3) - base64 - kitchen-docker (3.0.0) - test-kitchen (>= 1.0.0) - kitchen-puppet (3.7.0) - librarian-puppet (>= 3.0) - net-ssh (>= 3) - test-kitchen (>= 1.4) - kitchen-verifier-serverspec (0.7.2) - net-ssh (>= 3) - test-kitchen (>= 1.4) - librarian-puppet (5.0.0) - librarianp (>= 0.6.3) - puppet_forge (>= 2.1, < 5) - rsync - librarianp (1.1.2) - thor (~> 1.0) - license-acceptance (2.1.13) - pastel (~> 0.7) - tomlrb (>= 1.2, < 3.0) - tty-box (~> 0.6) - tty-prompt (~> 0.20) - little-plugger (1.1.4) - locale (2.1.4) - log4r (1.1.10) - logger (1.6.4) - logging (2.4.0) - little-plugger (~> 1.1) - multi_json (~> 1.14) - metadata-json-lint (4.1.0) - json-schema (>= 2.8, < 6.0) - semantic_puppet (~> 1.0) - spdx-licenses (~> 1.0) - method_source (1.1.0) - mime-types (3.6.0) - logger - mime-types-data (~> 3.2015) - mime-types-data (3.2024.1203) - minitar (0.12.1) - mixlib-install (3.12.30) - mixlib-shellout - mixlib-versioning - thor - mixlib-shellout (2.2.7) - mixlib-versioning (1.2.12) - mocha (2.7.1) - ruby2_keywords (>= 0.0.5) - molinillo (0.8.0) - multi_json (1.15.0) - net-http (0.6.0) - uri - net-http-persistent (4.0.5) - connection_pool (~> 2.2) - net-scp (4.0.0) - net-ssh (>= 2.6.5, < 8.0.0) - net-ssh (7.3.0) - net-ssh-gateway (2.0.0) - net-ssh (>= 4.0.0) - net-ssh-krb (0.5.1) - gssapi (~> 1.3.0) - net-ssh (>= 2.0) - net-telnet (0.2.0) - netrc (0.11.0) - nori (2.7.1) - bigdecimal - optimist (3.2.0) - orchestrator_client (0.7.1) - faraday (>= 1.4, < 3.0) - faraday-net_http_persistent (>= 1.0, < 3.0) - parallel (1.26.3) - parallel_tests (3.12.1) - parallel - parser (3.3.6.0) - ast (~> 2.4.1) - racc - pastel (0.8.0) - tty-color (~> 0.5) - pathspec (2.1.0) - pluginator (1.5.0) - prime (0.1.3) - forwardable - singleton - pry (0.15.0) - coderay (~> 1.1) - method_source (~> 1.0) - public_suffix (6.0.1) - puppet (8.10.0-universal-darwin) - CFPropertyList (>= 3.0.6, < 4) - concurrent-ruby (~> 1.0) - deep_merge (~> 1.0) - facter (>= 4.3.0, < 5) - fast_gettext (>= 2.1, < 4) - getoptlong (~> 0.2.0) - locale (~> 2.1) - multi_json (~> 1.13) - puppet-resource_api (~> 1.5) - scanf (~> 1.0) - semantic_puppet (~> 1.0) - puppet (8.10.0-x64-mingw32) - concurrent-ruby (~> 1.0) - deep_merge (~> 1.0) - facter (>= 4.3.0, < 5) - fast_gettext (>= 2.1, < 4) - ffi (>= 1.15.5, < 1.17.0, != 1.16.2, != 1.16.1, != 1.16.0) - getoptlong (~> 0.2.0) - locale (~> 2.1) - minitar (~> 0.9) - multi_json (~> 1.13) - puppet-resource_api (~> 1.5) - scanf (~> 1.0) - semantic_puppet (~> 1.0) - puppet-blacksmith (7.1.0) - puppet-modulebuilder (~> 1.0) - rest-client (~> 2.0) - puppet-debugger (1.4.0) - awesome_print (~> 1.7) - bundler - facterdb (>= 0.4.0) - pluginator (~> 1.5.0) - puppet (>= 6) - rb-readline (>= 0.5.5) - table_print (>= 1.0.0) - tty-pager (~> 0.14) - puppet-lint (4.2.4) - puppet-lint-absolute_classname-check (4.0.0) - puppet-lint (>= 3.0, < 5) - puppet-lint-anchor-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-file_ensure-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-leading_zero-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-lookup_in_parameter-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-manifest_whitespace-check (0.3.0) - puppet-lint (>= 1.0, < 5) - puppet-lint-optional_default-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-param-docs (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-param-types (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-params_empty_string-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-resource_reference_syntax (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-strict_indent-check (3.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-topscope-variable-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-trailing_comma-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-unquoted_string-check (3.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-variable_contains_upcase (2.0.0) - puppet-lint (>= 3, < 5) - puppet-lint-version_comparison-check (2.0.0) - puppet-lint (>= 3, < 5) - puppet-modulebuilder (1.1.0) - minitar (~> 0.9) - pathspec (>= 0.2.1, < 3.0.0) - puppet-resource_api (1.9.0) - hocon (>= 1.0) - puppet-strings (4.1.3) - rgen (~> 0.9) - yard (~> 0.9, < 0.9.37) - puppet-syntax (4.1.1) - puppet (>= 7, < 9) - rake (~> 13.1) - puppet_forge (4.1.0) - faraday (~> 2.0) - faraday-follow_redirects (~> 0.3.0) - minitar - semantic_puppet (~> 1.0) - puppet_litmus (1.6.1) - bolt (~> 4.0) - docker-api (>= 1.34, < 3.0.0) - parallel - puppet-modulebuilder (>= 0.3.0) - retryable (~> 3.0) - rspec - tty-spinner (>= 0.5.0, < 1.0.0) - puppetfile-resolver (0.6.3) - molinillo (~> 0.6) - semantic_puppet (~> 1.0) - puppetlabs_spec_helper (8.0.0) - mocha (>= 1.0, < 3) - pathspec (>= 0.2, < 3) - puppet-lint (~> 4.0) - puppet-syntax (~> 4.1, >= 4.1.1) - rspec-github (~> 2.0) - rspec-puppet (~> 5.0) - r10k (4.1.0) - colored2 (= 3.1.2) - cri (>= 2.15.10) - gettext-setup (>= 0.24, < 2.0) - jwt (>= 2.2.3, < 3) - log4r (= 1.1.10) - minitar (~> 0.9) - multi_json (~> 1.10) - puppet_forge (>= 4.1, < 6) - racc (1.8.1) - rainbow (3.1.1) - rake (13.2.1) - rb-readline (0.5.5) - regexp_parser (2.9.3) - reline (0.6.0) - io-console (~> 0.5) - rest-client (2.1.0) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) - rest-client (2.1.0-x64-mingw32) - ffi (~> 1.9) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) - retryable (3.0.5) - rexml (3.2.6) - rgen (0.9.1) - rspec (3.13.0) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.2) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-github (2.4.0) - rspec-core (~> 3.0) - rspec-its (2.0.0) - rspec-core (>= 3.13.0) - rspec-expectations (>= 3.13.0) - rspec-mocks (3.13.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-puppet (5.0.0) - rspec (~> 3.0) - rspec-puppet-facts (4.0.0) - deep_merge (~> 1.2) - facter (< 5) - facterdb (~> 2.1) - puppet (>= 7, < 9) - rspec-support (3.13.2) - rsync (1.0.9) - rubocop (1.50.2) - json (~> 2.3) - parallel (~> 1.10) - parser (>= 3.2.0.0) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.37.0) - parser (>= 3.3.1.0) - rubocop-capybara (2.21.0) - rubocop (~> 1.41) - rubocop-performance (1.16.0) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rspec (2.19.0) - rubocop (~> 1.33) - rubocop-capybara (~> 2.17) - ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) - ruby_smb (1.1.0) - bindata - rubyntlm - windows_error - rubyntlm (0.6.5) - base64 - rubyzip (2.3.2) - scanf (1.0.0) - semantic_puppet (1.1.0) - serverspec (2.42.3) - multi_json - rspec (~> 3.0) - rspec-its - specinfra (~> 2.72) - sfl (2.3) - simplecov (0.22.0) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-console (0.9.2) - ansi - simplecov - terminal-table - simplecov-html (0.13.1) - simplecov_json_formatter (0.1.4) - singleton (0.3.0) - spdx-licenses (1.3.0) - specinfra (2.91.0) - base64 - net-scp - net-ssh (>= 2.7) - net-telnet - sfl - strings (0.2.1) - strings-ansi (~> 0.2) - unicode-display_width (>= 1.5, < 3.0) - unicode_utils (~> 1.4) - strings-ansi (0.2.0) - table_print (1.5.7) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - test-kitchen (3.7.0) - bcrypt_pbkdf (~> 1.0) - chef-utils (>= 16.4.35) - ed25519 (~> 1.2) - license-acceptance (>= 1.0.11, < 3.0) - mixlib-install (~> 3.6) - mixlib-shellout (>= 1.2, < 4.0) - net-scp (>= 1.1, < 5.0) - net-ssh (>= 2.9, < 8.0) - net-ssh-gateway (>= 1.2, < 3.0) - thor (>= 0.19, < 2.0) - winrm (~> 2.0) - winrm-elevated (~> 1.0) - winrm-fs (~> 1.1) - text (1.3.1) - thor (1.2.2) - tomlrb (2.0.3) - tty-box (0.7.0) - pastel (~> 0.8) - strings (~> 0.2.0) - tty-cursor (~> 0.7) - tty-color (0.6.0) - tty-cursor (0.7.1) - tty-pager (0.14.0) - strings (~> 0.2.0) - tty-screen (~> 0.8) - tty-prompt (0.23.1) - pastel (~> 0.8) - tty-reader (~> 0.8) - tty-reader (0.9.0) - tty-cursor (~> 0.7) - tty-screen (~> 0.8) - wisper (~> 2.0) - tty-screen (0.8.2) - tty-spinner (0.9.3) - tty-cursor (~> 0.7) - unicode-display_width (2.6.0) - unicode_utils (1.4.0) - uri (1.0.2) - voxpupuli-puppet-lint-plugins (5.0.0) - puppet-lint (~> 4.0) - puppet-lint-absolute_classname-check (~> 4.0) - puppet-lint-anchor-check (~> 2.0) - puppet-lint-file_ensure-check (~> 2.0) - puppet-lint-leading_zero-check (~> 2.0) - puppet-lint-lookup_in_parameter-check (~> 2.0) - puppet-lint-manifest_whitespace-check (~> 0.3, < 1.0.0) - puppet-lint-optional_default-check (~> 2.0) - puppet-lint-param-docs (~> 2.0) - puppet-lint-param-types (~> 2.0) - puppet-lint-params_empty_string-check (~> 2.0) - puppet-lint-resource_reference_syntax (~> 2.0) - puppet-lint-strict_indent-check (~> 3.0) - puppet-lint-topscope-variable-check (~> 2.0) - puppet-lint-trailing_comma-check (~> 2.0) - puppet-lint-unquoted_string-check (~> 3.0) - puppet-lint-variable_contains_upcase (~> 2.0) - puppet-lint-version_comparison-check (~> 2.0) - windows_error (0.1.5) - winrm (2.3.9) - builder (>= 2.1.2) - erubi (~> 1.8) - gssapi (~> 1.2) - gyoku (~> 1.0) - httpclient (~> 2.2, >= 2.2.0.2) - logging (>= 1.6.1, < 3.0) - nori (~> 2.0, >= 2.7.1) - rexml (~> 3.0) - rubyntlm (~> 0.6.0, >= 0.6.3) - winrm-elevated (1.2.3) - erubi (~> 1.8) - winrm (~> 2.0) - winrm-fs (~> 1.0) - winrm-fs (1.3.5) - erubi (~> 1.8) - logging (>= 1.6.1, < 3.0) - rubyzip (~> 2.0) - winrm (~> 2.0) - wisper (2.0.1) - yard (0.9.36) - -PLATFORMS - arm64-darwin-24 - x64-mingw32 - -DEPENDENCIES - CFPropertyList (< 3.0.7) - bcrypt_pbkdf (= 1.0.1) - deep_merge (~> 1.2.2) - dependency_checker (~> 1.0.0) - facterdb (~> 2.1) - io-console (= 0.7.2) - json (= 2.6.3) - kitchen-docker - kitchen-puppet - kitchen-verifier-serverspec - librarian-puppet (~> 5.0) - metadata-json-lint (~> 4.0) - mixlib-shellout (~> 2.2.7) - parallel_tests (= 3.12.1) - pry (~> 0.10) - puppet - puppet-blacksmith (~> 7.0) - puppet-debugger (~> 1.0) - puppet-strings (~> 4.0) - puppet_litmus (~> 1.0) - puppetlabs_spec_helper (~> 8.0) - rb-readline (= 0.5.5) - rexml (>= 3.0.0, < 3.2.7) - rspec-puppet-facts (~> 4.0) - rubocop (~> 1.50.0) - rubocop-performance (= 1.16.0) - rubocop-rspec (= 2.19.0) - serverspec (~> 2.41) - simplecov-console (~> 0.9) - test-kitchen (~> 3.7.0) - voxpupuli-puppet-lint-plugins (~> 5.0) - -BUNDLED WITH - 2.4.13 diff --git a/manifests/integrations/elasticsearch.pp b/manifests/integrations/elasticsearch.pp index 6d8097a24..9242ddf18 100644 --- a/manifests/integrations/elasticsearch.pp +++ b/manifests/integrations/elasticsearch.pp @@ -42,7 +42,7 @@ # $ssl_verify can be a bool or a string # https://github.com/DataDog/dd-agent/blob/master/checks.d/elastic.py#L454-L455 if $ssl_verify.is_a(String) { - validate_absolute_path($ssl_verify) + validate_absolute_path($ssl_verify) #potentially replace with find_file } if !$instances and $url { From f38805cc9c733ff85d0f1c6083b9f23d5b2d00a1 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 4 Feb 2025 07:50:25 +0000 Subject: [PATCH 048/133] elastic search now uses tls_verify rather than ssl_verify. Breaking, as this no longer supports a String. --- manifests/integrations/elasticsearch.pp | 11 +++-------- templates/agent-conf.d/elastic.yaml.erb | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/manifests/integrations/elasticsearch.pp b/manifests/integrations/elasticsearch.pp index 9242ddf18..8bd8ead40 100644 --- a/manifests/integrations/elasticsearch.pp +++ b/manifests/integrations/elasticsearch.pp @@ -31,7 +31,8 @@ Boolean $pshard_stats = false, Optional[String] $ssl_cert = undef, Optional[String] $ssl_key = undef, - Variant[Boolean, String] $ssl_verify = true, + Boolean $ssl_verify = true, #kept for backwards compatibility + Boolean $tls_verify = $ssl_verify, Array $tags = [], String $url = 'http://localhost:9200', Optional[String] $username = undef, @@ -39,12 +40,6 @@ ) inherits datadog_agent::params { 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 - if $ssl_verify.is_a(String) { - validate_absolute_path($ssl_verify) #potentially replace with find_file - } - if !$instances and $url { $_instances = [{ 'cluster_stats' => $cluster_stats, @@ -54,7 +49,7 @@ 'pshard_stats' => $pshard_stats, 'ssl_cert' => $ssl_cert, 'ssl_key' => $ssl_key, - 'ssl_verify' => $ssl_verify, + 'tls_verify' => $tls_verify, 'tags' => $tags, 'url' => $url, 'username' => $username diff --git a/templates/agent-conf.d/elastic.yaml.erb b/templates/agent-conf.d/elastic.yaml.erb index 6eebac2ee..561a88cb7 100644 --- a/templates/agent-conf.d/elastic.yaml.erb +++ b/templates/agent-conf.d/elastic.yaml.erb @@ -16,7 +16,7 @@ instances: pshard_stats: <%= instance['pshard_stats'] %> pending_task_stats: <%= instance['pending_task_stats'] %> <%- if instance['url'].match(/^https/) -%> - ssl_verify: <%= instance['ssl_verify'] %> + tls_verify: <%= instance['tls_verify'] %> <%- end -%> <%- if instance['ssl_cert'] && instance['ssl_cert'] != :undef -%> ssl_cert: <%= instance['ssl_cert'] %> From 86d5ec07ad91c9b68857fb1958bd03a7e8b9848f Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 4 Feb 2025 07:53:06 +0000 Subject: [PATCH 049/133] update change log inline with change suggested for tls_verify --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f61fd2e80..a5d5d8267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Changes * [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#823]) * [BUGFIX] Fix issue where MSI path was not correctly parsed ([#823]) * [FEATURE] Update to CI Builds to work with Ruby 3 +* [DEPRECATE] Remove support for supply a String to the SSL_Verify option on the elasticsearch integration. We now use tls_verify which matches core DataDog code. # 3.23.0 / 2024-12-09 From 85d7a167cc6be54b827ce90e08adc4a1af9b1761 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 4 Feb 2025 07:59:19 +0000 Subject: [PATCH 050/133] update gem following vuln check --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 2624b25a6..3c8e95399 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ group :development do gem "kitchen-puppet" gem "kitchen-docker" gem "kitchen-verifier-serverspec" - gem "rexml", '>= 3.0.0', '< 3.2.7', require: false + gem "rexml", '= 3.2.6' require: false gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') gem "test-kitchen", '= 3.0.0', platforms: [:ruby] From 097fc0f95d3b9882a98f8f510e33d4a8fd30a9dd Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 4 Feb 2025 08:08:03 +0000 Subject: [PATCH 051/133] added back in missing comma --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 3c8e95399..432be7e61 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ group :development do gem "kitchen-puppet" gem "kitchen-docker" gem "kitchen-verifier-serverspec" - gem "rexml", '= 3.2.6' require: false + gem "rexml", '= 3.2.6', require: false gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') gem "test-kitchen", '= 3.0.0', platforms: [:ruby] From c34dd940366a5a220b7cc937723a2ff9aff871a4 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Tue, 4 Feb 2025 13:26:55 +0000 Subject: [PATCH 052/133] fix tls/ssl verify in tests --- .../datadog_agent_integrations_elasticsearch_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb b/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb index 283201ba9..5cbb1e498 100644 --- a/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb +++ b/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb @@ -31,7 +31,7 @@ it { is_expected.to contain_file(conf_file).with_content(%r{ pshard_stats: false}) } it { is_expected.not_to contain_file(conf_file).with_content(%r{ username}) } it { is_expected.not_to contain_file(conf_file).with_content(%r{ password}) } - it { is_expected.not_to contain_file(conf_file).with_content(%r{ ssl_verify}) } + it { is_expected.not_to contain_file(conf_file).with_content(%r{ tls_verify}) } it { is_expected.not_to contain_file(conf_file).with_content(%r{ ssl_cert}) } it { is_expected.not_to contain_file(conf_file).with_content(%r{ ssl_key}) } it { is_expected.not_to contain_file(conf_file).with_content(%r{ tags:}) } @@ -54,7 +54,7 @@ it { is_expected.to contain_file(conf_file).with_content(%r{ pending_task_stats: false}) } it { is_expected.to contain_file(conf_file).with_content(%r{ username: username}) } it { is_expected.to contain_file(conf_file).with_content(%r{ password: password}) } - it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_verify: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_verify: true}) } it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_cert: /etc/ssl/certs/client.pem}) } it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_key: /etc/ssl/private/client.key}) } it { is_expected.to contain_file(conf_file).with_content(%r{ tags:}) } @@ -73,7 +73,7 @@ 'pshard_stats' => true, 'url' => 'https://foo:4242', 'username' => 'username', - 'ssl_verify' => true, + 'tls_verify' => true, 'ssl_cert' => '/etc/ssl/certs/client.pem', 'ssl_key' => '/etc/ssl/private/client.key', 'tags' => ['tag1:key1'], @@ -86,7 +86,7 @@ 'pshard_stats' => false, 'url' => 'https://bar:2424', 'username' => 'username_2', - 'ssl_verify' => false, + 'tls_verify' => false, 'tags' => ['tag2:key2'], }, ], @@ -101,7 +101,7 @@ it { is_expected.to contain_file(conf_file).with_content(%r{ username: username}) } it { is_expected.to contain_file(conf_file).with_content(%r{ password: password}) } it { is_expected.to contain_file(conf_file).with_content(%r{ pshard_stats: true}) } - it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_verify: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_verify: true}) } it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_cert: /etc/ssl/certs/client.pem}) } it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_key: /etc/ssl/private/client.key}) } it { is_expected.to contain_file(conf_file).with_content(%r{ tags:\n - tag1:key1}) } @@ -112,7 +112,7 @@ it { is_expected.to contain_file(conf_file).with_content(%r{ username: username_2}) } it { is_expected.to contain_file(conf_file).with_content(%r{ password: password_2}) } it { is_expected.to contain_file(conf_file).with_content(%r{ pshard_stats: false}) } - it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_verify: false}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_verify: false}) } it { is_expected.to contain_file(conf_file).with_content(%r{ tags:\n - tag2:key2}) } end end From 78c89eb8705d12eda68197c9d52ed9ab7bfc1b53 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 09:57:28 -0500 Subject: [PATCH 053/133] update kitchen tests --- Gemfile | 30 +++--- Gemfile.lock | 4 +- kitchen.yml | 281 ++++++++++++++++++++++++++++++--------------------- 3 files changed, 185 insertions(+), 130 deletions(-) diff --git a/Gemfile b/Gemfile index 2624b25a6..9552f9029 100644 --- a/Gemfile +++ b/Gemfile @@ -30,22 +30,22 @@ group :development do gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "bcrypt_pbkdf", '= 1.0.1', require: false gem "kitchen-puppet" - gem "kitchen-docker" + gem "kitchen-docker", '~> 3.0.0', require: false gem "kitchen-verifier-serverspec" - gem "rexml", '>= 3.0.0', '< 3.2.7', require: false - gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] + gem "rexml", '= 3.2.6', require: false + gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') gem "test-kitchen", '= 3.0.0', platforms: [:ruby] gem "rubocop", '~> 1.30', require: false - gem "rubocop-rspec", '= 2.10.0', require: false - gem "facterdb", '~> 1.21', require: false - gem "rspec-puppet-facts", '~> 1.10.0', require: false - gem "rubocop-performance", '~> 1.11', require: false + gem "rubocop-rspec", '= 2.10.0', require: false + gem "facterdb", '~> 1.21', require: false + gem "rspec-puppet-facts", '~> 1.10.0', require: false + gem "rubocop-performance", '~> 1.11', require: false gem "librarian-puppet", '= 4.0.1' - gem "io-console", '= 0.5.9', require: false - gem "metadata-json-lint", '~> 3.0.3', require: false + gem "io-console", '= 0.5.9', require: false + gem "metadata-json-lint", '~> 3.0.3', require: false gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false - gem "dependency_checker", '= 0.3.0', require: false + gem "dependency_checker", '= 0.3.0', require: false else gem "facterdb", '~> 2.1', require: false gem "test-kitchen", '~> 3.7.0' @@ -63,8 +63,8 @@ end group :development, :release_prep do if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') gem "puppetlabs_spec_helper", '~> 5.0.3', require: false - gem "puppet-blacksmith", '= 6.1.1', require: false - gem "puppet-strings", '= 2.9.0', require: false + gem "puppet-blacksmith", '= 6.1.1', require: false + gem "puppet-strings", '= 2.9.0', require: false else gem "puppetlabs_spec_helper", '~> 8.0', require: false gem "puppet-blacksmith", '~> 7.0', require: false @@ -75,10 +75,10 @@ group :system_tests do if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') gem "puppet_litmus", '= 0.0.1', require: false, platforms: [:ruby, :x64_mingw] else - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] end - gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "serverspec", '~> 2.41', require: false + gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "serverspec", '~> 2.41', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Gemfile.lock b/Gemfile.lock index e5b77842e..7986edcf2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -529,7 +529,7 @@ DEPENDENCIES facterdb (~> 2.1) io-console (= 0.7.2) json (= 2.6.3) - kitchen-docker + kitchen-docker (~> 3.0.0) kitchen-puppet kitchen-verifier-serverspec librarian-puppet (~> 5.0) @@ -544,7 +544,7 @@ DEPENDENCIES puppet_litmus (~> 1.0) puppetlabs_spec_helper (~> 8.0) rb-readline (= 0.5.5) - rexml (>= 3.0.0, < 3.2.7) + rexml (= 3.2.6) rspec-puppet-facts (~> 4.0) rubocop (~> 1.50.0) rubocop-performance (= 1.16.0) diff --git a/kitchen.yml b/kitchen.yml index 596955d08..fd06d8aae 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -14,118 +14,173 @@ provisioner: custom_pre_apply_command: 'cp -r /tmp/modules/* /tmp/kitchen/modules/' platforms: - - name: centos-7-puppet-5 - driver_config: - # we use a custom image that runs systemd - image: 'datadog/docker-library:chef_kitchen_systemd_centos_7' - run_command: /root/start.sh - driver: - provision_command: - - rpm -ivh http://yum.puppetlabs.com/puppet5-release-el-7.noarch.rpm #installs the puppet-agent repo - - yum install -y puppet-agent rubygems - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - - - name: rocky-8-puppet-5 - driver_config: - # we use a custom image that runs systemd - image: 'datadog/docker-library:chef_kitchen_systemd_rocky_8' - platform: rhel # kitchen-docker doesn't recognize rocky otherwise - run_command: /root/start.sh - driver: - provision_command: - - dnf install -y https://yum.puppetlabs.com/puppet7-release-el-8.noarch.rpm #installs the puppet-agent repo - - dnf install -y puppet-agent rubygems - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - - - name: ubuntu-1604-puppet-6 - driver_config: - # we use the official image - image: 'ubuntu:16.04' - driver: - provision_command: - - apt-get install -y apt-utils apt-transport-https ca-certificates - - wget https://apt.puppetlabs.com/puppet6-release-xenial.deb - - dpkg -i puppet6-release-xenial.deb #installs the puppet-agent repo - - apt-get update - - apt-get install -y puppet-agent rubygems - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - - - name: opensuse/leap-15 - # Workaround for flakes on initializing opensuse/leap-15: - # => SCP did not finish successfully (255): (Net::SCP::Error) - transport: - max_ssh_sessions: 1 - driver_config: - # we use a custom image that runs systemd - image: 'datadog/docker-library:chef_kitchen_systemd_opensuse_leap_15' - run_command: /root/start.sh - - driver: - 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 -v '= 2.4.13' - - gem install net-ssh -v '= 6.1.0' - - gem install rspec-its -v '= 1.3.1' - - 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 - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - cd /home && bundle.ruby2.5 install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - -verifier: - name: serverspec +- name: ubuntu-24.04-puppet-8 + driver: + image: 'ubuntu:24.04' + provision_command: + - apt-get install -y apt-utils apt-transport-https ca-certificates + - wget https://apt.puppet.com/puppet8-release-noble.deb + - dpkg -i puppet8-release-noble.deb #installs the puppet-agent repo + - apt-get update + - apt-get install -y puppet-agent rubygems ruby-dev make gcc + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +- name: ubuntu-22.04-puppet-8 + driver: + image: 'ubuntu:22.04' + provision_command: + - apt-get update + - apt-get install -y apt-utils apt-transport-https ca-certificates wget + - wget https://apt.puppet.com/puppet8-release-jammy.deb + - dpkg -i puppet8-release-jammy.deb #installs the puppet-agent repo + - apt-get update + - apt-get install -y puppet-agent rubygems ruby-dev make gcc + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet -p + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +- name: ubuntu-20.04-puppet-8 + driver: + image: 'ubuntu:20.04' + docker_platform: linux/amd64 + provision_command: + - apt-get install -y apt-utils apt-transport-https ca-certificates + - wget https://apt.puppet.com/puppet8-release-focal.deb + - dpkg -i puppet8-release-focal.deb #installs the puppet-agent repo + - apt-get update + - apt-get install -y puppet-agent rubygems + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +# mirrorlist.centos.org is no longer available for <= centos8/centos-stream8 +# - name: centos-stream8-puppet-8 +# driver_config: +# image: 'quay.io/centos/centos:stream9' +# platform: centosstream +# driver: +# use_sudo: true +# privileged: true +# provision_command: +# - rpm -Uvh https://yum.puppet.com/puppet8-release-el-8.noarch.rpm #installs the puppet-agent repo +# - yum install -y puppet-agent rubygems ruby-devel make gcc +# - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + +# - mkdir /home/kitchen/puppet -p +# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile +# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + +# - gem install bundler -v '= 2.4.13' +# # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post +# - cd /home && bundle install +# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +- name: centos-stream9-puppet-8 + driver: + image: 'quay.io/centos/centos:stream9' + platform: centosstream + use_sudo: true + privileged: true + provision_command: + - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo + - yum install -y puppet-agent rubygems ruby-devel + - dnf group install -y "Development Tools" + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet -p + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +- name: rocky-9-puppet-8 + driver: + image: 'rockylinux:9.3' + platform: centosstream # kitchen-docker has issues installing packages otherwises + provision_command: + - dnf install -y https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo + - dnf install -y puppet-agent rubygems ruby-devel + - dnf group install -y "Development Tools" + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +# - name: opensuse/leap-15 +# # Workaround for flakes on initializing opensuse/leap-15: +# # => SCP did not finish successfully (255): (Net::SCP::Error) +# transport: +# max_ssh_sessions: 1 +# driver_config: +# # we use a custom image that runs systemd +# image: 'datadog/docker-library:chef_kitchen_systemd_opensuse_leap_15' +# run_command: /root/start.sh +# driver: +# 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 -v '= 1.17.3' +# - gem install net-ssh -v '= 6.1.0' +# - gem install rspec-its -v '= 1.3.1' +# - 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 +# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile +# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + +# - cd /home && bundle.ruby2.5 install +# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules suites: - - name: dd-agent - manifests: init.pp - verifier: - default_pattern: true - additional_install_commmand: source /etc/profile.d/rvm.sh - env_vars: - TARGET_HOST: 127.0.0.1 - TARGET_PORT: 2222 - LOGIN_USER: root - LOGIN_PASSWORD: puppet - - name: dd-installer - manifests: init.pp - provisioner: - manifests_path: environments/etc/installer-manifests - verifier: - default_pattern: true - additional_install_commmand: source /etc/profile.d/rvm.sh - env_vars: - TARGET_HOST: 127.0.0.1 - TARGET_PORT: 2222 - LOGIN_USER: root - LOGIN_PASSWORD: puppet \ No newline at end of file +- name: dd-agent + manifests: init.pp + verifier: + default_pattern: true + additional_install_commmand: source /etc/profile.d/rvm.sh + env_vars: + TARGET_HOST: 127.0.0.1 + TARGET_PORT: 2222 + LOGIN_USER: root + LOGIN_PASSWORD: puppet +- name: dd-installer + manifests: init.pp + provisioner: + manifests_path: environments/etc/installer-manifests + verifier: + default_pattern: true + additional_install_commmand: source /etc/profile.d/rvm.sh + env_vars: + TARGET_HOST: 127.0.0.1 + TARGET_PORT: 2222 + LOGIN_USER: root + LOGIN_PASSWORD: puppet From 84cf6b6328e17309ccf35cda2c352ee45f55ef8b Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 10:00:55 -0500 Subject: [PATCH 054/133] update kitchen ruby version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 281a624b3..330f2463c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -156,7 +156,7 @@ jobs: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.7.5' + RUBY_VERSION: '3.2.2' steps: - checkout - run: From daa5d99d5a729be9d60e352b95c4d9044f2415d9 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 12:17:42 -0500 Subject: [PATCH 055/133] update env/Gemfile --- environments/etc/Gemfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/environments/etc/Gemfile b/environments/etc/Gemfile index 83a6715d7..843b11a2f 100644 --- a/environments/etc/Gemfile +++ b/environments/etc/Gemfile @@ -1,4 +1,7 @@ source 'https://rubygems.org' -gem 'semantic_puppet', '1.0.4' -gem 'multipart-post', '2.1.1' -gem 'r10k', '2.6.7' \ No newline at end of file +gem 'semantic_puppet', '1.1.1' +gem 'multipart-post', '2.4.1' +gem 'r10k', '4.1.0' +# gem 'json', '2.6.3' +# gem 'racc', '~> 1.4.0' +# gem 'net-ssh', '~> 7.3' \ No newline at end of file From 0571d2644e13c376af3746e4345ad64024f1b176 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 13:18:55 -0500 Subject: [PATCH 056/133] update env/Gemfile --- environments/etc/Gemfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/environments/etc/Gemfile b/environments/etc/Gemfile index 843b11a2f..b54feb2cb 100644 --- a/environments/etc/Gemfile +++ b/environments/etc/Gemfile @@ -2,6 +2,6 @@ source 'https://rubygems.org' gem 'semantic_puppet', '1.1.1' gem 'multipart-post', '2.4.1' gem 'r10k', '4.1.0' -# gem 'json', '2.6.3' -# gem 'racc', '~> 1.4.0' -# gem 'net-ssh', '~> 7.3' \ No newline at end of file +gem 'json', '2.6.3' +gem 'racc', '~> 1.4.0' +gem 'net-ssh', '~> 7.3' \ No newline at end of file From d0442d78addcc2d533f5891f36c693dc782c4c1a Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 14:43:02 -0500 Subject: [PATCH 057/133] try using ruby v3.1 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 330f2463c..448f58c97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -156,7 +156,7 @@ jobs: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '3.2.2' + RUBY_VERSION: '3.1.6' steps: - checkout - run: From 4ed29cb56acdcfc1135703244da9294acce819cf Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 15:46:05 -0500 Subject: [PATCH 058/133] add more unit test specs and bump versions --- .circleci/config.yml | 164 ++++++++++++++++++++++++++++++++----------- 1 file changed, 124 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 448f58c97..74a846859 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,13 +2,13 @@ version: 2.1 orbs: win: circleci/windows@2.2.0 jobs: - specs-ruby27-puppet65: &specs + specs-ruby27-puppet628: &ubuntu2004-specs machine: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' RUBY_VERSION: '2.7.5' - PUPPET_VERSION: '6.5.0' + PUPPET_VERSION: '6.28.0' steps: - checkout - run: @@ -37,62 +37,139 @@ jobs: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test - specs-ruby27-puppet79: - <<: *specs + specs-ruby31-puppet628: + <<: *ubuntu2004-specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.7.5' - PUPPET_VERSION: '7.9.0' + RUBY_VERSION: '3.1.6' + PUPPET_VERSION: '6.28.0' - specs-ruby27-puppet714: - <<: *specs + specs-ruby32-puppet628: + <<: *ubuntu2004-specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.7.5' - PUPPET_VERSION: '7.14.0' + RUBY_VERSION: '3.2.7' + PUPPET_VERSION: '6.28.0' - specs-ruby27-puppet725: - <<: *specs + specs-ruby33-puppet628: + <<: *ubuntu2004-specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.7.5' - PUPPET_VERSION: '7.25.0' + RUBY_VERSION: '3.3.7' + PUPPET_VERSION: '6.28.0' - specs-ruby26-puppet65: - <<: *specs + specs-ruby34-puppet628: + <<: *ubuntu2004-specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' - PUPPET_VERSION: '6.5.0' + RUBY_VERSION: '3.4.1' + PUPPET_VERSION: '6.28.0' - specs-ruby26-puppet79: - <<: *specs + specs-ruby26-puppet628: + <<: *ubuntu2004-specs environment: STRICT_VARIABLES: 'yes' RUBY_VERSION: '2.6.3' - PUPPET_VERSION: '7.9.0' + PUPPET_VERSION: '6.28.0' - specs-ruby26-puppet714: - <<: *specs + specs-ruby26-puppet734: + <<: *ubuntu2004-specs environment: STRICT_VARIABLES: 'yes' RUBY_VERSION: '2.6.3' - PUPPET_VERSION: '7.14.0' + PUPPET_VERSION: '7.34.0' - specs-ruby26-puppet725: - <<: *specs + specs-ruby27-puppet734: + <<: *ubuntu2004-specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' - PUPPET_VERSION: '7.25.0' + RUBY_VERSION: '2.7.5' + PUPPET_VERSION: '7.34.0' specs-ruby31-puppet734: - <<: *specs + <<: *ubuntu2004-specs environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '3.0.0' + RUBY_VERSION: '3.1.6' + PUPPET_VERSION: '7.34.0' + + specs-ruby32-puppet734: + <<: *ubuntu2004-specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '3.2.7' PUPPET_VERSION: '7.34.0' + specs-ruby33-puppet734: + <<: *ubuntu2004-specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '3.3.7' + PUPPET_VERSION: '7.34.0' + + specs-ruby34-puppet734: + <<: *ubuntu2004-specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '3.4.1' + PUPPET_VERSION: '7.34.0' + + specs-ruby31-puppet810: &ubuntu2404-specs + machine: + image: ubuntu-2404:2024.08.1 + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '3.1.6' + PUPPET_VERSION: '8.10.0' + steps: + - checkout + - run: + name: Install libcurl4 and openssl + command: | + # Needed to bundle install a puppet_litmus gem dependency + sudo apt update -y + sudo apt install -y libcurl4 curl libcurl4-openssl-dev + - run: + name: Install RVM + command: | + gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB + \curl -sSL https://get.rvm.io | bash -s stable + - run: + name: Install Ruby version + command: rvm install $RUBY_VERSION + - run: + name: Install bundler + command: | + rm Gemfile.lock && rvm $RUBY_VERSION --verbose do bundle config set path '.bundle' + rvm $RUBY_VERSION --verbose do gem install bundler:2.4.13 + - run: + name: Install gem dependencies + command: rvm $RUBY_VERSION --verbose do bundle install + - run: + name: Run tests + command: rvm $RUBY_VERSION --verbose do bundle exec rake test + + specs-ruby32-puppet810: + <<: *ubuntu2404-specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '3.2.7' + PUPPET_VERSION: '8.10.0' + + specs-ruby33-puppet810: + <<: *ubuntu2404-specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '3.3.7' + PUPPET_VERSION: '8.10.0' + + specs-ruby34-puppet810: + <<: *ubuntu2404-specs + environment: + STRICT_VARIABLES: 'yes' + RUBY_VERSION: '3.4.1' + PUPPET_VERSION: '8.10.0' + # specs-ruby27-puppet79-windows: # # &windows-specs # executor: @@ -119,10 +196,10 @@ jobs: verify-gemfile-lock-dependencies: machine: - image: ubuntu-2004:2024.08.1 + image: ubuntu-2404:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.7.5' + RUBY_VERSION: '3.4.1' steps: - checkout - run: @@ -189,15 +266,22 @@ jobs: workflows: build_and_test: jobs: - - specs-ruby26-puppet65 - - specs-ruby26-puppet79 - - specs-ruby26-puppet714 - - specs-ruby26-puppet725 + - specs-ruby26-puppet628 + - specs-ruby27-puppet628 + - specs-ruby31-puppet628 + - specs-ruby32-puppet628 + - specs-ruby33-puppet628 + - specs-ruby34-puppet628 + - specs-ruby26-puppet734 # - specs-ruby27-puppet79-windows # puppet_litmus requires a dependency "patron", which doesn't run on windows - - specs-ruby27-puppet65 - - specs-ruby27-puppet79 - - specs-ruby27-puppet714 - - specs-ruby27-puppet725 + - specs-ruby27-puppet734 - specs-ruby31-puppet734 + - specs-ruby32-puppet734 + - specs-ruby33-puppet734 + - specs-ruby34-puppet734 + - specs-ruby31-puppet810 + - specs-ruby32-puppet810 + - specs-ruby33-puppet810 + - specs-ruby34-puppet810 - verify-gemfile-lock-dependencies - kitchen-tests From 0926931fee442178e528ec489d56ccb6492c87d9 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 15:47:47 -0500 Subject: [PATCH 059/133] bump kitchen ubuntu and ruby versions --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 330f2463c..2bc2d2c3d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -153,10 +153,10 @@ jobs: kitchen-tests: machine: - image: ubuntu-2004:2024.08.1 + image: ubuntu-2404:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '3.2.2' + RUBY_VERSION: '3.4.1' steps: - checkout - run: From 12d1de447cf8a42d215f2f4b933097bbd03070e0 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 16:04:59 -0500 Subject: [PATCH 060/133] use ubuntu2204 for kitchen tests --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2bc2d2c3d..4690d36ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -153,7 +153,7 @@ jobs: kitchen-tests: machine: - image: ubuntu-2404:2024.08.1 + image: ubuntu-2204:2024.08.1 environment: STRICT_VARIABLES: 'yes' RUBY_VERSION: '3.4.1' From 15bcca381badef30b98aa9ecaffeaa3958779611 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 16:26:32 -0500 Subject: [PATCH 061/133] workaround for tmp directory mounted noexec issue --- .circleci/config.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 74a846859..962c45617 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,11 +12,14 @@ jobs: steps: - checkout - run: - name: Install libcurl4 and openssl + name: Setup command: | # Needed to bundle install a puppet_litmus gem dependency sudo apt update -y sudo apt install -y libcurl4 curl libcurl4-openssl-dev + + # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec + sudo chmod 1777 /tmp - run: name: Install RVM command: | @@ -124,11 +127,14 @@ jobs: steps: - checkout - run: - name: Install libcurl4 and openssl + name: Setup command: | # Needed to bundle install a puppet_litmus gem dependency sudo apt update -y sudo apt install -y libcurl4 curl libcurl4-openssl-dev + + # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec + sudo chmod 1777 /tmp - run: name: Install RVM command: | @@ -203,11 +209,14 @@ jobs: steps: - checkout - run: - name: Install libcurl4 and openssl + name: Setup command: | # Needed to bundle install a puppet_litmus gem dependency sudo apt update -y sudo apt install -y libcurl4 curl libcurl4-openssl-dev + + # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec + sudo chmod 1777 /tmp - run: name: Install RVM command: | From 79707d3e356a639589353213343a6a04229ac4fb Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 16:34:34 -0500 Subject: [PATCH 062/133] use recursive chmod --- .circleci/config.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 962c45617..bd5c39595 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: sudo apt install -y libcurl4 curl libcurl4-openssl-dev # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec - sudo chmod 1777 /tmp + sudo chmod -R 1777 /tmp - run: name: Install RVM command: | @@ -134,7 +134,7 @@ jobs: sudo apt install -y libcurl4 curl libcurl4-openssl-dev # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec - sudo chmod 1777 /tmp + sudo chmod -R 1777 /tmp - run: name: Install RVM command: | @@ -216,7 +216,7 @@ jobs: sudo apt install -y libcurl4 curl libcurl4-openssl-dev # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec - sudo chmod 1777 /tmp + sudo chmod -R 1777 /tmp - run: name: Install RVM command: | @@ -246,11 +246,14 @@ jobs: steps: - checkout - run: - name: Install libcurl4 and openssl + name: Setup command: | # Needed to bundle install a puppet_litmus gem dependency sudo apt update sudo apt install -y libcurl4 curl libcurl4-openssl-dev + + # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec + sudo chmod -R 1777 /tmp - run: name: Install RVM command: | From a2e6287678744c4e47e6d2393cc3ca9eb8ceae6a Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 17:00:46 -0500 Subject: [PATCH 063/133] disable ruby v3.4 unit test specs --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bd5c39595..eccf2d933 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -283,17 +283,17 @@ workflows: - specs-ruby31-puppet628 - specs-ruby32-puppet628 - specs-ruby33-puppet628 - - specs-ruby34-puppet628 + # - specs-ruby34-puppet628 # ruby v3.4 specs fail with `Puppet::Error: Cannot determine basic system flavour (Puppet::Error)` - specs-ruby26-puppet734 - # - specs-ruby27-puppet79-windows # puppet_litmus requires a dependency "patron", which doesn't run on windows + # - specs-ruby27-puppet79-windows # puppet_litmus requires a dependency "patron", which doesn't run on windows - specs-ruby27-puppet734 - specs-ruby31-puppet734 - specs-ruby32-puppet734 - specs-ruby33-puppet734 - - specs-ruby34-puppet734 + # - specs-ruby34-puppet734 - specs-ruby31-puppet810 - specs-ruby32-puppet810 - specs-ruby33-puppet810 - - specs-ruby34-puppet810 + # - specs-ruby34-puppet810 - verify-gemfile-lock-dependencies - kitchen-tests From ed26136511dd61af18334b526bef4ac72dc29fd6 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 17:38:17 -0500 Subject: [PATCH 064/133] remove puppetserver and bump module deps --- .fixtures.yml | 15 ++++++--------- metadata.json | 4 ---- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 651a28dfb..4f93d810a 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -2,26 +2,23 @@ fixtures: repositories: stdlib: repo: "https://github.com/puppetlabs/puppetlabs-stdlib.git" # TODO: why git: and not https:? - ref: "4.25.0" + ref: "v9.7.0" # Puppet >= 7.0.0 < 9.0.0 concat: repo: "https://github.com/puppetlabs/puppetlabs-concat.git" - ref: "4.1.1" + ref: "v9.1.0" # Puppet >= 7.0.0 < 9.0.0 apt: repo: "https://github.com/puppetlabs/puppetlabs-apt.git" - ref: "4.5.0" - puppetserver_gem: - repo: "https://github.com/puppetlabs/puppetlabs-puppetserver_gem.git" - ref: "1.0.0" + ref: "v10.0.1" # Puppet >= 7.0.0 < 9.0.0 forge_modules: yumrepo_core: repo: "puppetlabs/yumrepo_core" - ref: "1.2.0" + ref: "2.1.0" powershell: repo: "puppetlabs/powershell" - ref: "4.1.0" + ref: "6.0.2" zypprepo: repo: "puppet/zypprepo" - ref: "3.1.0" + ref: "5.0.0" symlinks: custom_datadog: "#{source_dir}/spec/custom_fixtures/custom_datadog" datadog_agent: "#{source_dir}" diff --git a/metadata.json b/metadata.json index 3c7767d0f..0429bb5f4 100644 --- a/metadata.json +++ b/metadata.json @@ -20,10 +20,6 @@ "name": "puppetlabs/apt", "version_requirement": ">=4.4.0 <10.0.0" }, - { - "name": "puppetlabs/puppetserver_gem", - "version_requirement": ">=1.0.0 <2.0.0" - }, { "name": "puppetlabs/yumrepo_core", "version_requirement": ">=1.0.3 < 3.0.0" From 83bebd10dc51137af782b59809cccbb8e6f7d6bb Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 17:49:34 -0500 Subject: [PATCH 065/133] remove puppetserver and bump module deps for kitchen tests --- environments/etc/Puppetfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/environments/etc/Puppetfile b/environments/etc/Puppetfile index d5db04514..e1cc4edd2 100644 --- a/environments/etc/Puppetfile +++ b/environments/etc/Puppetfile @@ -1,9 +1,8 @@ # Track control branch and fall-back to master if no matching branch. mod 'datadog_agent', :local => true -mod 'puppetlabs-apt', '2.4.0' -mod 'puppetlabs-concat', '4.0.0' -mod 'puppetlabs-puppetserver_gem', '1.0.0' -mod 'puppetlabs-stdlib', '4.25.0' -mod 'puppetlabs-powershell', '2.3.0' -mod 'puppetlabs-yumrepo_core', '1.0.3' -mod 'puppet-zypprepo', '3.1.0' +mod 'puppetlabs-apt', '10.0.1' +mod 'puppetlabs-concat', '9.1.0' +mod 'puppetlabs-stdlib', '9.7.0' +mod 'puppetlabs-powershell', '6.0.2' +mod 'puppetlabs-yumrepo_core', '2.1.0' +mod 'puppet-zypprepo', '5.0.0' From 0f0f50c5a11635b71a8d306bfa29e209452825b6 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 17:57:03 -0500 Subject: [PATCH 066/133] use ruby v3.3 for gemfile.lock test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eccf2d933..ce2afe1c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -205,7 +205,7 @@ jobs: image: ubuntu-2404:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '3.4.1' + RUBY_VERSION: '3.3.7' steps: - checkout - run: From f1b3fc51e0a6d1cfd86599ee278624e10fc6bdcc Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 19:22:37 -0500 Subject: [PATCH 067/133] bump rexml and use serverspec as kitchen verifier --- Gemfile | 2 +- Gemfile.lock | 4 ++-- kitchen.yml | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 9552f9029..9374e3389 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ group :development do gem "kitchen-puppet" gem "kitchen-docker", '~> 3.0.0', require: false gem "kitchen-verifier-serverspec" - gem "rexml", '= 3.2.6', require: false + gem "rexml", '~> 3.4.0', require: false gem "mixlib-shellout", "~> 2.2.7", platforms: [:ruby] if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') gem "test-kitchen", '= 3.0.0', platforms: [:ruby] diff --git a/Gemfile.lock b/Gemfile.lock index 7986edcf2..9f6f1a43f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -345,7 +345,7 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) retryable (3.0.5) - rexml (3.2.6) + rexml (3.4.0) rgen (0.9.1) rspec (3.13.0) rspec-core (~> 3.13.0) @@ -544,7 +544,7 @@ DEPENDENCIES puppet_litmus (~> 1.0) puppetlabs_spec_helper (~> 8.0) rb-readline (= 0.5.5) - rexml (= 3.2.6) + rexml (~> 3.4.0) rspec-puppet-facts (~> 4.0) rubocop (~> 1.50.0) rubocop-performance (= 1.16.0) diff --git a/kitchen.yml b/kitchen.yml index fd06d8aae..0c8650128 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -58,11 +58,11 @@ platforms: image: 'ubuntu:20.04' docker_platform: linux/amd64 provision_command: - - apt-get install -y apt-utils apt-transport-https ca-certificates + - apt-get install -y apt-utils apt-transport-https ca-certificates make gcc - wget https://apt.puppet.com/puppet8-release-focal.deb - dpkg -i puppet8-release-focal.deb #installs the puppet-agent repo - apt-get update - - apt-get install -y puppet-agent rubygems + - apt-get install -y puppet-agent rubygems ruby-dev - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - mkdir /home/kitchen/puppet @@ -165,6 +165,7 @@ suites: - name: dd-agent manifests: init.pp verifier: + name: serverspec default_pattern: true additional_install_commmand: source /etc/profile.d/rvm.sh env_vars: @@ -177,6 +178,7 @@ suites: provisioner: manifests_path: environments/etc/installer-manifests verifier: + name: serverspec default_pattern: true additional_install_commmand: source /etc/profile.d/rvm.sh env_vars: From 58a6654e5709020857b8302f2ea941428b8fe9c0 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 19:28:27 -0500 Subject: [PATCH 068/133] remove chmod /tmp --- .circleci/config.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ce2afe1c3..d1df049b6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,9 +17,6 @@ jobs: # Needed to bundle install a puppet_litmus gem dependency sudo apt update -y sudo apt install -y libcurl4 curl libcurl4-openssl-dev - - # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec - sudo chmod -R 1777 /tmp - run: name: Install RVM command: | @@ -132,9 +129,6 @@ jobs: # Needed to bundle install a puppet_litmus gem dependency sudo apt update -y sudo apt install -y libcurl4 curl libcurl4-openssl-dev - - # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec - sudo chmod -R 1777 /tmp - run: name: Install RVM command: | @@ -214,9 +208,6 @@ jobs: # Needed to bundle install a puppet_litmus gem dependency sudo apt update -y sudo apt install -y libcurl4 curl libcurl4-openssl-dev - - # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec - sudo chmod -R 1777 /tmp - run: name: Install RVM command: | @@ -249,11 +240,8 @@ jobs: name: Setup command: | # Needed to bundle install a puppet_litmus gem dependency - sudo apt update - sudo apt install -y libcurl4 curl libcurl4-openssl-dev - - # Set /tmp permissions to 1777: https://www.puppet.com/docs/puppet/8/server/known_issues.html#tmp-directory-mounted-noexec - sudo chmod -R 1777 /tmp + sudo apt update -y + sudo apt install -y libcurl4 curl libcurl4-openssl-dev - run: name: Install RVM command: | From 729a6d6c1585af33e57dfa61b80cd97b99c3a61d Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 19:37:21 -0500 Subject: [PATCH 069/133] revert kitchen changes -- being handled in PR #4 --- environments/etc/Gemfile | 9 +-- kitchen.yml | 143 ++++++++++++--------------------------- 2 files changed, 47 insertions(+), 105 deletions(-) diff --git a/environments/etc/Gemfile b/environments/etc/Gemfile index b54feb2cb..75e77da01 100644 --- a/environments/etc/Gemfile +++ b/environments/etc/Gemfile @@ -1,7 +1,4 @@ source 'https://rubygems.org' -gem 'semantic_puppet', '1.1.1' -gem 'multipart-post', '2.4.1' -gem 'r10k', '4.1.0' -gem 'json', '2.6.3' -gem 'racc', '~> 1.4.0' -gem 'net-ssh', '~> 7.3' \ No newline at end of file +gem 'semantic_puppet', '1.0.4' +gem 'multipart-post', '2.1.1' +gem 'r10k', '2.6.7' diff --git a/kitchen.yml b/kitchen.yml index fd06d8aae..83abf5e91 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -14,15 +14,15 @@ provisioner: custom_pre_apply_command: 'cp -r /tmp/modules/* /tmp/kitchen/modules/' platforms: -- name: ubuntu-24.04-puppet-8 +- name: centos-7-puppet-5 + driver_config: + # we use a custom image that runs systemd + image: 'datadog/docker-library:chef_kitchen_systemd_centos_7' + run_command: /root/start.sh driver: - image: 'ubuntu:24.04' provision_command: - - apt-get install -y apt-utils apt-transport-https ca-certificates - - wget https://apt.puppet.com/puppet8-release-noble.deb - - dpkg -i puppet8-release-noble.deb #installs the puppet-agent repo - - apt-get update - - apt-get install -y puppet-agent rubygems ruby-dev make gcc + - rpm -ivh http://yum.puppetlabs.com/puppet5-release-el-7.noarch.rpm #installs the puppet-agent repo + - yum install -y puppet-agent rubygems - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - mkdir /home/kitchen/puppet @@ -30,37 +30,40 @@ platforms: - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - gem install bundler -v '= 2.4.13' + # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post - cd /home && bundle install - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules -- name: ubuntu-22.04-puppet-8 +- name: rocky-8-puppet-5 + driver_config: + # we use a custom image that runs systemd + image: 'datadog/docker-library:chef_kitchen_systemd_rocky_8' + platform: rhel # kitchen-docker doesn't recognize rocky otherwise + run_command: /root/start.sh driver: - image: 'ubuntu:22.04' provision_command: - - apt-get update - - apt-get install -y apt-utils apt-transport-https ca-certificates wget - - wget https://apt.puppet.com/puppet8-release-jammy.deb - - dpkg -i puppet8-release-jammy.deb #installs the puppet-agent repo - - apt-get update - - apt-get install -y puppet-agent rubygems ruby-dev make gcc + - dnf install -y https://yum.puppetlabs.com/puppet7-release-el-8.noarch.rpm #installs the puppet-agent repo + - dnf install -y puppet-agent rubygems - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - mkdir /home/kitchen/puppet -p + - mkdir /home/kitchen/puppet - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - gem install bundler -v '= 2.4.13' + - cd /home && bundle install - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules -- name: ubuntu-20.04-puppet-8 +- name: ubuntu-1604-puppet-6 + driver_config: + # we use the official image + image: 'ubuntu:16.04' driver: - image: 'ubuntu:20.04' - docker_platform: linux/amd64 provision_command: - apt-get install -y apt-utils apt-transport-https ca-certificates - - wget https://apt.puppet.com/puppet8-release-focal.deb - - dpkg -i puppet8-release-focal.deb #installs the puppet-agent repo + - wget https://apt.puppetlabs.com/puppet6-release-xenial.deb + - dpkg -i puppet6-release-xenial.deb #installs the puppet-agent repo - apt-get update - apt-get install -y puppet-agent rubygems - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet @@ -73,93 +76,35 @@ platforms: - cd /home && bundle install - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules -# mirrorlist.centos.org is no longer available for <= centos8/centos-stream8 -# - name: centos-stream8-puppet-8 -# driver_config: -# image: 'quay.io/centos/centos:stream9' -# platform: centosstream -# driver: -# use_sudo: true -# privileged: true -# provision_command: -# - rpm -Uvh https://yum.puppet.com/puppet8-release-el-8.noarch.rpm #installs the puppet-agent repo -# - yum install -y puppet-agent rubygems ruby-devel make gcc -# - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - -# - mkdir /home/kitchen/puppet -p -# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile -# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - -# - gem install bundler -v '= 2.4.13' -# # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post -# - cd /home && bundle install -# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - -- name: centos-stream9-puppet-8 - driver: - image: 'quay.io/centos/centos:stream9' - platform: centosstream - use_sudo: true - privileged: true - provision_command: - - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo - - yum install -y puppet-agent rubygems ruby-devel - - dnf group install -y "Development Tools" - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet -p - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules +- name: opensuse/leap-15 + # Workaround for flakes on initializing opensuse/leap-15: + # => SCP did not finish successfully (255): (Net::SCP::Error) + transport: + max_ssh_sessions: 1 + driver_config: + # we use a custom image that runs systemd + image: 'datadog/docker-library:chef_kitchen_systemd_opensuse_leap_15' + run_command: /root/start.sh -- name: rocky-9-puppet-8 driver: - image: 'rockylinux:9.3' - platform: centosstream # kitchen-docker has issues installing packages otherwises provision_command: - - dnf install -y https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo - - dnf install -y puppet-agent rubygems ruby-devel - - dnf group install -y "Development Tools" - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - + - 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 -v '= 2.4.13' + - gem install net-ssh -v '= 6.1.0' + - gem install rspec-its -v '= 1.3.1' + - 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 - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - gem install bundler -v '= 2.4.13' - - - cd /home && bundle install + - cd /home && bundle.ruby2.5 install - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules -# - name: opensuse/leap-15 -# # Workaround for flakes on initializing opensuse/leap-15: -# # => SCP did not finish successfully (255): (Net::SCP::Error) -# transport: -# max_ssh_sessions: 1 -# driver_config: -# # we use a custom image that runs systemd -# image: 'datadog/docker-library:chef_kitchen_systemd_opensuse_leap_15' -# run_command: /root/start.sh -# driver: -# 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 -v '= 1.17.3' -# - gem install net-ssh -v '= 6.1.0' -# - gem install rspec-its -v '= 1.3.1' -# - 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 -# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile -# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - -# - cd /home && bundle.ruby2.5 install -# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules +verifier: + name: serverspec suites: - name: dd-agent From 4437ac72a45a31cce9515eb5725f46be1261c29a Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Feb 2025 21:09:52 -0500 Subject: [PATCH 070/133] add links to docs --- manifests/integrations/activemq_xml.pp | 11 +++- manifests/integrations/apache.pp | 3 ++ manifests/integrations/cacti.pp | 3 ++ manifests/integrations/cassandra.pp | 6 +++ manifests/integrations/ceph.pp | 3 ++ manifests/integrations/consul.pp | 3 ++ manifests/integrations/directory.pp | 3 ++ manifests/integrations/disk.pp | 3 ++ manifests/integrations/dns_check.pp | 3 ++ manifests/integrations/docker_daemon.pp | 3 ++ manifests/integrations/elasticsearch.pp | 3 ++ manifests/integrations/fluentd.pp | 3 ++ manifests/integrations/haproxy.pp | 3 ++ manifests/integrations/http_check.pp | 3 ++ manifests/integrations/jenkins.pp | 50 ------------------- manifests/integrations/jmx.pp | 3 ++ manifests/integrations/kafka.pp | 9 ++++ manifests/integrations/kong.pp | 5 +- manifests/integrations/kubernetes.pp | 3 ++ manifests/integrations/kubernetes_state.pp | 5 +- manifests/integrations/linux_proc_extras.pp | 3 ++ manifests/integrations/logs.pp | 3 ++ manifests/integrations/marathon.pp | 3 ++ manifests/integrations/memcache.pp | 3 ++ manifests/integrations/mesos_master.pp | 3 ++ manifests/integrations/mesos_slave.pp | 3 ++ manifests/integrations/mongo.pp | 3 ++ manifests/integrations/mysql.pp | 3 ++ manifests/integrations/network.pp | 3 ++ manifests/integrations/nginx.pp | 3 ++ manifests/integrations/ntp.pp | 3 ++ manifests/integrations/oom_kill.pp | 3 ++ manifests/integrations/pgbouncer.pp | 3 ++ manifests/integrations/php_fpm.pp | 3 ++ manifests/integrations/postfix.pp | 3 ++ manifests/integrations/postgres.pp | 31 ++---------- .../integrations/postgres_custom_metric.pp | 27 ---------- manifests/integrations/process.pp | 3 ++ manifests/integrations/rabbitmq.pp | 3 ++ manifests/integrations/redis.pp | 3 ++ manifests/integrations/riak.pp | 3 ++ manifests/integrations/snmp.pp | 3 ++ manifests/integrations/solr.pp | 9 ++++ manifests/integrations/ssh.pp | 3 ++ manifests/integrations/supervisord.pp | 3 ++ manifests/integrations/system_core.pp | 3 ++ manifests/integrations/tcp_check.pp | 3 ++ manifests/integrations/tomcat.pp | 9 ++++ manifests/integrations/twemproxy.pp | 3 ++ manifests/integrations/varnish.pp | 3 ++ manifests/integrations/zk.pp | 3 ++ ...datadog_agent_integrations_jenkins_spec.rb | 40 --------------- templates/agent-conf.d/jenkins.yaml.erb | 7 --- 53 files changed, 177 insertions(+), 155 deletions(-) delete mode 100644 manifests/integrations/jenkins.pp delete mode 100644 manifests/integrations/postgres_custom_metric.pp delete mode 100644 spec/classes/datadog_agent_integrations_jenkins_spec.rb delete mode 100644 templates/agent-conf.d/jenkins.yaml.erb diff --git a/manifests/integrations/activemq_xml.pp b/manifests/integrations/activemq_xml.pp index 3a0c31495..7dc33c08b 100644 --- a/manifests/integrations/activemq_xml.pp +++ b/manifests/integrations/activemq_xml.pp @@ -1,6 +1,15 @@ # Class: datadog_agent::integrations::activemq_xml # -# This class will install the necessary configuration for the activemq_xml integration +# This class will install the necessary configuration for the activemq_xml integration. +# +# See the sample activemq.d/conf.yaml for all available configuration options. +# https://github.com/DataDog/integrations-core/blob/master/activemq/datadog_checks/activemq/data/conf.yaml.example +# +# See the metrics.yaml file for the list of default collected metrics. +# https://github.com/DataDog/integrations-core/blob/master/activemq/datadog_checks/activemq/data/metrics.yaml +# +# This check has a limit of 350 metrics per instance. If you require +# additional metrics, contact Datadog Support at https://docs.datadoghq.com/help/ # # Parameters: # $url diff --git a/manifests/integrations/apache.pp b/manifests/integrations/apache.pp index 4f1547c62..0a7863f5a 100644 --- a/manifests/integrations/apache.pp +++ b/manifests/integrations/apache.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the apache integration # +# See the sample apache.d/conf.yaml for all available configuration options. +# https://github.com/DataDog/integrations-core/blob/master/apache/datadog_checks/apache/data/conf.yaml.example +# # Parameters: # $url: # The URL for apache status URL handled by mod-status. diff --git a/manifests/integrations/cacti.pp b/manifests/integrations/cacti.pp index 38c26d196..83ff46bb8 100644 --- a/manifests/integrations/cacti.pp +++ b/manifests/integrations/cacti.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the cacti integration # +# See the sample cacti.d/conf.yaml for all available configuration options. +# https://github.com/DataDog/integrations-core/blob/master/cacti/datadog_checks/cacti/data/conf.yaml.example +# # Parameters: # $host: # The host cacti MySQL db is running on diff --git a/manifests/integrations/cassandra.pp b/manifests/integrations/cassandra.pp index dc1a9ff36..7a7977738 100644 --- a/manifests/integrations/cassandra.pp +++ b/manifests/integrations/cassandra.pp @@ -3,6 +3,12 @@ # This class will install the necessary configuration for the Cassandra # integration. # +# See the sample cassandra.d/conf.yaml for all available configuration options. +# https://github.com/DataDog/integrations-core/blob/master/cassandra/datadog_checks/cassandra/data/conf.yaml.example +# +# See the metrics.yaml file for the list of default collected metrics. +# https://github.com/DataDog/integrations-core/blob/master/cassandra/datadog_checks/cassandra/data/metrics.yaml +# # This check has a limit of 350 metrics per instance. If you require # additional metrics, contact Datadog Support at https://docs.datadoghq.com/help/ # diff --git a/manifests/integrations/ceph.pp b/manifests/integrations/ceph.pp index 33eec0868..be4316695 100644 --- a/manifests/integrations/ceph.pp +++ b/manifests/integrations/ceph.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the ceph integration # +# See the sample ceph.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/ceph/datadog_checks/ceph/data/conf.yaml.example +# # Parameters: # $tags # Optional array of tags diff --git a/manifests/integrations/consul.pp b/manifests/integrations/consul.pp index 05c6d30f1..543146663 100644 --- a/manifests/integrations/consul.pp +++ b/manifests/integrations/consul.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the consul integration # +# See the sample consul.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/consul/datadog_checks/consul/data/conf.yaml.example +# # Parameters: # $url: # The URL for consul diff --git a/manifests/integrations/directory.pp b/manifests/integrations/directory.pp index 87f680b0e..70f989ae9 100644 --- a/manifests/integrations/directory.pp +++ b/manifests/integrations/directory.pp @@ -2,6 +2,9 @@ # # This class will install the necessary config to hook the directory in the agent # +# See the sample directory.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/directory/datadog_checks/directory/data/conf.yaml.example +# # Parameters: # directory # (Required) - string, the directory path to monitor diff --git a/manifests/integrations/disk.pp b/manifests/integrations/disk.pp index 7c36db621..9da94a97a 100644 --- a/manifests/integrations/disk.pp +++ b/manifests/integrations/disk.pp @@ -2,6 +2,9 @@ # # This class will install the necessary config to hook the disk check # +# See the sample disk.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/disk/datadog_checks/disk/data/conf.yaml.default +# # Parameters: # $use_mount # The use_mount parameter will instruct the check to collect disk diff --git a/manifests/integrations/dns_check.pp b/manifests/integrations/dns_check.pp index d4784c8da..5bbc3b855 100644 --- a/manifests/integrations/dns_check.pp +++ b/manifests/integrations/dns_check.pp @@ -3,6 +3,9 @@ # This class will install the necessary configuration for the DNS check # integration. # +# See the sample dns_check.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/dns_check/datadog_checks/dns_check/data/conf.yaml.example +# # Parameters: # $hostname: # Domain or IP you wish to check the availability of. diff --git a/manifests/integrations/docker_daemon.pp b/manifests/integrations/docker_daemon.pp index 5ec6bc565..cdd65e2c2 100644 --- a/manifests/integrations/docker_daemon.pp +++ b/manifests/integrations/docker_daemon.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the docker integration # +# See the sample docker_daemon.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/docker_daemon/datadog_checks/docker_daemon/data/conf.yaml.example +# # Parameters: # $url: # The URL for docker API diff --git a/manifests/integrations/elasticsearch.pp b/manifests/integrations/elasticsearch.pp index 8bd8ead40..28c384eca 100644 --- a/manifests/integrations/elasticsearch.pp +++ b/manifests/integrations/elasticsearch.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the elasticsearch integration # +# See the sample elastic.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/elastic/datadog_checks/elastic/data/conf.yaml.example +# # Parameters: # $url: # The URL for Elasticsearch diff --git a/manifests/integrations/fluentd.pp b/manifests/integrations/fluentd.pp index 7f9251746..c39471ff7 100644 --- a/manifests/integrations/fluentd.pp +++ b/manifests/integrations/fluentd.pp @@ -2,6 +2,9 @@ # # This class will install the fluentd integration # +# See the sample fluentd.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/fluentd/datadog_checks/fluentd/data/conf.yaml.example +# # Parameters: # $monitor_agent_url # The url fluentd lists it's plugins on diff --git a/manifests/integrations/haproxy.pp b/manifests/integrations/haproxy.pp index 63a661c2f..b12891c1b 100644 --- a/manifests/integrations/haproxy.pp +++ b/manifests/integrations/haproxy.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the haproxy integration # +# See the sample haproxy.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/haproxy/datadog_checks/haproxy/data/conf.yaml.example +# # Parameters: # $url: # The URL for haproxy diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index e9a37fd65..cdc34c425 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -2,6 +2,9 @@ # # This class will install the necessary config to hook the http_check in the agent # +# See the sample http_check.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/http_check/datadog_checks/http_check/data/conf.yaml.example +# # Parameters: # sitename # (Required) The name of the instance. diff --git a/manifests/integrations/jenkins.pp b/manifests/integrations/jenkins.pp deleted file mode 100644 index 262b977c7..000000000 --- a/manifests/integrations/jenkins.pp +++ /dev/null @@ -1,50 +0,0 @@ -# Class: datadog_agent::integrations::jenkins -# -# This class will install the necessary configuration for the jenkins integration -# -# Parameters: -# $path: -# Jenkins path. Defaults to '/var/lib/jenkins' -# -# Sample Usage: -# -# class { 'datadog_agent::integrations::jenkins' : -# path => '/var/lib/jenkins', -# } -# -# -class datadog_agent::integrations::jenkins ( - String $path = '/var/lib/jenkins' -) inherits datadog_agent::params { - require datadog_agent - - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/jenkins.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/jenkins.d" - file { $legacy_dst: - ensure => 'absent', - } - - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst - } - - file { $dst: - ensure => file, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_protected_file, - content => template('datadog_agent/agent-conf.d/jenkins.yaml.erb'), - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } -} diff --git a/manifests/integrations/jmx.pp b/manifests/integrations/jmx.pp index 72b18fa59..997602962 100644 --- a/manifests/integrations/jmx.pp +++ b/manifests/integrations/jmx.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the jmx integration # +# See the sample jmx.d/conf.yaml for all available configuration options +# https://docs.datadoghq.com/integrations/java/?tab=host#overview +# # Parameters: # $init_config: # Hash of inital configuration, consisting of the following keys: diff --git a/manifests/integrations/kafka.pp b/manifests/integrations/kafka.pp index ae8528817..8a5f6521d 100644 --- a/manifests/integrations/kafka.pp +++ b/manifests/integrations/kafka.pp @@ -2,6 +2,15 @@ # # This class will install the necessary configuration for the kafka integration # +# See the sample kafka.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/kafka/datadog_checks/kafka/data/conf.yaml.example +# +# # See the metrics.yaml file for the list of default collected metrics. +# https://github.com/DataDog/integrations-core/blob/master/kafka/datadog_checks/kafka/data/metrics.yaml +# +# This check has a limit of 350 metrics per instance. If you require +# additional metrics, contact Datadog Support at https://docs.datadoghq.com/help/ +# # Parameters: # $host: # The host kafka is running on. Defaults to 'localhost' diff --git a/manifests/integrations/kong.pp b/manifests/integrations/kong.pp index e972b73c7..34d309aac 100644 --- a/manifests/integrations/kong.pp +++ b/manifests/integrations/kong.pp @@ -2,7 +2,10 @@ # # This class will install the necessary configuration for the Kong integration # -# Note: if you're Cassandra data-store is large in size the `/status` page may +# See the sample kong.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/kong/datadog_checks/kong/data/conf.yaml.example +# +# Note: if your Kong data-store is large in size the `/status` page may # take a long time to return. # # diff --git a/manifests/integrations/kubernetes.pp b/manifests/integrations/kubernetes.pp index 83bd05e40..04ad849e9 100644 --- a/manifests/integrations/kubernetes.pp +++ b/manifests/integrations/kubernetes.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the kubernetes integration # +# See the sample kubernetes.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/kubernetes/datadog_checks/kubernetes/data/conf.yaml.example +# # Parameters: # $url: # The URL for kubernetes API diff --git a/manifests/integrations/kubernetes_state.pp b/manifests/integrations/kubernetes_state.pp index 84357f43a..e8e1e59f3 100644 --- a/manifests/integrations/kubernetes_state.pp +++ b/manifests/integrations/kubernetes_state.pp @@ -1,6 +1,9 @@ # Class: datadog_agent::integrations::kubernetes # -# This class will install the necessary configuration for the kubernetes integration +# This class will install the necessary configuration for the kubernetes_state integration +# +# See the sample kubernetes_state.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/kubernetes_state/datadog_checks/kubernetes_state/data/conf.yaml.example # # Parameters: # $url: diff --git a/manifests/integrations/linux_proc_extras.pp b/manifests/integrations/linux_proc_extras.pp index b9d848b19..837897a14 100644 --- a/manifests/integrations/linux_proc_extras.pp +++ b/manifests/integrations/linux_proc_extras.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the CPU cores integration # +# See the sample linux_proc_extras.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/linux_proc_extras/datadog_checks/linux_proc_extras/data/conf.yaml.example +# # Parameters: # # tags diff --git a/manifests/integrations/logs.pp b/manifests/integrations/logs.pp index d40a5fcb7..914f7d83a 100644 --- a/manifests/integrations/logs.pp +++ b/manifests/integrations/logs.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the logs integration. # +# See the Datadog Logs Collection docs for all available configuration options +# https://docs.datadoghq.com/agent/logs/?tab=tailfiles#custom-log-collection +# # Parameters: # $logs: # array of log sources. diff --git a/manifests/integrations/marathon.pp b/manifests/integrations/marathon.pp index 1c6c51a02..8b2c29455 100644 --- a/manifests/integrations/marathon.pp +++ b/manifests/integrations/marathon.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the Marathon integration # +# See the sample marathon.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/marathon/datadog_checks/marathon/data/conf.yaml.example +# # Parameters: # $url: # The URL for Marathon diff --git a/manifests/integrations/memcache.pp b/manifests/integrations/memcache.pp index 8a507a061..13ad9d1e9 100644 --- a/manifests/integrations/memcache.pp +++ b/manifests/integrations/memcache.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the memcache integration # +# See the sample memcache.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/memcache/datadog_checks/memcache/data/conf.yaml.example +# # Parameters: # $url: # url used to connect to the memcached instance diff --git a/manifests/integrations/mesos_master.pp b/manifests/integrations/mesos_master.pp index fa6fcf5b0..7692f0715 100644 --- a/manifests/integrations/mesos_master.pp +++ b/manifests/integrations/mesos_master.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the mesos integration # +# See the sample mesos_master.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/mesos_master/datadog_checks/mesos_master/data/conf.yaml.example +# # Parameters: # $url: # The URL for Mesos master diff --git a/manifests/integrations/mesos_slave.pp b/manifests/integrations/mesos_slave.pp index 9dcd574ae..8ff388b44 100644 --- a/manifests/integrations/mesos_slave.pp +++ b/manifests/integrations/mesos_slave.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the mesos slave integration # +# See the sample mesos_slave.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/mesos_slave/datadog_checks/mesos_slave/data/conf.yaml.example +# # Parameters: # $url: # The URL for Mesos slave diff --git a/manifests/integrations/mongo.pp b/manifests/integrations/mongo.pp index bfa8dd8b9..a71e80184 100644 --- a/manifests/integrations/mongo.pp +++ b/manifests/integrations/mongo.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the mongo integration # +# See the sample mongo.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/mongo/datadog_checks/mongo/data/conf.yaml.example +# # NOTE: In newer versions of the Datadog Agent, the ssl parameters will be deprecated in favor the tls variants # # Parameters: diff --git a/manifests/integrations/mysql.pp b/manifests/integrations/mysql.pp index a539b4b7c..5947e0009 100644 --- a/manifests/integrations/mysql.pp +++ b/manifests/integrations/mysql.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the mysql integration # +# See the sample mysql.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/mysql/datadog_checks/mysql/data/conf.yaml.example +# # Parameters: # $password # The mysql password for the datadog user diff --git a/manifests/integrations/network.pp b/manifests/integrations/network.pp index 92a8d4544..d26a57e22 100644 --- a/manifests/integrations/network.pp +++ b/manifests/integrations/network.pp @@ -2,6 +2,9 @@ # # This class will install the network integration # +# See the sample network.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/network/datadog_checks/network/data/conf.yaml.default +# # Parameters: # $collect_connection_state # Enable TCP connection state counts diff --git a/manifests/integrations/nginx.pp b/manifests/integrations/nginx.pp index d870ec3cd..9d52fb32b 100644 --- a/manifests/integrations/nginx.pp +++ b/manifests/integrations/nginx.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the nginx integration # +# See the sample nginx.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/nginx/datadog_checks/nginx/data/conf.yaml.example +# # Parameters: # $instances: # Array of hashes for all nginx urls and associates tags. See example diff --git a/manifests/integrations/ntp.pp b/manifests/integrations/ntp.pp index 4b8884427..61cee0331 100644 --- a/manifests/integrations/ntp.pp +++ b/manifests/integrations/ntp.pp @@ -2,6 +2,9 @@ # # This class will enable ntp check # +# See the sample ntp.d/conf.yaml for all available configuration options +# https://github.com/DataDog/datadog-agent/blob/main/cmd/agent/dist/conf.d/ntp.d/conf.yaml.default +# # Parameters: # $offset_threshold: # Offset threshold for a critical alert. Defaults to 600. diff --git a/manifests/integrations/oom_kill.pp b/manifests/integrations/oom_kill.pp index 5167d7640..0d15c85ec 100644 --- a/manifests/integrations/oom_kill.pp +++ b/manifests/integrations/oom_kill.pp @@ -3,6 +3,9 @@ # This class will install the necessary configuration for the oom_kill integration # For it to work you also need to enable the system-probe with enable_oom_kill set to true. # +# See the sample oom_kill.d/conf.yaml for all available configuration options +# https://github.com/DataDog/datadog-agent/blob/main/cmd/agent/dist/conf.d/oom_kill.d/conf.yaml.example +# # Parameters: # $instances: # Array of hashes for all oom_kill configs and associates tags. See example diff --git a/manifests/integrations/pgbouncer.pp b/manifests/integrations/pgbouncer.pp index f29bef5ce..038ddd46b 100644 --- a/manifests/integrations/pgbouncer.pp +++ b/manifests/integrations/pgbouncer.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the pgbouncer integration # +# See the sample pgbouncer.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/pgbouncer/datadog_checks/pgbouncer/data/conf.yaml.example +# # Parameters: # $password: # The password for the datadog user diff --git a/manifests/integrations/php_fpm.pp b/manifests/integrations/php_fpm.pp index 9438db67b..0d05163ef 100644 --- a/manifests/integrations/php_fpm.pp +++ b/manifests/integrations/php_fpm.pp @@ -2,6 +2,9 @@ # # This class will set-up PHP FPM monitoring # +# See the sample php_fpm.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/php_fpm/datadog_checks/php_fpm/data/conf.yaml.example +# # @param status_url # URL to fetch FPM metrics. Default: http://localhost/status # diff --git a/manifests/integrations/postfix.pp b/manifests/integrations/postfix.pp index 60c786da5..18c1769d4 100644 --- a/manifests/integrations/postfix.pp +++ b/manifests/integrations/postfix.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the Postfix integration # +# See the sample postfix.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/postfix/datadog_checks/postfix/data/conf.yaml.example +# # Parameters: # $url: # url used to connect to the Postfixd instance diff --git a/manifests/integrations/postgres.pp b/manifests/integrations/postgres.pp index fb3ea3f40..ba56d5cc9 100644 --- a/manifests/integrations/postgres.pp +++ b/manifests/integrations/postgres.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the postgres integration # +# See the sample postgres.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/postgres/datadog_checks/postgres/data/conf.yaml.example +# # Parameters: # $password # The password for the datadog user @@ -38,10 +41,6 @@ # (10 + 10 per index) # $tags # Optional array of tags -# $custom_metrics -# A hash of custom metrics with the following keys - query, metrics, -# relation, descriptors. Refer to this guide for details on those fields: -# https://help.datadoghq.com/hc/en-us/articles/208385813-Postgres-custom-metric-collection-explained # # Sample Usage: # @@ -51,18 +50,6 @@ # username => 'datadog', # password => 'some_pass', # ssl => false, -# custom_metrics => { -# a_custom_query => { -# query => "select tag_column, %s from table", -# relation => false, -# metrics => { -# value_column => ["value_column.datadog.tag", "GAUGE"] -# }, -# descriptors => [ -# ["tag_column", "tag_column.datadog.tag"] -# ] -# } -# } # } # # Hiera Usage: @@ -73,14 +60,6 @@ # username: 'datadog' # password: 'some_pass' # ssl: false -# custom_metrics: -# a_custom_query: -# query: 'select tag_column, %s from table' -# relation: false -# metrics: -# value_column: ["value_column.datadog.tag", "GAUGE"] -# descriptors: -# - ["tag_column", "tag_column.datadog.tag"] # class datadog_agent::integrations::postgres ( Optional[String] $password = undef, @@ -97,7 +76,6 @@ Boolean $collect_default_database = false, Array[String] $tags = [], Array[String] $tables = [], - Hash $custom_metrics = {}, Optional[Array] $instances = undef, ) inherits datadog_agent::params { require datadog_agent @@ -133,7 +111,6 @@ 'use_psycopg2' => $use_psycopg2, 'tags' => $tags, 'tables' => $tables, - 'custom_metrics' => $custom_metrics, 'collect_function_metrics' => $collect_function_metrics, 'collect_count_metrics' => $collect_count_metrics, 'collect_activity_metrics' => $collect_activity_metrics, @@ -155,6 +132,4 @@ require => Package[$datadog_agent::params::package_name], notify => Service[$datadog_agent::params::service_name], } - - create_resources('datadog_agent::integrations::postgres_custom_metric', $custom_metrics) } diff --git a/manifests/integrations/postgres_custom_metric.pp b/manifests/integrations/postgres_custom_metric.pp deleted file mode 100644 index 92011034f..000000000 --- a/manifests/integrations/postgres_custom_metric.pp +++ /dev/null @@ -1,27 +0,0 @@ -## -# The postgres_custom_metric defines a custom sql metric. -# https://help.datadoghq.com/hc/en-us/articles/208385813-Postgres-custom-metric-collection-explained -# -# $query: -# The custom metric SQL query. It must contain a '%s' for defining the metrics. -# -# $metrics: -# a hash of column name to metric definition. a metric definition is an array -# consisting of two columns -- the datadog metric name and the metric type. -# -# $relation: -# ? -# -# $descriptor: -# an array that maps an sql column's to a tag. Each descriptor consists of two -# fields -- column name, and datadog tag. -define datadog_agent::integrations::postgres_custom_metric ( - String $query, - Hash $metrics, - Boolean $relation = false, - Array $descriptors = [], -) { - if $query !~ '^.*%s.*$' { - fail('custom_metrics require %s for metric substitution') - } -} diff --git a/manifests/integrations/process.pp b/manifests/integrations/process.pp index 09b3b9902..81d72701e 100644 --- a/manifests/integrations/process.pp +++ b/manifests/integrations/process.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the process integration # +# See the sample process.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/process/datadog_checks/process/data/conf.yaml.example +# # Parameters: # $processes: # Array of process hashes. See example diff --git a/manifests/integrations/rabbitmq.pp b/manifests/integrations/rabbitmq.pp index d0451611d..a911d52d9 100644 --- a/manifests/integrations/rabbitmq.pp +++ b/manifests/integrations/rabbitmq.pp @@ -2,6 +2,9 @@ # # This class will install the necessary config to hook the rabbitmq in the agent # +# See the sample rabbitmq.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/rabbitmq/datadog_checks/rabbitmq/data/conf.yaml.example +# # Parameters: # $url # Required. URL pointing to the RabbitMQ Managment Plugin diff --git a/manifests/integrations/redis.pp b/manifests/integrations/redis.pp index 34429ea34..216d5c71f 100644 --- a/manifests/integrations/redis.pp +++ b/manifests/integrations/redis.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the redis integration # +# See the sample redisdb.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/redisdb/datadog_checks/redisdb/data/conf.yaml.example +# # Parameters: # $host: # The host redis is running on diff --git a/manifests/integrations/riak.pp b/manifests/integrations/riak.pp index 41f48e9f2..81b631f83 100644 --- a/manifests/integrations/riak.pp +++ b/manifests/integrations/riak.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the riak integration # +# See the sample riak.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/riak/datadog_checks/riak/data/conf.yaml.example +# # Parameters: # $url: # The URL for riak diff --git a/manifests/integrations/snmp.pp b/manifests/integrations/snmp.pp index e91d759e7..d7ccc3b13 100755 --- a/manifests/integrations/snmp.pp +++ b/manifests/integrations/snmp.pp @@ -2,6 +2,9 @@ # # This class will enable snmp check # +# See the sample snmp.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/snmp/datadog_checks/snmp/data/conf.yaml.example +# # Parameters: # $init_config: # Optional hash (see snmp.yaml.example for reference) diff --git a/manifests/integrations/solr.pp b/manifests/integrations/solr.pp index 498872781..6d164e0be 100644 --- a/manifests/integrations/solr.pp +++ b/manifests/integrations/solr.pp @@ -2,6 +2,15 @@ # # This class will install the necessary configuration for the solr integration # +# See the sample solr.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/solr/datadog_checks/solr/data/conf.yaml.example +# +# See the metrics.yaml file for the list of default collected metrics. +# https://github.com/DataDog/integrations-core/blob/master/solr/datadog_checks/solr/data/metrics.yaml +# +# This check has a limit of 350 metrics per instance. If you require +# additional metrics, contact Datadog Support at https://docs.datadoghq.com/help/ +# # Parameters: # $hostname: # The host solr is running on. Defaults to 'localhost' diff --git a/manifests/integrations/ssh.pp b/manifests/integrations/ssh.pp index ca24fa0fb..51cf6a652 100644 --- a/manifests/integrations/ssh.pp +++ b/manifests/integrations/ssh.pp @@ -2,6 +2,9 @@ # # This class will enable ssh check # +# See the sample ssh_check.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/ssh_check/datadog_checks/ssh_check/data/conf.yaml.example +# # Parameters: # $host: # ssh server to use for ssh check diff --git a/manifests/integrations/supervisord.pp b/manifests/integrations/supervisord.pp index 2bfe91c1b..7c7335d5e 100644 --- a/manifests/integrations/supervisord.pp +++ b/manifests/integrations/supervisord.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the supervisord integration # +# See the sample supervisord.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/supervisord/datadog_checks/supervisord/data/conf.yaml.example +# # Parameters: # servername # socket diff --git a/manifests/integrations/system_core.pp b/manifests/integrations/system_core.pp index c77ed8a79..e4bdd9d1b 100644 --- a/manifests/integrations/system_core.pp +++ b/manifests/integrations/system_core.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the system_core integration # +# See the sample system_core.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/system_core/datadog_checks/system_core/data/conf.yaml.example +# # Sample Usage: # include 'datadog_agent::integrations::system_core' # diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index 6a9f798eb..d2dbce815 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -2,6 +2,9 @@ # # This class will install the necessary config to hook the tcp_check in the agent # +# See the sample tcp_check.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/tcp_check/datadog_checks/tcp_check/data/conf.yaml.example +# # Parameters: # check_name # (Required) - Name of the service. diff --git a/manifests/integrations/tomcat.pp b/manifests/integrations/tomcat.pp index 595d4731f..e1d09f64a 100644 --- a/manifests/integrations/tomcat.pp +++ b/manifests/integrations/tomcat.pp @@ -2,6 +2,15 @@ # # This class will install the necessary configuration for the tomcat integration # +# See the sample tomcat.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/tomcat/datadog_checks/tomcat/data/conf.yaml.example +# +# See the metrics.yaml file for the list of default collected metrics. +# https://github.com/DataDog/integrations-core/blob/master/tomcat/datadog_checks/tomcat/data/metrics.yaml +# +# This check has a limit of 350 metrics per instance. If you require +# additional metrics, contact Datadog Support at https://docs.datadoghq.com/help/ +# # Parameters: # $hostname: # The host tomcat is running on. Defaults to 'localhost' diff --git a/manifests/integrations/twemproxy.pp b/manifests/integrations/twemproxy.pp index 01d51ce62..b56edfbaa 100644 --- a/manifests/integrations/twemproxy.pp +++ b/manifests/integrations/twemproxy.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the twemproxy aka nutcracker integration # +# See the sample twemproxy.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/twemproxy/datadog_checks/twemproxy/data/conf.yaml.example +# # Parameters: # $host: # The host twemproxy is running on. Defaults to '127.0.0.1' diff --git a/manifests/integrations/varnish.pp b/manifests/integrations/varnish.pp index 10683e3af..5e8c9a89a 100644 --- a/manifests/integrations/varnish.pp +++ b/manifests/integrations/varnish.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the varnish integration # +# See the sample varnish.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/varnish/datadog_checks/varnish/data/conf.yaml.example +# # Parameters: # varnishstat # Path to the varnishstat binary diff --git a/manifests/integrations/zk.pp b/manifests/integrations/zk.pp index 75ec8fc51..a36375c13 100644 --- a/manifests/integrations/zk.pp +++ b/manifests/integrations/zk.pp @@ -2,6 +2,9 @@ # # This class will install the necessary configuration for the zk integration # +# See the sample zk.d/conf.yaml for all available configuration options +# https://github.com/DataDog/integrations-core/blob/master/zk/datadog_checks/zk/data/conf.yaml.example +# # Parameters: # $host: # The host zk is running on. Defaults to '127.0.0.1' diff --git a/spec/classes/datadog_agent_integrations_jenkins_spec.rb b/spec/classes/datadog_agent_integrations_jenkins_spec.rb deleted file mode 100644 index 53f981b8b..000000000 --- a/spec/classes/datadog_agent_integrations_jenkins_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'spec_helper' - -describe 'datadog_agent::integrations::jenkins' do - ALL_SUPPORTED_AGENTS.each do |agent_major_version| - context 'supported agents' do - let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/jenkins.yaml' - else - "#{CONF_DIR}/jenkins.d/conf.yaml" - end - - it { is_expected.to compile.with_all_deps } - it { - is_expected.to contain_file(conf_file).with( - owner: DD_USER, - group: DD_GROUP, - mode: PERMISSIONS_PROTECTED_FILE, - ) - } - it { is_expected.to contain_file(conf_file).that_requires("Package[#{PACKAGE_NAME}]") } - it { is_expected.to contain_file(conf_file).that_notifies("Service[#{SERVICE_NAME}]") } - - context 'with default parameters' do - it { is_expected.to contain_file(conf_file).with_content(%r{jenkins_home: /var/lib/jenkins}) } - end - - context 'with parameters set' do - let(:params) do - { - path: '/foo/bar/baz', - } - end - - it { is_expected.to contain_file(conf_file).with_content(%r{jenkins_home: /foo/bar/baz}) } - end - end - end -end diff --git a/templates/agent-conf.d/jenkins.yaml.erb b/templates/agent-conf.d/jenkins.yaml.erb deleted file mode 100644 index 2b39d863a..000000000 --- a/templates/agent-conf.d/jenkins.yaml.erb +++ /dev/null @@ -1,7 +0,0 @@ -### MANAGED BY PUPPET - -init_config: - -instances: - - name: default - jenkins_home: <%= @path %> From cec1cb36a637a2f52018d841b277e791ebc3b394 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 12:14:06 +0000 Subject: [PATCH 071/133] fix bug with $ not being escaped. Updated Change log with latest changes --- CHANGELOG.md | 13 ++++++++++--- manifests/windows.pp | 8 ++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5d5d8267..2be72f540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,15 @@ Changes ======= # 4.0.0 / 2025-02-01 -* [FEATURE] Add Support for Puppet 8 ([#823]) -* [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#823]) -* [BUGFIX] Fix issue where MSI path was not correctly parsed ([#823]) +* [FEATURE] Add Support for Puppet 8 ([#779]) +* [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#800]) +* [FEATURE] Class definitions updated with references to DataDog examples * [FEATURE] Update to CI Builds to work with Ruby 3 +* [BUGFIX] Fix issue where MSI path was not correctly parsed ([#814]) +* [DEPRECATE] Drop support for Puppet 6 and below * [DEPRECATE] Remove support for supply a String to the SSL_Verify option on the elasticsearch integration. We now use tls_verify which matches core DataDog code. +* [DEPRECATE] Support for Jenkins integrations is removed +* [DEPRECATE] No longer possible to use the custom metrics parameter when using the PostgresSQL class # 3.23.0 / 2024-12-09 @@ -936,13 +940,16 @@ Please read the [docs]() for more details. [#756]: https://github.com/DataDog/puppet-datadog-agent/issues/756 [#761]: https://github.com/DataDog/puppet-datadog-agent/issues/761 [#770]: https://github.com/DataDog/puppet-datadog-agent/issues/770 +[#779]: https://github.com/DataDog/puppet-datadog-agent/issues/779 [#782]: https://github.com/DataDog/puppet-datadog-agent/issues/782 [#785]: https://github.com/DataDog/puppet-datadog-agent/issues/785 [#789]: https://github.com/DataDog/puppet-datadog-agent/issues/789 [#790]: https://github.com/DataDog/puppet-datadog-agent/issues/790 [#798]: https://github.com/DataDog/puppet-datadog-agent/issues/798 [#799]: https://github.com/DataDog/puppet-datadog-agent/issues/799 +[#800]: https://github.com/DataDog/puppet-datadog-agent/issues/800 [#806]: https://github.com/DataDog/puppet-datadog-agent/issues/806 +[#814]: https://github.com/DataDog/puppet-datadog-agent/issues/814 [#820]: https://github.com/DataDog/puppet-datadog-agent/issues/820 [#821]: https://github.com/DataDog/puppet-datadog-agent/issues/821 [@Aramack]: https://github.com/Aramack diff --git a/manifests/windows.pp b/manifests/windows.pp index fd377b9eb..f899099ac 100644 --- a/manifests/windows.pp +++ b/manifests/windows.pp @@ -33,7 +33,7 @@ if $ensure == 'present' { if ($agent_version in ['6.14.0', '6.14.1']) { - fail('The specified agent version has been blacklisted, please specify a version other than 6.14.0 or 6.14.1') + fail('The specified agent version has been deemed unacceptable for installation, please specify a version other than 6.14.0 or 6.14.1') } file { 'installer': @@ -42,15 +42,15 @@ provider => 'windows', } - $unless_cmd = @("ACCEPTABLE"/L) - \$blacklist = '928b00d2f952219732cda9ae0515351b15f9b9c1ea1d546738f9dc0fda70c336','78b2bb2b231bcc185eb73dd367bfb6cb8a5d45ba93a46a7890fd607dc9188194'; + $unless_cmd = @("ACCEPTABLE"/$L) + \$denylist = '928b00d2f952219732cda9ae0515351b15f9b9c1ea1d546738f9dc0fda70c336','78b2bb2b231bcc185eb73dd367bfb6cb8a5d45ba93a46a7890fd607dc9188194'; \$fileStream = [system.io.file]::openread('${msi_full_path}'); \$hasher = [System.Security.Cryptography.HashAlgorithm]::create('sha256'); \$hash = \$hasher.ComputeHash(\$fileStream); \$fileStream.close(); \$fileStream.dispose(); \$hexhash = [system.bitconverter]::tostring(\$hash).ToLower().replace('-',''); - if (\$blacklist.Contains(\$hexhash)) { Exit 1 } else { Exit 0 } + if (\$denylist.Contains(\$hexhash)) { Exit 1 } else { Exit 0 } | ACCEPTABLE exec { 'assert-acceptable-msi':, From cbcf4e7beb27a1397ec4c1e87d4b04c272e90114 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 12:33:22 +0000 Subject: [PATCH 072/133] remove custom metrics --- ...atadog_agent_integrations_postgres_spec.rb | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_postgres_spec.rb b/spec/classes/datadog_agent_integrations_postgres_spec.rb index c1d065f71..d9c501d73 100644 --- a/spec/classes/datadog_agent_integrations_postgres_spec.rb +++ b/spec/classes/datadog_agent_integrations_postgres_spec.rb @@ -102,58 +102,6 @@ it { is_expected.to contain_file(conf_file).with_content(%r{^[^#]*tags:\s+- foo\s+- bar\s+- baz}) } it { is_expected.to contain_file(conf_file).with_content(%r{^[^#]*relations:\s+- furry\s+- fuzzy\s+- funky}) } - context 'with custom metric query missing %s' do - let(:params) do - { - host: 'postgres1', - dbname: 'cats', - port: 4142, - username: 'monitoring', - password: 'abc123', - custom_metrics: { - 'query_is_missing_%s' => { - 'query' => 'select * from fuzz', - 'metrics' => {}, - }, - }, - } - end - - it do - expect { - is_expected.to compile - }.to raise_error(%r{custom_metrics require %s for metric substitution}) - end - end - - context 'with custom metric query' do - let(:params) do - { - host: 'postgres1', - dbname: 'cats', - port: 4142, - username: 'monitoring', - password: 'abc123', - custom_metrics: { - 'foo_gooo_bar_query' => { - 'query' => 'select foo, %s from bar', - 'metrics' => { - 'gooo' => ['custom_metric.tag.gooo', 'GAUGE'], - }, - 'descriptors' => [['foo', 'custom_metric.tag.foo']], - }, - }, - } - end - - it { is_expected.to compile } - it { is_expected.to contain_file(conf_file).with_content(%r{^[^#]*custom_metrics:}) } - it { is_expected.to contain_file(conf_file).with_content(%r{\s+query:\s*['"]?select foo, %s from bar['"]?}) } - it { is_expected.to contain_file(conf_file).with_content(%r{\s+metrics:}) } - it { is_expected.to contain_file(conf_file).with_content(%r{\s+"gooo":\s+\[custom_metric.tag.gooo, GAUGE\]}) } - it { is_expected.to contain_file(conf_file).with_content(%r{\s+query.*[\r\n]+\s+relation:\s*false}) } - it { is_expected.to contain_file(conf_file).with_content(%r{\s+descriptors.*[\r\n]+\s+-\s+\[foo, custom_metric.tag.foo\]}) } - end end end end From df1dd9d28fee80638d007bc355a357837326919c Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 12:36:42 +0000 Subject: [PATCH 073/133] update to support sitename and url being required --- .../datadog_agent_integrations_http_check_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_http_check_spec.rb b/spec/classes/datadog_agent_integrations_http_check_spec.rb index c0eeeb82c..a92afb359 100644 --- a/spec/classes/datadog_agent_integrations_http_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_http_check_spec.rb @@ -23,8 +23,13 @@ it { is_expected.to contain_file(conf_file).that_notifies("Service[#{SERVICE_NAME}]") } context 'with default parameters' do - it { is_expected.to contain_file(conf_file).without_content(%r{name: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{url: }) } + let(:params) do + { + sitename: 'foo.bar.baz', + url: 'http://foo.bar.baz:4096', + } + end + it { is_expected.to contain_file(conf_file).without_content(%r{username: }) } it { is_expected.to contain_file(conf_file).without_content(%r{password: }) } it { is_expected.to contain_file(conf_file).without_content(%r{timeout: 1}) } From 74778a25a1e563fb0002bdc2060871801add6808 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 12:39:42 +0000 Subject: [PATCH 074/133] removed test for passing simple string with tags. It must be an array as per definition. --- .../datadog_agent_integrations_docker_daemon_spec.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb b/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb index 17fd36037..2eb923e2a 100644 --- a/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb +++ b/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb @@ -73,15 +73,6 @@ it { is_expected.to contain_file(conf_file).with_content(%r{tags: \[\]}) } end - context 'single value empty string' do - let(:params) do - { - tags: '', - } - end - - it { is_expected.to contain_file(conf_file).with_content(%r{tags: \[\]}) } - end end end end From 90ec8a019ae5f835895035dc26ad7e292cb81d50 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 13:08:06 +0000 Subject: [PATCH 075/133] fix issues for robocop --- spec/classes/datadog_agent_integrations_docker_daemon_spec.rb | 1 - spec/classes/datadog_agent_integrations_postgres_spec.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb b/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb index 2eb923e2a..db741f274 100644 --- a/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb +++ b/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb @@ -72,7 +72,6 @@ it { is_expected.to contain_file(conf_file).with_content(%r{tags: \[\]}) } end - end end end diff --git a/spec/classes/datadog_agent_integrations_postgres_spec.rb b/spec/classes/datadog_agent_integrations_postgres_spec.rb index d9c501d73..877bc0286 100644 --- a/spec/classes/datadog_agent_integrations_postgres_spec.rb +++ b/spec/classes/datadog_agent_integrations_postgres_spec.rb @@ -101,7 +101,6 @@ it { is_expected.to contain_file(conf_file).with_content(%r{username: monitoring}) } it { is_expected.to contain_file(conf_file).with_content(%r{^[^#]*tags:\s+- foo\s+- bar\s+- baz}) } it { is_expected.to contain_file(conf_file).with_content(%r{^[^#]*relations:\s+- furry\s+- fuzzy\s+- funky}) } - end end end From 71fa1a0c47e51adabcd67f51f9e1c9a31c648841 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 13:44:42 +0000 Subject: [PATCH 076/133] add missing params section to http_check test --- spec/classes/datadog_agent_integrations_http_check_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/classes/datadog_agent_integrations_http_check_spec.rb b/spec/classes/datadog_agent_integrations_http_check_spec.rb index a92afb359..65d89fddd 100644 --- a/spec/classes/datadog_agent_integrations_http_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_http_check_spec.rb @@ -4,6 +4,12 @@ ALL_SUPPORTED_AGENTS.each do |agent_major_version| context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } + let(:params) do + { + sitename: 'foo.bar.baz', + url: 'http://foo.bar.baz:4096', + } + end conf_file = if agent_major_version == 5 '/etc/dd-agent/conf.d/http_check.yaml' From d77373d56d785a021f7882126ec229eb8352a48b Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 13:48:21 +0000 Subject: [PATCH 077/133] add note about default value. --- manifests/integrations/http_check.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index cdc34c425..15fec031c 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -101,7 +101,8 @@ # left in the certificate, and alternatively raise a critical # warning if the certificate is y days from the expiration date. # The SSL certificate will always be validated for this additional -# service check regardless of the value of disable_ssl_validation +# service check regardless of the value of disable_ssl_validation. +# check_certification_expiration defaults to true. # # headers # The (optional) headers parameter allows you to send extra headers with From 5e2ee264667afd2a1fafbfbab2c360c664b76224 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 13:53:20 +0000 Subject: [PATCH 078/133] updating defaults inline with class defaults. --- spec/classes/datadog_agent_integrations_http_check_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_http_check_spec.rb b/spec/classes/datadog_agent_integrations_http_check_spec.rb index 65d89fddd..3f162de19 100644 --- a/spec/classes/datadog_agent_integrations_http_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_http_check_spec.rb @@ -48,9 +48,9 @@ it { is_expected.to contain_file(conf_file).without_content(%r{collect_response_time: true}) } it { is_expected.to contain_file(conf_file).without_content(%r{http_response_status_code: }) } it { is_expected.to contain_file(conf_file).without_content(%r{disable_ssl_validation: false}) } - it { is_expected.to contain_file(conf_file).without_content(%r{skip_event: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{no_proxy: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{check_certificate_expiration: }) } + it { is_expected.to contain_file(conf_file).without_content(%r{skip_event: true }) } + it { is_expected.to contain_file(conf_file).without_content(%r{no_proxy: false }) } + it { is_expected.to contain_file(conf_file).without_content(%r{check_certificate_expiration: true }) } it { is_expected.to contain_file(conf_file).without_content(%r{days_warning: }) } it { is_expected.to contain_file(conf_file).without_content(%r{days_critical: }) } it { is_expected.to contain_file(conf_file).without_content(%r{headers: }) } From 24447cececeab9c97eff1efcef3e503437fe8fdd Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 14:02:10 +0000 Subject: [PATCH 079/133] fix tests to match default values --- .../datadog_agent_integrations_http_check_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_http_check_spec.rb b/spec/classes/datadog_agent_integrations_http_check_spec.rb index 3f162de19..2f3ebf1bd 100644 --- a/spec/classes/datadog_agent_integrations_http_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_http_check_spec.rb @@ -38,19 +38,19 @@ it { is_expected.to contain_file(conf_file).without_content(%r{username: }) } it { is_expected.to contain_file(conf_file).without_content(%r{password: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{timeout: 1}) } + it { is_expected.to contain_file(conf_file).with_content(%r{timeout: 1}) } # default value is 1 it { is_expected.to contain_file(conf_file).without_content(%r{data: }) } it { is_expected.to contain_file(conf_file).without_content(%(threshold: )) } it { is_expected.to contain_file(conf_file).without_content(%r{window: }) } it { is_expected.to contain_file(conf_file).without_content(%r{content_match: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{reverse_content_match: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{reverse_content_match: false}) } # default value is false it { is_expected.to contain_file(conf_file).without_content(%r{include_content: true}) } - it { is_expected.to contain_file(conf_file).without_content(%r{collect_response_time: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{collect_response_time: true}) } # default value is true it { is_expected.to contain_file(conf_file).without_content(%r{http_response_status_code: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{disable_ssl_validation: false}) } - it { is_expected.to contain_file(conf_file).without_content(%r{skip_event: true }) } - it { is_expected.to contain_file(conf_file).without_content(%r{no_proxy: false }) } - it { is_expected.to contain_file(conf_file).without_content(%r{check_certificate_expiration: true }) } + it { is_expected.to contain_file(conf_file).with_content(%r{disable_ssl_validation: false}) } # default value is false + it { is_expected.to contain_file(conf_file).with_content(%r{skip_event: true}) } # default value is true + it { is_expected.to contain_file(conf_file).with_content(%r{no_proxy: false}) } # default value is false + it { is_expected.to contain_file(conf_file).with_content(%r{check_certificate_expiration: true}) } # default value is true it { is_expected.to contain_file(conf_file).without_content(%r{days_warning: }) } it { is_expected.to contain_file(conf_file).without_content(%r{days_critical: }) } it { is_expected.to contain_file(conf_file).without_content(%r{headers: }) } From 9c5ec5205d6a1b6d4c2d3499829aa5051d829628 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 14:17:13 +0000 Subject: [PATCH 080/133] fix tcp checks given required params --- ...tadog_agent_integrations_tcp_check_spec.rb | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb index b91f8fb1a..a605e5b1b 100644 --- a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb @@ -4,6 +4,13 @@ ALL_SUPPORTED_AGENTS.each do |agent_major_version| context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } + let(:params) do + { + check_name: 'foo.bar.baz', + host: 'foo.bar.baz', + port: '80' + } + end conf_file = if agent_major_version == 5 '/etc/dd-agent/conf.d/tcp_check.yaml' @@ -23,9 +30,17 @@ it { is_expected.to contain_file(conf_file).that_notifies("Service[#{SERVICE_NAME}]") } context 'with default parameters' do - it { is_expected.to contain_file(conf_file).without_content(%r{name: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{host: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{port: }) } + let(:params) do + { + check_name: 'foo.bar.baz', + host: 'foo.bar.baz', + port: '80' + } + end + + it { is_expected.to contain_file(conf_file).with_content(%r{name: }) } + it { is_expected.to contain_file(conf_file).with_content(%r{host: }) } + it { is_expected.to contain_file(conf_file).with_content(%r{port: }) } it { is_expected.to contain_file(conf_file).without_content(%r{timeout: 1}) } it { is_expected.to contain_file(conf_file).without_content(%(threshold: )) } it { is_expected.to contain_file(conf_file).without_content(%r{window: }) } From 721fc4bd1876e213c1aedd35b45cad786b3567ff Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 14:19:37 +0000 Subject: [PATCH 081/133] correct test to provide correct datatype. corrected array to match datatype requirements --- manifests/integrations/snmp.pp | 10 ++-- .../datadog_agent_integrations_snmp_spec.rb | 58 ++++++++++--------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/manifests/integrations/snmp.pp b/manifests/integrations/snmp.pp index d7ccc3b13..d60c10dba 100755 --- a/manifests/integrations/snmp.pp +++ b/manifests/integrations/snmp.pp @@ -55,11 +55,11 @@ class datadog_agent::integrations::snmp ( Optional[Any] $mibs_folder = undef, Boolean $ignore_nonincreasing_oid = false, - Hash $init_config = {}, - Array $instances = [], - Array $snmp_v1_instances = [], - Array $snmp_v2_instances = [], - Array $snmp_v3_instances = [], + Hash $init_config = {}, + Array[Hash] $instances = [], + Array $snmp_v1_instances = [], + Array $snmp_v2_instances = [], + Array $snmp_v3_instances = [], ) inherits datadog_agent::params { require datadog_agent diff --git a/spec/classes/datadog_agent_integrations_snmp_spec.rb b/spec/classes/datadog_agent_integrations_snmp_spec.rb index d3c4da03e..07c9681e6 100644 --- a/spec/classes/datadog_agent_integrations_snmp_spec.rb +++ b/spec/classes/datadog_agent_integrations_snmp_spec.rb @@ -30,34 +30,36 @@ let(:params) do { ignore_nonincreasing_oid: true, - instances: { - ip_address: 'localhost', - port: 161, - community_string: 'public', - tags: [ - 'optional_tag_1', - ], - metrics: [ - { - MIB: 'IF-MIB', - table: 'ifTable', - symbols: [ - 'ifInOctets', - 'ifOutOctets', - ], - metric_tags: [ - { - tag: 'interface', - column: 'ifDescr', - }, - { - tag: 'interface_index', - column: 'ifIndex', - }, - ], - }, - ], - }, + instances: [ + { + ip_address: 'localhost', + port: 161, + community_string: 'public', + tags: [ + 'optional_tag_1', + ], + metrics: [ + { + MIB: 'IF-MIB', + table: 'ifTable', + symbols: [ + 'ifInOctets', + 'ifOutOctets', + ], + metric_tags: [ + { + tag: 'interface', + column: 'ifDescr', + }, + { + tag: 'interface_index', + column: 'ifIndex', + }, + ], + }, + ], + }, + ] } end From 366f2bab8e7c64c595b5981386a7c0e3e5b21ec4 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 14:22:52 +0000 Subject: [PATCH 082/133] fixing incorrect change to test --- spec/classes/datadog_agent_integrations_http_check_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/datadog_agent_integrations_http_check_spec.rb b/spec/classes/datadog_agent_integrations_http_check_spec.rb index 2f3ebf1bd..4dfec85dc 100644 --- a/spec/classes/datadog_agent_integrations_http_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_http_check_spec.rb @@ -43,7 +43,7 @@ it { is_expected.to contain_file(conf_file).without_content(%(threshold: )) } it { is_expected.to contain_file(conf_file).without_content(%r{window: }) } it { is_expected.to contain_file(conf_file).without_content(%r{content_match: }) } - it { is_expected.to contain_file(conf_file).with_content(%r{reverse_content_match: false}) } # default value is false + it { is_expected.to contain_file(conf_file).without_content(%r{reverse_content_match: false}) } it { is_expected.to contain_file(conf_file).without_content(%r{include_content: true}) } it { is_expected.to contain_file(conf_file).with_content(%r{collect_response_time: true}) } # default value is true it { is_expected.to contain_file(conf_file).without_content(%r{http_response_status_code: }) } From 9b76dd66fbe13fd098c55ec9d22f58372ed7e5e2 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 14:48:03 +0000 Subject: [PATCH 083/133] updating test to match default --- spec/classes/datadog_agent_integrations_tcp_check_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb index a605e5b1b..25dc7336d 100644 --- a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb @@ -41,7 +41,7 @@ it { is_expected.to contain_file(conf_file).with_content(%r{name: }) } it { is_expected.to contain_file(conf_file).with_content(%r{host: }) } it { is_expected.to contain_file(conf_file).with_content(%r{port: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{timeout: 1}) } + it { is_expected.to contain_file(conf_file).with_content(%r{timeout: 10}) } # default value is 10 it { is_expected.to contain_file(conf_file).without_content(%(threshold: )) } it { is_expected.to contain_file(conf_file).without_content(%r{window: }) } it { is_expected.to contain_file(conf_file).without_content(%r{collect_response_time: }) } From 7069f811b65295e7397f73ed346e6b1643aa25b9 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 14:48:48 +0000 Subject: [PATCH 084/133] removing test, as check does not work however following test does check tags exists with correct value. --- spec/classes/datadog_agent_integrations_snmp_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/classes/datadog_agent_integrations_snmp_spec.rb b/spec/classes/datadog_agent_integrations_snmp_spec.rb index 07c9681e6..fe8e908c6 100644 --- a/spec/classes/datadog_agent_integrations_snmp_spec.rb +++ b/spec/classes/datadog_agent_integrations_snmp_spec.rb @@ -71,7 +71,6 @@ expect(yaml).to include('init_config') expect(yaml['init_config']).to include('ignore_nonincreasing_oid') expect(yaml).to include('instances') - expect(yaml['instances']).to include('tags') expect(yaml['instances']['tags']).to include('optional_tag_1') end end From 34c8d8f2088f55b86f3efed9fdd547f8862807ae Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 14:52:54 +0000 Subject: [PATCH 085/133] fix regex check --- spec/classes/datadog_agent_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/classes/datadog_agent_spec.rb b/spec/classes/datadog_agent_spec.rb index d765197e8..f8764ec16 100644 --- a/spec/classes/datadog_agent_spec.rb +++ b/spec/classes/datadog_agent_spec.rb @@ -1781,8 +1781,8 @@ it 'adds an install_info' do expect(install_info['install_method']).to match( 'tool' => 'puppet', - 'tool_version' => %r{^puppet-unknown$}, # puppetversion is not set in tests, this field has to be tested manually - 'installer_version' => %r{^datadog_module-\d+\.\d+\.\d+$}, + 'tool_version' => %r{^puppet-\d+\.\d+\.\d}, # puppetversion is not set in tests, this field has to be tested manually + 'installer_version' => %r{^datadog_module-\d+\.\d+\.\d}, ) end end From b70b8a4da382846961ecc14415a5f0d204f65791 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Feb 2025 15:05:30 +0000 Subject: [PATCH 086/133] attempting to correctly reference the hash within the array of instances --- spec/classes/datadog_agent_integrations_snmp_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/classes/datadog_agent_integrations_snmp_spec.rb b/spec/classes/datadog_agent_integrations_snmp_spec.rb index fe8e908c6..f92eb48c1 100644 --- a/spec/classes/datadog_agent_integrations_snmp_spec.rb +++ b/spec/classes/datadog_agent_integrations_snmp_spec.rb @@ -71,7 +71,8 @@ expect(yaml).to include('init_config') expect(yaml['init_config']).to include('ignore_nonincreasing_oid') expect(yaml).to include('instances') - expect(yaml['instances']['tags']).to include('optional_tag_1') + expect(yaml['instances'][0]).to include('tags') + expect(yaml['instances'][0]['tags']).to include('optional_tag_1') end end end From 45a6df2fb2fad3d54850efc97523f8e73f71f05f Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 7 Feb 2025 11:56:42 -0500 Subject: [PATCH 087/133] remove puppet 6 unit test specs --- .circleci/config.yml | 56 ++++---------------------------------------- 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0931e53b7..befdf1768 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,13 +2,13 @@ version: 2.1 orbs: win: circleci/windows@2.2.0 jobs: - specs-ruby27-puppet628: &ubuntu2004-specs + specs-ruby26-puppet734: &ubuntu2004-specs machine: image: ubuntu-2004:2024.08.1 environment: STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.7.5' - PUPPET_VERSION: '6.28.0' + RUBY_VERSION: '2.6.3' + PUPPET_VERSION: '7.34.0' steps: - checkout - run: @@ -37,48 +37,6 @@ jobs: name: Run tests command: rvm $RUBY_VERSION --verbose do bundle exec rake test - specs-ruby31-puppet628: - <<: *ubuntu2004-specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '3.1.6' - PUPPET_VERSION: '6.28.0' - - specs-ruby32-puppet628: - <<: *ubuntu2004-specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '3.2.7' - PUPPET_VERSION: '6.28.0' - - specs-ruby33-puppet628: - <<: *ubuntu2004-specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '3.3.7' - PUPPET_VERSION: '6.28.0' - - specs-ruby34-puppet628: - <<: *ubuntu2004-specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '3.4.1' - PUPPET_VERSION: '6.28.0' - - specs-ruby26-puppet628: - <<: *ubuntu2004-specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' - PUPPET_VERSION: '6.28.0' - - specs-ruby26-puppet734: - <<: *ubuntu2004-specs - environment: - STRICT_VARIABLES: 'yes' - RUBY_VERSION: '2.6.3' - PUPPET_VERSION: '7.34.0' - specs-ruby27-puppet734: <<: *ubuntu2004-specs environment: @@ -266,19 +224,13 @@ jobs: workflows: build_and_test: jobs: - - specs-ruby26-puppet628 - - specs-ruby27-puppet628 - - specs-ruby31-puppet628 - - specs-ruby32-puppet628 - - specs-ruby33-puppet628 - # - specs-ruby34-puppet628 # ruby v3.4 specs fail with `Puppet::Error: Cannot determine basic system flavour (Puppet::Error)` - specs-ruby26-puppet734 # - specs-ruby27-puppet79-windows # puppet_litmus requires a dependency "patron", which doesn't run on windows - specs-ruby27-puppet734 - specs-ruby31-puppet734 - specs-ruby32-puppet734 - specs-ruby33-puppet734 - # - specs-ruby34-puppet734 + # - specs-ruby34-puppet734 # ruby v3.4 specs fail with `Puppet::Error: Cannot determine basic system flavour (Puppet::Error)` - specs-ruby31-puppet810 - specs-ruby32-puppet810 - specs-ruby33-puppet810 From eb26444064ec4359540ae05d2569e4523e065a95 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 7 Feb 2025 12:00:25 -0500 Subject: [PATCH 088/133] bump windows orb --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index befdf1768..db011ec38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2.1 orbs: - win: circleci/windows@2.2.0 + win: circleci/windows@5.0.0 jobs: specs-ruby26-puppet734: &ubuntu2004-specs machine: From e6c8ef8d9eee8b0ea5fc3fef99bc65c4fb653640 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Sat, 8 Feb 2025 13:37:43 +0000 Subject: [PATCH 089/133] The ganglia feature has been removed and not supported in Agent 6+ --- CHANGELOG.md | 1 + manifests/init.pp | 8 ---- spec/classes/datadog_agent_spec.rb | 62 ------------------------------ templates/datadog_footer.conf.erb | 19 --------- 4 files changed, 1 insertion(+), 89 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2be72f540..442384cba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Changes * [DEPRECATE] Remove support for supply a String to the SSL_Verify option on the elasticsearch integration. We now use tls_verify which matches core DataDog code. * [DEPRECATE] Support for Jenkins integrations is removed * [DEPRECATE] No longer possible to use the custom metrics parameter when using the PostgresSQL class +* [DEPRECATE] `ganglia` configuration no longer supported as per DataDog Agent v6+ # 3.23.0 / 2024-12-09 diff --git a/manifests/init.pp b/manifests/init.pp index 6a86cd8bd..b124f2f8a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -147,12 +147,6 @@ # $device_blacklist_re # Specifies pattern for device blacklisting. # String. Default: empty -# $ganglia_host -# Specifies host where gmetad is running -# String. Default: empty -# $ganglia_port -# Specifies port for $ganglia_host -# String. Default: empty # $dogstreams # Specifies port for list of logstreams/modules to be used. # String. Default: empty @@ -318,8 +312,6 @@ Optional[String] $proxy_password = undef, Variant[Stdlib::Port, Pattern[/^\d*$/]] $graphite_listen_port = '', String $extra_template = '', - String $ganglia_host = '', - Integer $ganglia_port = 8651, Boolean $skip_ssl_validation = false, Boolean $skip_apt_key_trusting = false, Boolean $use_curl_http_client = false, diff --git a/spec/classes/datadog_agent_spec.rb b/spec/classes/datadog_agent_spec.rb index f8764ec16..bbc470148 100644 --- a/spec/classes/datadog_agent_spec.rb +++ b/spec/classes/datadog_agent_spec.rb @@ -536,19 +536,6 @@ } end - context 'for ganglia' do - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# ganglia_host: localhost\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# ganglia_port: 8651\n}, - ) - } - end - context 'for logging' do it { is_expected.to contain_concat__fragment('datadog footer').with( @@ -1228,55 +1215,6 @@ ) } end - context 'with ganglia_host set to localhost and ganglia_port set to 12345' do - let(:params) do - { - ganglia_host: 'testhost', - ganglia_port: '12345', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^ganglia_port: 12345\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^ganglia_host: testhost\n}, - ) - } - end - context 'with ganglia_host set to localhost and ganglia_port set to 12345, port specified as an integer' do - let(:params) do - { - ganglia_host: 'testhost', - ganglia_port: 12_345, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^ganglia_port: 12345\n}, - ) - } - end - context 'with dogstreams set to /path/to/log1:/path/to/parser' do - let(:params) do - { - dogstreams: ['/path/to/log1:/path/to/parser'], - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{dogstreams: /path/to/log1:/path/to/parser\n}, - ) - } - end context 'with custom_emitters set to /test/emitter' do let(:params) do { diff --git a/templates/datadog_footer.conf.erb b/templates/datadog_footer.conf.erb index 32820d32d..c926f039c 100644 --- a/templates/datadog_footer.conf.erb +++ b/templates/datadog_footer.conf.erb @@ -162,25 +162,6 @@ statsd_forward_port: <%= @statsd_forward_port %> device_blacklist_re: <%= @device_blacklist_re %> <% end -%> -# -------------------------------------------------------------------------- # -# Ganglia # -# -------------------------------------------------------------------------- # - -<% if @ganglia_host.empty? -%> -# Ganglia host where gmetad is running -# ganglia_host: localhost -# -# Ganglia port where gmetad is running -# ganglia_port: 8651 -<% else -%> -# Ganglia host where gmetad is running -ganglia_host: <%= @ganglia_host %> - -# Ganglia port where gmetad is running -ganglia_port: <%= @ganglia_port %> -<% end -%> - - # -------------------------------------------------------------------------- # # Dogstream (log file parser) # -------------------------------------------------------------------------- # From f242db0946612e8aa4e1c5f8a95ee4d4352703c6 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Sat, 8 Feb 2025 13:41:31 +0000 Subject: [PATCH 090/133] tcp check's skip_event setting is no longer supported, so we have removed it from the module --- CHANGELOG.md | 1 + spec/classes/datadog_agent_integrations_tcp_check_spec.rb | 3 --- templates/agent-conf.d/tcp_check.yaml.erb | 3 --- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 442384cba..646d3e124 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Changes * [DEPRECATE] Support for Jenkins integrations is removed * [DEPRECATE] No longer possible to use the custom metrics parameter when using the PostgresSQL class * [DEPRECATE] `ganglia` configuration no longer supported as per DataDog Agent v6+ +* [DEPRECATE] `skip_event` setting on TCP Check class has been removed from DataDog integration # 3.23.0 / 2024-12-09 diff --git a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb index 25dc7336d..e287dc8e5 100644 --- a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb @@ -45,7 +45,6 @@ it { is_expected.to contain_file(conf_file).without_content(%(threshold: )) } it { is_expected.to contain_file(conf_file).without_content(%r{window: }) } it { is_expected.to contain_file(conf_file).without_content(%r{collect_response_time: }) } - it { is_expected.to contain_file(conf_file).without_content(%r{skip_event: }) } it { is_expected.to contain_file(conf_file).without_content(%r{tags: }) } end @@ -59,7 +58,6 @@ threshold: 456, window: 789, collect_response_time: true, - skip_event: true, } end @@ -70,7 +68,6 @@ it { is_expected.to contain_file(conf_file).with_content(%r{threshold: 456}) } it { is_expected.to contain_file(conf_file).with_content(%r{window: 789}) } it { is_expected.to contain_file(conf_file).with_content(%r{collect_response_time: true}) } - it { is_expected.to contain_file(conf_file).with_content(%r{skip_event: true}) } end context 'with tags parameter array' do diff --git a/templates/agent-conf.d/tcp_check.yaml.erb b/templates/agent-conf.d/tcp_check.yaml.erb index 0ba232c9c..579afb884 100644 --- a/templates/agent-conf.d/tcp_check.yaml.erb +++ b/templates/agent-conf.d/tcp_check.yaml.erb @@ -19,9 +19,6 @@ instances: <% if instance['collect_response_time'] -%> collect_response_time: <%= instance['collect_response_time'] %> <% end -%> -<% if instance['skip_event'] -%> - skip_event: <%= instance['skip_event'] %> -<% end -%> <% if instance['tags'] and ! instance['tags'].empty? -%> tags: <%- Array(instance['tags']).each do |tag| -%> From 414335070941c3ba446d60cdab7241c193616c69 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Sat, 8 Feb 2025 13:44:56 +0000 Subject: [PATCH 091/133] tcp check's collect response time is a boolean not a integer --- manifests/integrations/tcp_check.pp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index d2dbce815..2782a79d2 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -33,11 +33,6 @@ # 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 -# create any event to avoid duplicates with a server side service check. -# This default to False. -# # tags # The (optional) tags to add to the check instance. # @@ -67,8 +62,7 @@ # timeout => '8', # threshold => 1, # window => 1, -# collect_response_time => 1, -# skip_event => 1, +# collect_response_time => true, # tags => ['production', 'webserver response time'], # } # @@ -90,13 +84,12 @@ String $check_name, String $host, String $port, - Integer $timeout = 10, - Optional[Integer] $threshold = undef, - Optional[Integer] $window = undef, - Optional[Integer] $collect_response_time = undef, - Optional[Integer] $skip_event = undef, - Array $tags = [], - Optional[Array] $instances = undef, + Integer $timeout = 10, + Optional[Integer] $threshold = undef, + Optional[Integer] $window = undef, + Boolean $collect_response_time = false, + Array $tags = [], + Optional[Array] $instances = undef, ) inherits datadog_agent::params { require datadog_agent @@ -109,7 +102,6 @@ 'threshold' => $threshold, 'window' => $window, 'collect_response_time' => $collect_response_time, - 'skip_event' => $skip_event, 'tags' => $tags, }] } elsif !$instances { From 62f9ba625072eb7d01aa14b2bba753ffb12160c0 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Sat, 8 Feb 2025 14:12:27 +0000 Subject: [PATCH 092/133] puppet_litmus v1 does not support ruby 3 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9374e3389..9e4391913 100644 --- a/Gemfile +++ b/Gemfile @@ -72,7 +72,7 @@ group :development, :release_prep do end end group :system_tests do - if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.1') + if ruby_version >= Gem::Version.new('2.5') && ruby_version < Gem::Version.new('3.0') gem "puppet_litmus", '= 0.0.1', require: false, platforms: [:ruby, :x64_mingw] else gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] From 2ad62f8398fdb7e3d9950b7d19266a1bb5021039 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 10 Feb 2025 08:25:35 +0000 Subject: [PATCH 093/133] adding in default fact to fix unit test --- spec/default_facts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/default_facts.yml b/spec/default_facts.yml index 3346c394d..b0da1c885 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -7,3 +7,5 @@ networking: ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" mac: "AA:AA:AA:AA:AA:AA" is_pe: false + +os.distro.codename: "jammy" \ No newline at end of file From 5c45a6b0a674fbfec079adfd82e1275a3d6fd51b Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 10 Feb 2025 08:36:55 +0000 Subject: [PATCH 094/133] correct fact syntax --- spec/default_facts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/default_facts.yml b/spec/default_facts.yml index b0da1c885..34803b211 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -8,4 +8,4 @@ networking: mac: "AA:AA:AA:AA:AA:AA" is_pe: false -os.distro.codename: "jammy" \ No newline at end of file +os::distro::codename: "jammy" \ No newline at end of file From 8fafd0738fc73c962ee10915f850b9a90b337765 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 10 Feb 2025 08:38:49 +0000 Subject: [PATCH 095/133] move to non deprecated function for ensure_packages --- manifests/ubuntu.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/ubuntu.pp b/manifests/ubuntu.pp index 6b776ccbb..bb590767f 100644 --- a/manifests/ubuntu.pp +++ b/manifests/ubuntu.pp @@ -33,7 +33,7 @@ } if !$skip_apt_key_trusting { - ensure_packages(['gnupg']) + stdlib::ensure_packages(['gnupg']) file { $apt_usr_share_keyring: ensure => file, From 2d49186e45d0bb1c0ae6d39392fccd35556f8174 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 10 Feb 2025 08:43:10 +0000 Subject: [PATCH 096/133] removed deprecated function validate_legacy. Improved error message --- manifests/integrations/disk.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/integrations/disk.pp b/manifests/integrations/disk.pp index 9da94a97a..fbd58372c 100644 --- a/manifests/integrations/disk.pp +++ b/manifests/integrations/disk.pp @@ -85,10 +85,14 @@ ) inherits datadog_agent::params { require datadog_agent - validate_legacy('Optional[String]', 'validate_re', $all_partitions, '^(no|yes)$') + # check that $all_partitions is either no or yes + if $all_partitions !~ '^(no|yes)$' { + fail('all_partitions must be either no or yes') + } + # check that $use_mount is either no or yes if $use_mount !~ '^(no|yes)$' { - fail('error during compilation') + fail('use_mount must be either no or yes') } $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/disk.yaml" From 493c7729d42707f987f9a3a2918918181082c019 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 10 Feb 2025 09:03:29 +0000 Subject: [PATCH 097/133] using a different syntax for fact to match rest of file --- spec/default_facts.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/default_facts.yml b/spec/default_facts.yml index 34803b211..ac3ae8cb3 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -8,4 +8,6 @@ networking: mac: "AA:AA:AA:AA:AA:AA" is_pe: false -os::distro::codename: "jammy" \ No newline at end of file +os: + distro: + codename: "jammy" \ No newline at end of file From 9220a94bbe76edb630f35f28877054ac05bbffaa Mon Sep 17 00:00:00 2001 From: Niels Tholenaar Date: Thu, 13 Feb 2025 15:38:00 +0100 Subject: [PATCH 098/133] fix(http-check): Allow multiple instances to be passed --- manifests/integrations/http_check.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index 15fec031c..539eba8e3 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -7,10 +7,10 @@ # # Parameters: # sitename -# (Required) The name of the instance. +# The name of the instance. # # url -# (Required) The url to check. +# The url to check. # # timeout # The (optional) timeout in seconds. @@ -170,8 +170,8 @@ # }] # } class datadog_agent::integrations::http_check ( - String $sitename, - String $url, + Optional[String] $sitename = undef, + Optional[String] $url = undef, Optional[String] $username = undef, Optional[Any] $password = undef, Integer $timeout = 1, From 6450f948426dcc177b3d83a497d3cee6ba438098 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 14 Feb 2025 09:29:27 -0500 Subject: [PATCH 099/133] fix tests --- .rubocop | 1 + .rubocop.yml | 2 +- Gemfile | 4 +- Gemfile.lock | 10 ++-- lib/puppet/reports/datadog_reports.rb | 2 +- manifests/integrations/disk.pp | 16 +----- .../datadog_agent_integrations_disk_spec.rb | 57 ++++++++++--------- spec/classes/datadog_agent_reports_spec.rb | 15 +++++ spec/classes/datadog_agent_spec.rb | 12 ++++ spec/classes/datadog_agent_ubuntu_spec.rb | 18 ++++++ spec/default_facts.yml | 4 -- templates/agent-conf.d/disk.yaml.erb | 8 ++- 12 files changed, 95 insertions(+), 54 deletions(-) diff --git a/.rubocop b/.rubocop index fc40e8e2e..92530682b 100644 --- a/.rubocop +++ b/.rubocop @@ -1 +1,2 @@ --ignore-unrecognized-cops +--autocorrect \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index d464e5c3d..bb7b4a331 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.6' + TargetRubyVersion: '3.3' Include: - "**/*.rb" Exclude: diff --git a/Gemfile b/Gemfile index 9e4391913..5cd72cd04 100644 --- a/Gemfile +++ b/Gemfile @@ -47,11 +47,11 @@ group :development do gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false gem "dependency_checker", '= 0.3.0', require: false else - gem "facterdb", '~> 2.1', require: false + gem "facterdb", '~> 3.4.0', require: false gem "test-kitchen", '~> 3.7.0' gem "rubocop", '~> 1.50.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false - gem "rspec-puppet-facts", '~> 4.0', require: false + gem "rspec-puppet-facts", '~> 5.2.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "librarian-puppet", '~> 5.0' gem "io-console", '= 0.7.2', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 9f6f1a43f..2f2b16950 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,7 +74,7 @@ GEM facter (4.10.0) hocon (~> 1.3) thor (>= 1.0.1, < 1.3) - facterdb (2.1.0) + facterdb (3.4.0) facter (< 5.0.0) jgrep (~> 1.5, >= 1.5.4) faraday (2.12.2) @@ -366,10 +366,10 @@ GEM rspec-support (~> 3.13.0) rspec-puppet (5.0.0) rspec (~> 3.0) - rspec-puppet-facts (4.0.0) + rspec-puppet-facts (5.2.0) deep_merge (~> 1.2) facter (< 5) - facterdb (~> 2.1) + facterdb (~> 3.1) puppet (>= 7, < 9) rspec-support (3.13.2) rsync (1.0.9) @@ -526,7 +526,7 @@ DEPENDENCIES bcrypt_pbkdf (= 1.0.1) deep_merge (~> 1.2.2) dependency_checker (~> 1.0.0) - facterdb (~> 2.1) + facterdb (~> 3.4.0) io-console (= 0.7.2) json (= 2.6.3) kitchen-docker (~> 3.0.0) @@ -545,7 +545,7 @@ DEPENDENCIES puppetlabs_spec_helper (~> 8.0) rb-readline (= 0.5.5) rexml (~> 3.4.0) - rspec-puppet-facts (~> 4.0) + rspec-puppet-facts (~> 5.2.0) rubocop (~> 1.50.0) rubocop-performance (= 1.16.0) rubocop-rspec (= 2.19.0) diff --git a/lib/puppet/reports/datadog_reports.rb b/lib/puppet/reports/datadog_reports.rb index b33de9597..df29af71a 100644 --- a/lib/puppet/reports/datadog_reports.rb +++ b/lib/puppet/reports/datadog_reports.rb @@ -147,7 +147,7 @@ def process msg_title: event_title, event_type: 'config_management.run', event_object: @msg_host, - alert_type: alert_type, + alert_type:, priority: event_priority, source_type_name: 'puppet', tags: dog_tags), diff --git a/manifests/integrations/disk.pp b/manifests/integrations/disk.pp index fbd58372c..715a7f960 100644 --- a/manifests/integrations/disk.pp +++ b/manifests/integrations/disk.pp @@ -63,9 +63,9 @@ # excluded_disk_re => '/dev/sd[e-z]*' # } class datadog_agent::integrations::disk ( - String $use_mount = 'no', - Optional[String] $all_partitions = undef, - Optional[String] $tag_by_filesystem = undef, + Optional[Boolean] $use_mount = undef, + Optional[Boolean] $all_partitions = undef, + Optional[Boolean] $tag_by_filesystem = undef, Optional[Array[String]] $filesystem_exclude = undef, Optional[Array[String]] $device_exclude = undef, Optional[Array[String]] $mountpoint_exclude = undef, @@ -85,16 +85,6 @@ ) inherits datadog_agent::params { require datadog_agent - # check that $all_partitions is either no or yes - if $all_partitions !~ '^(no|yes)$' { - fail('all_partitions must be either no or yes') - } - - # check that $use_mount is either no or yes - if $use_mount !~ '^(no|yes)$' { - fail('use_mount must be either no or yes') - } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/disk.yaml" if $datadog_agent::_agent_major_version > 5 { $dst_dir = "${datadog_agent::params::conf_dir}/disk.d" diff --git a/spec/classes/datadog_agent_integrations_disk_spec.rb b/spec/classes/datadog_agent_integrations_disk_spec.rb index 77ee56317..0364b6f28 100644 --- a/spec/classes/datadog_agent_integrations_disk_spec.rb +++ b/spec/classes/datadog_agent_integrations_disk_spec.rb @@ -5,17 +5,22 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/disk.yaml' - else - "#{CONF_DIR}/disk.d/conf.yaml" - end + let(:yaml_conf) do + <<-HEREDOC +### MANAGED BY PUPPET + +init_config: + +instances: + - use_mount: false + HEREDOC + end + + conf_file = "#{CONF_DIR}/disk.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { - is_expected.to contain_file(conf_file).with_content( - %r{\s+use_mount:\s+no[\r]*$}, - ).with( + is_expected.to contain_file(conf_file).with_content(yaml_conf).with( owner: DD_USER, group: DD_GROUP, mode: PERMISSIONS_PROTECTED_FILE, @@ -39,13 +44,13 @@ context 'we handle strings and arrays the same' do let(:params) do { - use_mount: 'yes', + use_mount: true, excluded_filesystems: ['tmpfs', 'dev'], excluded_disks: '/dev/sda1', excluded_disk_re: '/dev/sdb.*', excluded_mountpoint_re: '/mnt/other.*', - all_partitions: 'yes', - tag_by_filesystem: 'no', + all_partitions: true, + tag_by_filesystem: false, } end let(:yaml_conf) do @@ -55,7 +60,7 @@ init_config: instances: - - use_mount: yes + - use_mount: true excluded_filesystems: - tmpfs - dev @@ -63,8 +68,8 @@ - /dev/sda1 excluded_disk_re: /dev/sdb.* excluded_mountpoint_re: /mnt/other.* - all_partitions: yes - tag_by_filesystem: no + all_partitions: true + tag_by_filesystem: false HEREDOC end @@ -74,15 +79,15 @@ context 'we handle new disk configuration option' do let(:params) do { - use_mount: 'yes', + use_mount: true, filesystem_blacklist: ['tmpfs', 'dev'], device_blacklist: ['/dev/sda1'], mountpoint_blacklist: ['/mnt/foo'], filesystem_whitelist: ['ext4', 'hdfs', 'reiserfs'], device_whitelist: ['/dev/sdc1', '/dev/sdc2', '/dev/sdd2'], mountpoint_whitelist: ['/mnt/logs', '/mnt/builds'], - all_partitions: 'yes', - tag_by_filesystem: 'no', + all_partitions: true, + tag_by_filesystem: false, } end let(:yaml_conf) do @@ -92,7 +97,7 @@ init_config: instances: - - use_mount: yes + - use_mount: true file_system_blacklist: - tmpfs - dev @@ -111,8 +116,8 @@ mount_point_whitelist: - /mnt/logs - /mnt/builds - all_partitions: yes - tag_by_filesystem: no + all_partitions: true + tag_by_filesystem: false HEREDOC end @@ -122,15 +127,15 @@ context 'agent_version >= 7.24.0 disk configuration option' do let(:params) do { - use_mount: 'yes', + use_mount: true, filesystem_exclude: ['tmpfs', 'dev'], device_exclude: ['/dev/sda1'], mountpoint_exclude: ['/mnt/foo'], filesystem_include: ['ext4', 'hdfs', 'reiserfs'], device_include: ['/dev/sdc1', '/dev/sdc2', '/dev/sdd2'], mountpoint_include: ['/mnt/logs', '/mnt/builds'], - all_partitions: 'yes', - tag_by_filesystem: 'no', + all_partitions: true, + tag_by_filesystem: false, } end let(:yaml_conf) do @@ -140,7 +145,7 @@ init_config: instances: - - use_mount: yes + - use_mount: true file_system_exclude: - tmpfs - dev @@ -159,8 +164,8 @@ mount_point_include: - /mnt/logs - /mnt/builds - all_partitions: yes - tag_by_filesystem: no + all_partitions: true + tag_by_filesystem: false HEREDOC end diff --git a/spec/classes/datadog_agent_reports_spec.rb b/spec/classes/datadog_agent_reports_spec.rb index a88c20418..1ef0ec645 100644 --- a/spec/classes/datadog_agent_reports_spec.rb +++ b/spec/classes/datadog_agent_reports_spec.rb @@ -28,6 +28,9 @@ 'major' => getosmajor(operatingsystem), 'full' => getosrelease(operatingsystem), }, + 'distro' => { + 'codename' => getoscodename(operatingsystem), + } }, } end @@ -95,6 +98,9 @@ 'major' => '8', 'full' => '8.1', }, + 'distro' => { + 'codename' => 'jessie', + } }, } end @@ -144,6 +150,9 @@ 'major' => '8', 'full' => '8.1', }, + 'distro' => { + 'codename' => 'jessie', + } }, } end @@ -188,6 +197,9 @@ 'major' => '8', 'full' => '8.1', }, + 'distro' => { + 'codename' => 'jessie', + } }, } end @@ -234,6 +246,9 @@ 'major' => '8', 'full' => '8.1', }, + 'distro' => { + 'codename' => 'jessie', + } }, } end diff --git a/spec/classes/datadog_agent_spec.rb b/spec/classes/datadog_agent_spec.rb index bbc470148..60e593423 100644 --- a/spec/classes/datadog_agent_spec.rb +++ b/spec/classes/datadog_agent_spec.rb @@ -14,6 +14,9 @@ 'major' => '3', 'full' => '3.0', }, + 'distro' => { + 'codename' => 'nexenta', + } }, } end @@ -68,6 +71,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + }, }, } end @@ -94,6 +100,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + }, }, } end @@ -120,6 +129,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + }, }, } end diff --git a/spec/classes/datadog_agent_ubuntu_spec.rb b/spec/classes/datadog_agent_ubuntu_spec.rb index 6de162e5d..ee6ef100e 100644 --- a/spec/classes/datadog_agent_ubuntu_spec.rb +++ b/spec/classes/datadog_agent_ubuntu_spec.rb @@ -94,6 +94,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + } }, } end @@ -146,6 +149,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + } }, } end @@ -195,6 +201,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + } }, } end @@ -219,6 +228,9 @@ 'major' => '16', 'full' => '16.04', }, + 'distro' => { + 'codename' => 'xenial', + } }, } end @@ -243,6 +255,9 @@ 'major' => '8', 'full' => '8.0', }, + 'distro' => { + 'codename' => 'jessie', + } }, } end @@ -267,6 +282,9 @@ 'major' => '9', 'full' => '9.0', }, + 'distro' => { + 'codename' => 'stretch', + } }, } end diff --git a/spec/default_facts.yml b/spec/default_facts.yml index ac3ae8cb3..3346c394d 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -7,7 +7,3 @@ networking: ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" mac: "AA:AA:AA:AA:AA:AA" is_pe: false - -os: - distro: - codename: "jammy" \ No newline at end of file diff --git a/templates/agent-conf.d/disk.yaml.erb b/templates/agent-conf.d/disk.yaml.erb index 5681f4b3c..5d7e90761 100644 --- a/templates/agent-conf.d/disk.yaml.erb +++ b/templates/agent-conf.d/disk.yaml.erb @@ -3,7 +3,11 @@ init_config: instances: +<% if @use_mount.nil? -%> + - use_mount: false +<% else -%> - use_mount: <%= @use_mount %> +<% end -%> <% if @filesystem_blacklist -%> file_system_blacklist: <% (Array(@filesystem_blacklist)).each do |fs| -%> @@ -94,9 +98,9 @@ instances: <% if @excluded_mountpoint_re -%> excluded_mountpoint_re: <%= @excluded_mountpoint_re %> <% end -%> -<% if @all_partitions -%> +<% if not @all_partitions.nil? -%> all_partitions: <%= @all_partitions %> <% end -%> -<% if @tag_by_filesystem -%> +<% if not @tag_by_filesystem.nil? -%> tag_by_filesystem: <%= @tag_by_filesystem %> <% end -%> From 5e3f94178d8106afbc7d28207dca28146f73fe35 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 14 Feb 2025 09:31:03 -0500 Subject: [PATCH 100/133] fix tests --- spec/spec_helper.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f51f1b1d3..0989f8444 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -71,6 +71,16 @@ def getosrelease(operatingsystem) end end +def getoscodename(operatingsystem) + if DEBIAN_OS.include?(operatingsystem) + 'trusty' + elsif REDHAT_OS.include?(operatingsystem) + 'maipo' + else + 'seattle' + end +end + # Get parameters from catalogue. def get_from_catalogue(type, name, parameter) catalogue.resource(type, name).send(:parameters)[parameter.to_sym] @@ -96,6 +106,9 @@ def get_from_catalogue(type, name, parameter) minor: (RSpec::Support::OS.windows? ? 'SP1' : '04'), full: (RSpec::Support::OS.windows? ? '2019 SP1' : '14.04'), }, + 'distro' => { + 'codename' => (RSpec::Support::OS.windows? ? 'seattle' : 'focal'), + }, } } From a4c7b88e3e412b88d36ffe709a22b9733caaa39b Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 14 Feb 2025 09:44:09 -0500 Subject: [PATCH 101/133] remove agent 5 --- manifests/init.pp | 431 ++--- .../datadog_agent_integrations_kafka_spec.rb | 6 +- spec/classes/datadog_agent_redhat_spec.rb | 60 - spec/classes/datadog_agent_spec.rb | 1449 +---------------- spec/classes/datadog_agent_ubuntu_spec.rb | 54 - spec/spec_helper.rb | 2 +- templates/agent-conf.d/cassandra.yaml.erb | 3 +- templates/agent-conf.d/kafka.yaml.erb | 6 - 8 files changed, 190 insertions(+), 1821 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index b124f2f8a..badd8b628 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -646,309 +646,198 @@ } } - if $_agent_major_version == 5 { - if ($facts['os']['name'] == 'Windows') { - fail('Installation of agent 5 with puppet is not supported on Windows') - } - - if !empty($agent_extra_options) { - notify { 'Setting agent_extra_options has no effect with Agent 5': } - } - - file { '/etc/dd-agent': - ensure => directory, - owner => $dd_user, - group => $dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$agent_flavor], - } - - file { $_conf_dir: - ensure => directory, - purge => $conf_dir_purge, - recurse => true, - force => $conf_dir_purge, - owner => $dd_user, - group => $dd_group, - notify => Service[$datadog_agent::params::service_name], - } - - concat { '/etc/dd-agent/datadog.conf': - owner => $dd_user, - group => $dd_group, - mode => '0640', - notify => Service[$datadog_agent::params::service_name], - require => File['/etc/dd-agent'], - } - - if $dd_url.empty { - $_dd_url = 'https://app.datadoghq.com' - } else { - $_dd_url = $dd_url - } - concat::fragment { 'datadog header': - target => '/etc/dd-agent/datadog.conf', - content => template('datadog_agent/datadog_header.conf.erb'), - order => '01', - } - - concat::fragment { 'datadog tags': - target => '/etc/dd-agent/datadog.conf', - content => 'tags: ', - order => '02', - } - - datadog_agent::tag5 { $local_tags: } - datadog_agent::tag5 { $facts_to_tags: - lookup_fact => true, - } - - concat::fragment { 'datadog footer': - target => '/etc/dd-agent/datadog.conf', - content => template('datadog_agent/datadog_footer.conf.erb'), - order => '05', + # lint:ignore:quoted_booleans + $process_enabled_str = $process_enabled ? { true => 'true' , default => 'disabled' } + # lint:endignore + $base_extra_config = { + 'apm_config' => { + 'enabled' => $apm_enabled, + 'env' => $apm_env, + 'apm_non_local_traffic' => $apm_non_local_traffic, + }, + 'process_config' => { + 'enabled' => $process_enabled_str, + 'scrub_args' => $scrub_args, + 'custom_sensitive_words' => $custom_sensitive_words, + }, + 'logs_enabled' => $logs_enabled, + } + if $logs_open_files_limit { + $logs_base_config = { + 'logs_config' => { + 'container_collect_all' => $container_collect_all, + 'open_files_limit' => $logs_open_files_limit, + }, } - - unless $extra_template.empty { - concat::fragment { 'datadog extra_template footer': - target => '/etc/dd-agent/datadog.conf', - content => template($extra_template), - order => '06', - } + } else { + $logs_base_config = { + 'logs_config' => { + 'container_collect_all' => $container_collect_all, + }, } - - if ($apm_enabled == true) and (($apm_env != 'none') or $apm_analyzed_spans or $apm_obfuscation) { - concat::fragment { 'datadog apm footer': - target => '/etc/dd-agent/datadog.conf', - content => template('datadog_agent/datadog_apm_footer.conf.erb'), - order => '07', - } + } + if $host.empty { + $host_config = {} + } else { + $host_config = { + 'hostname' => $host, } + } - if ($process_enabled == true) { - concat::fragment { 'datadog process agent footer': - target => '/etc/dd-agent/datadog.conf', - content => template('datadog_agent/datadog_process_footer.conf.erb'), - order => '08', - } + if $apm_analyzed_spans { + $apm_analyzed_span_config = { + 'apm_config' => { + 'analyzed_spans' => $apm_analyzed_spans, + }, } + } else { + $apm_analyzed_span_config = {} + } - file { '/etc/dd-agent/install_info': - owner => $dd_user, - group => $dd_group, - mode => '0640', - content => template('datadog_agent/install_info.erb'), - require => File['/etc/dd-agent'], + if $apm_obfuscation { + $apm_obfuscation_config = { + 'apm_config' => { + 'obfuscation' => $apm_obfuscation, + }, } - } else { #Agent 6/7 + } else { + $apm_obfuscation_config = {} + } - # notify of broken params on agent6/7 - if !empty($proxy_host) { - notify { 'Setting proxy_host is only used with Agent 5. Please use agent_extra_options to set your proxy': } - } - if !empty($proxy_port) { - notify { 'Setting proxy_port is only used with Agent 5. Please use agent_extra_options to set your proxy': } - } - if !empty($proxy_user) { - notify { 'Setting proxy_user is only used with Agent 5. Please use agent_extra_options to set your proxy': } - } - if !empty($proxy_password) { - notify { 'Setting proxy_password is only used with Agent 5. Please use agent_extra_options to set your proxy': } + if $apm_filter_tags { + $apm_filter_tags_config = { + 'apm_config' => { + 'filter_tags' => $apm_filter_tags, + }, } + } else { + $apm_filter_tags_config = {} + } - # lint:ignore:quoted_booleans - $process_enabled_str = $process_enabled ? { true => 'true' , default => 'disabled' } - # lint:endignore - $base_extra_config = { + if $apm_filter_tags_regex { + $apm_filter_tags_regex_config = { 'apm_config' => { - 'enabled' => $apm_enabled, - 'env' => $apm_env, - 'apm_non_local_traffic' => $apm_non_local_traffic, - }, - 'process_config' => { - 'enabled' => $process_enabled_str, - 'scrub_args' => $scrub_args, - 'custom_sensitive_words' => $custom_sensitive_words, + 'filter_tags_regex' => $apm_filter_tags_regex, }, - 'logs_enabled' => $logs_enabled, } - if $logs_open_files_limit { - $logs_base_config = { - 'logs_config' => { - 'container_collect_all' => $container_collect_all, - 'open_files_limit' => $logs_open_files_limit, - }, - } - } else { - $logs_base_config = { - 'logs_config' => { - 'container_collect_all' => $container_collect_all, - }, + } else { + $apm_filter_tags_regex_config = {} + } + + if $statsd_forward_host.empty { + $statsd_forward_config = {} + } else { + if String($statsd_forward_port).empty { + $statsd_forward_config = { + 'statsd_forward_host' => $statsd_forward_host, } - } - if $host.empty { - $host_config = {} } else { - $host_config = { - 'hostname' => $host, + $statsd_forward_config = { + 'statsd_forward_host' => $statsd_forward_host, + 'statsd_forward_port' => $statsd_forward_port, } } + } - if $apm_analyzed_spans { - $apm_analyzed_span_config = { - 'apm_config' => { - 'analyzed_spans' => $apm_analyzed_spans, - }, - } - } else { - $apm_analyzed_span_config = {} + if $additional_checksd { + $additional_checksd_config = { + 'additional_checksd' => $additional_checksd, } + } else { + $additional_checksd_config = {} + } - if $apm_obfuscation { - $apm_obfuscation_config = { - 'apm_config' => { - 'obfuscation' => $apm_obfuscation, - }, - } - } else { - $apm_obfuscation_config = {} - } + $extra_config = deep_merge( + $base_extra_config, + $logs_base_config, + $agent_extra_options, + $apm_analyzed_span_config, + $apm_obfuscation_config, + $apm_filter_tags_config, + $apm_filter_tags_regex_config, + $statsd_forward_config, + $host_config, + $additional_checksd_config + ) + + file { $_conf_dir: + ensure => directory, + purge => $conf_dir_purge, + recurse => true, + force => $conf_dir_purge, + owner => $dd_user, + group => $dd_group, + } - if $apm_filter_tags { - $apm_filter_tags_config = { - 'apm_config' => { - 'filter_tags' => $apm_filter_tags, - }, - } - } else { - $apm_filter_tags_config = {} - } + if ! $_agent_managed_by_installer { + File[$_conf_dir] ~> Service[$datadog_agent::params::service_name] + } - if $apm_filter_tags_regex { - $apm_filter_tags_regex_config = { - 'apm_config' => { - 'filter_tags_regex' => $apm_filter_tags_regex, - }, - } - } else { - $apm_filter_tags_regex_config = {} - } + $_local_tags = datadog_agent::tag6($local_tags, false, undef) + $_facts_tags = datadog_agent::tag6($facts_to_tags, true, $facts) + $_trusted_facts_tags = datadog_agent::tag6($trusted_facts_to_tags, true, $trusted) + + $_agent_config = { + 'api_key' => $api_key, + '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, + 'confd_path' => $_conf_dir, + 'enable_metadata_collection' => $collect_instance_metadata, + 'dogstatsd_port' => $dogstatsd_port, + 'dogstatsd_socket' => $dogstatsd_socket, + 'dogstatsd_non_local_traffic' => $non_local_traffic, + 'log_file' => $agent_log_file, + 'log_level' => $log_level, + 'remote_updates' => $remote_updates, + 'remote_policies' => $remote_policies, + 'tags' => unique(flatten(union($_local_tags, $_facts_tags, $_trusted_facts_tags))), + } - if $statsd_forward_host.empty { - $statsd_forward_config = {} - } else { - if String($statsd_forward_port).empty { - $statsd_forward_config = { - 'statsd_forward_host' => $statsd_forward_host, - } - } else { - $statsd_forward_config = { - 'statsd_forward_host' => $statsd_forward_host, - 'statsd_forward_port' => $statsd_forward_port, - } - } + $agent_config = deep_merge($_agent_config, $extra_config) + + if ($facts['os']['name'] == 'Windows') { + file { 'C:/ProgramData/Datadog': + ensure => directory, } - if $additional_checksd { - $additional_checksd_config = { - 'additional_checksd' => $additional_checksd, - } - } else { - $additional_checksd_config = {} + file { 'C:/ProgramData/Datadog/datadog.yaml': + owner => $dd_user, + group => $dd_group, + mode => '0660', + content => template('datadog_agent/datadog.yaml.erb'), + show_diff => false, + notify => Service[$datadog_agent::params::service_name], + require => File['C:/ProgramData/Datadog'], } - $extra_config = deep_merge( - $base_extra_config, - $logs_base_config, - $agent_extra_options, - $apm_analyzed_span_config, - $apm_obfuscation_config, - $apm_filter_tags_config, - $apm_filter_tags_regex_config, - $statsd_forward_config, - $host_config, - $additional_checksd_config - ) - - file { $_conf_dir: - ensure => directory, - purge => $conf_dir_purge, - recurse => true, - force => $conf_dir_purge, + file { 'C:/ProgramData/Datadog/install_info': owner => $dd_user, group => $dd_group, + mode => '0660', + content => template('datadog_agent/install_info.erb'), + require => File['C:/ProgramData/Datadog'], } - - if ! $_agent_managed_by_installer { - File[$_conf_dir] ~> Service[$datadog_agent::params::service_name] - } - - $_local_tags = datadog_agent::tag6($local_tags, false, undef) - $_facts_tags = datadog_agent::tag6($facts_to_tags, true, $facts) - $_trusted_facts_tags = datadog_agent::tag6($trusted_facts_to_tags, true, $trusted) - - $_agent_config = { - 'api_key' => $api_key, - '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, - 'confd_path' => $_conf_dir, - 'enable_metadata_collection' => $collect_instance_metadata, - 'dogstatsd_port' => $dogstatsd_port, - 'dogstatsd_socket' => $dogstatsd_socket, - 'dogstatsd_non_local_traffic' => $non_local_traffic, - 'log_file' => $agent_log_file, - 'log_level' => $log_level, - 'remote_updates' => $remote_updates, - 'remote_policies' => $remote_policies, - 'tags' => unique(flatten(union($_local_tags, $_facts_tags, $_trusted_facts_tags))), + } else { + file { '/etc/datadog-agent/datadog.yaml': + owner => $dd_user, + group => $dd_group, + mode => '0640', + content => template('datadog_agent/datadog.yaml.erb'), + show_diff => false, + notify => Service[$datadog_agent::params::service_name], + require => File['/etc/datadog-agent'], } - $agent_config = deep_merge($_agent_config, $extra_config) - - if ($facts['os']['name'] == 'Windows') { - file { 'C:/ProgramData/Datadog': - ensure => directory, - } - - file { 'C:/ProgramData/Datadog/datadog.yaml': - owner => $dd_user, - group => $dd_group, - mode => '0660', - content => template('datadog_agent/datadog.yaml.erb'), - show_diff => false, - notify => Service[$datadog_agent::params::service_name], - require => File['C:/ProgramData/Datadog'], - } - - file { 'C:/ProgramData/Datadog/install_info': - owner => $dd_user, - group => $dd_group, - mode => '0660', - content => template('datadog_agent/install_info.erb'), - require => File['C:/ProgramData/Datadog'], - } - } else { - file { '/etc/datadog-agent/datadog.yaml': - owner => $dd_user, - group => $dd_group, - mode => '0640', - content => template('datadog_agent/datadog.yaml.erb'), - show_diff => false, - notify => Service[$datadog_agent::params::service_name], - require => File['/etc/datadog-agent'], - } - - file { '/etc/datadog-agent/install_info': - owner => $dd_user, - group => $dd_group, - mode => '0640', - content => template('datadog_agent/install_info.erb'), - require => File['/etc/datadog-agent'], - } + file { '/etc/datadog-agent/install_info': + owner => $dd_user, + group => $dd_group, + mode => '0640', + content => template('datadog_agent/install_info.erb'), + require => File['/etc/datadog-agent'], } } diff --git a/spec/classes/datadog_agent_integrations_kafka_spec.rb b/spec/classes/datadog_agent_integrations_kafka_spec.rb index 1c32579a3..fdeacea2d 100644 --- a/spec/classes/datadog_agent_integrations_kafka_spec.rb +++ b/spec/classes/datadog_agent_integrations_kafka_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/kafka.yaml' - else - "#{CONF_DIR}/kafka.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/kafka.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_redhat_spec.rb b/spec/classes/datadog_agent_redhat_spec.rb index 2c4ea4da7..c469717f7 100644 --- a/spec/classes/datadog_agent_redhat_spec.rb +++ b/spec/classes/datadog_agent_redhat_spec.rb @@ -1,66 +1,6 @@ require 'spec_helper' describe 'datadog_agent::redhat' do - context 'agent 5' do - if RSpec::Support::OS.windows? - return - end - - let(:facts) do - { - os: { - 'architecture' => 'x86_64', - 'family' => 'redhat', - 'name' => 'Fedora', - 'release' => { - 'major' => '36', - 'full' => '36', - }, - }, - } - end - - # it should install the mirror - context 'with manage_repo => true' do - let(:params) do - { - manage_repo: true, - agent_major_version: 5, - } - end - - it do - is_expected.to contain_yumrepo('datadog') - .with_enabled(1)\ - .with_gpgcheck(1)\ - .with_gpgkey('https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public - https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public - https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public - https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public')\ - .with_baseurl('https://yum.datadoghq.com/rpm/x86_64/')\ - .with_repo_gpgcheck(false) - end - end - context 'with manage_repo => false' do - let(:params) do - { - manage_repo: false, agent_major_version: 5 - } - end - - it do - is_expected.not_to contain_yumrepo('datadog') - is_expected.not_to contain_yumrepo('datadog5') - is_expected.not_to contain_yumrepo('datadog6') - end - end - # it should install the packages - it do - is_expected.to contain_package('datadog-agent')\ - .with_ensure('latest') - end - end - context 'agent 6' do let(:facts) do { diff --git a/spec/classes/datadog_agent_spec.rb b/spec/classes/datadog_agent_spec.rb index 60e593423..0fc614fed 100644 --- a/spec/classes/datadog_agent_spec.rb +++ b/spec/classes/datadog_agent_spec.rb @@ -29,32 +29,6 @@ end end - context 'autodetect major version agent 5' do - let(:params) do - { - agent_version: '5.15.1', - } - end - let(:facts) do - { - os: { - 'architecture' => 'x86_64', - 'family' => 'debian', - 'name' => 'Ubuntu', - 'release' => { - 'major' => '14', - 'full' => '14.04', - }, - }, - } - end - - it do - is_expected.to contain_file('/etc/apt/sources.list.d/datadog.list')\ - .with_content(%r{deb\s+\[signed-by=/usr/share/keyrings/datadog-archive-keyring.gpg\]\s+https://apt.datadoghq.com/\s+stable\s+main}) - end - end - context 'autodetect major version agent 6' do let(:params) do { @@ -158,6 +132,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + }, }, } end @@ -184,6 +161,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + }, }, } end @@ -210,6 +190,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + }, }, } end @@ -238,6 +221,9 @@ 'major' => '14', 'full' => '14.04', }, + 'distro' => { + 'codename' => 'trusty', + }, }, } end @@ -316,6 +302,9 @@ 'major' => getosmajor(operatingsystem), 'full' => getosrelease(operatingsystem), }, + 'distro' => { + 'code' => getoscodename(operatingsystem), + } }, } end @@ -348,1304 +337,6 @@ end end - describe "datadog_agent 5 class common actions on #{operatingsystem}" do - let(:params) do - { - puppet_run_reports: true, - agent_major_version: 5, - } - end - let(:facts) do - { - os: { - 'architecture' => 'x86_64', - 'family' => getosfamily(operatingsystem), - 'name' => operatingsystem, - 'release' => { - 'major' => getosmajor(operatingsystem), - 'full' => getosrelease(operatingsystem), - }, - }, - } - end - - if WINDOWS_OS.include?(operatingsystem) - it 'agent 5 should raise on Windows' do - is_expected.to raise_error(Puppet::Error, %r{Installation of agent 5 with puppet is not supported on Windows}) - end - else - it { is_expected.to compile.with_all_deps } - - it { is_expected.to contain_class('datadog_agent') } - - describe 'datadog_agent imports the default params' do - it { is_expected.to contain_class('datadog_agent::params') } - end - - it { is_expected.to contain_file('/etc/datadog-agent') } - it { is_expected.to contain_file('/etc/dd-agent') } - it { is_expected.to contain_concat('/etc/dd-agent/datadog.conf') } - it { is_expected.to contain_file('/etc/dd-agent/conf.d').with_ensure('directory') } - - it { is_expected.to contain_class('datadog_agent::reports') } - - describe 'parameter check' do - context 'with defaults' do - context 'for proxy' do - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{dd_url: https://app.datadoghq.com\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^# proxy_host:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^# proxy_port:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^# proxy_user:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^# proxy_password:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^# skip_ssl_validation: no\n}, - ) - } - end - - context 'for general' do - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^api_key: your_API_key\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^# hostname:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^non_local_traffic: false\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^collect_ec2_tags: false\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^collect_instance_metadata: true\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{# recent_point_threshold: 30\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# listen_port: 17123\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# graphite_listen_port: 17124\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{# additional_checksd: /etc/dd-agent/checks.d/\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^use_curl_http_client: false\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# device_blacklist_re: .*\\/dev\\/mapper\\/lxc-box.*\n}, - ) - } - end - - context 'for pup' do - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^use_pup: no\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# pup_port: 17125\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# pup_interface: localhost\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{# pup_url: http://localhost:17125\n}, - ) - } - end - - context 'for dogstatsd' do - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# bind_host: localhost\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^use_dogstatsd: yes\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^dogstatsd_port: 8125\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{# dogstatsd_target: http://localhost:17123\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# dogstatsd_interval: 10\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^dogstatsd_normalize: yes\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# statsd_forward_host: address_of_own_statsd_server\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# statsd_forward_port: 8125\n}, - ) - } - end - - context 'for logging' do - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^log_level: INFO\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^log_to_syslog: yes\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{# collector_log_file: /var/log/datadog/collector.log\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{# forwarder_log_file: /var/log/datadog/forwarder.log\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{# dogstatsd_log_file: /var/log/datadog/dogstatsd.log\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with - # 'content' => %r{# pup_log_file: /var/log/datadog/pup.log\n}, - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# syslog_host:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^# syslog_port:\n}, - ) - } - end - - context 'for service_discovery' do - it { - is_expected.to contain_concat__fragment('datadog footer').without( - 'content' => %r{^service_discovery_backend:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').without( - 'content' => %r{^sd_config_backend:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').without( - 'content' => %r{^sd_backend_host:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').without( - 'content' => %r{^sd_backend_port:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').without( - 'content' => %r{^sd_template_dir:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').without( - 'content' => %r{^consul_token:\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').without( - 'content' => %r{^# sd_jmx_enable:\n}, - ) - } - end - - context 'for APM' do - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^apm_enabled: false\n}, - ) - } - end - end - - context 'with user provided paramaters' do - context 'with a custom dd_url' do - let(:params) do - { - dd_url: 'https://notaurl.datadoghq.com', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{dd_url: https://notaurl.datadoghq.com\n}, - ) - } - end - context 'with a custom proxy_host' do - let(:params) do - { - proxy_host: 'localhost', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^proxy_host: localhost\n}, - ) - } - end - context 'with a custom proxy_port' do - let(:params) do - { - proxy_port: '1234', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^proxy_port: 1234\n}, - ) - } - end - context 'with a custom proxy_port, specified as an integer' do - let(:params) do - { - proxy_port: 1234, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^proxy_port: 1234\n}, - ) - } - end - context 'with a custom proxy_user' do - let(:params) do - { - proxy_user: 'notauser', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^proxy_user: notauser\n}, - ) - } - end - context 'with a custom api_key' do - let(:params) do - { - api_key: 'notakey', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^api_key: notakey\n}, - ) - } - end - context 'with a custom hostname' do - let(:params) do - { - host: 'notahost', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^hostname: notahost\n}, - ) - } - end - context 'with non_local_traffic set to true' do - let(:params) do - { - non_local_traffic: true, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^non_local_traffic: true\n}, - ) - } - end - # Should expand testing to cover changes to the case upcase - context 'with log level set to critical' do - let(:params) do - { - log_level: 'critical', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^log_level: CRITICAL\n}, - ) - } - end - context 'with a custom hostname' do - let(:params) do - { - host: 'notahost', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^hostname: notahost\n}, - ) - } - end - context 'with log_to_syslog set to false' do - let(:params) do - { - log_to_syslog: false, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^log_to_syslog: no\n}, - ) - } - end - context 'with skip_ssl_validation set to true' do - let(:params) do - { - skip_ssl_validation: true, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog header').with( - 'content' => %r{^skip_ssl_validation: true\n}, - ) - } - end - context 'with collect_ec2_tags set to yes' do - let(:params) do - { - collect_ec2_tags: true, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^collect_ec2_tags: true\n}, - ) - } - end - context 'with collect_instance_metadata set to no' do - let(:params) do - { - collect_instance_metadata: false, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^collect_instance_metadata: false\n}, - ) - } - end - context 'with recent_point_threshold set to 60' do - let(:params) do - { - recent_point_threshold: '60', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^recent_point_threshold: 60\n}, - ) - } - end - context 'with a custom port set to 17125' do - let(:params) do - { - listen_port: '17125', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^listen_port: 17125\n}, - ) - } - end - context 'with a custom port set to 17125, specified as an integer' do - let(:params) do - { - listen_port: 17_125, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^listen_port: 17125\n}, - ) - } - end - context 'listening for graphite data on port 17124' do - let(:params) do - { - graphite_listen_port: '17124', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^graphite_listen_port: 17124\n}, - ) - } - end - context 'listening for graphite data on port 17124, port specified as an integer' do - let(:params) do - { - graphite_listen_port: 17_124, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^graphite_listen_port: 17124\n}, - ) - } - end - context 'with configuration for a custom checks.d' do - let(:params) do - { - additional_checksd: '/etc/dd-agent/checks_custom.d', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{additional_checksd: /etc/dd-agent/checks_custom.d\n}, - ) - } - end - context 'with configuration for a custom checks.d' do - let(:params) do - { - additional_checksd: '/etc/dd-agent/checks_custom.d', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{additional_checksd: /etc/dd-agent/checks_custom.d\n}, - ) - } - end - context 'with configuration for a custom checks.d' do - let(:params) do - { - additional_checksd: '/etc/dd-agent/checks_custom.d', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{additional_checksd: /etc/dd-agent/checks_custom.d\n}, - ) - } - end - context 'with using the Tornado HTTP client' do - let(:params) do - { - use_curl_http_client: true, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^use_curl_http_client: true\n}, - ) - } - end - context 'with a custom bind_host' do - let(:params) do - { - bind_host: 'test', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^bind_host: test\n}, - ) - } - end - context 'with pup enabled' do - let(:params) do - { - use_pup: true, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^use_pup: yes\n}, - ) - } - end - context 'with a custom pup_port' do - let(:params) do - { - pup_port: '17126', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^pup_port: 17126\n}, - ) - } - end - context 'with a custom pup_port, specified as an integer' do - let(:params) do - { - pup_port: 17_126, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^pup_port: 17126\n}, - ) - } - end - context 'with a custom pup_interface' do - let(:params) do - { - pup_interface: 'notalocalhost', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^pup_interface: notalocalhost\n}, - ) - } - end - context 'with a custom pup_url' do - let(:params) do - { - pup_url: 'http://localhost:17126', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{pup_url: http://localhost:17126\n}, - ) - } - end - context 'with use_dogstatsd set to no' do - let(:params) do - { - use_dogstatsd: false, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^use_dogstatsd: no\n}, - ) - } - end - context 'with use_dogstatsd set to yes' do - let(:params) do - { - use_dogstatsd: true, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^use_dogstatsd: yes\n}, - ) - } - end - context 'with dogstatsd_port set to 8126 - must be specified as an integer!' do - let(:params) do - { - dogstatsd_port: 8126, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^dogstatsd_port: 8126\n}, - ) - } - end - context 'with dogstatsd_port set to 8126' do - let(:params) do - { - dogstatsd_port: 8126, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^dogstatsd_port: 8126\n}, - ) - } - end - context 'with dogstatsd_target set to localhost:17124' do - let(:params) do - { - dogstatsd_target: 'http://localhost:17124', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{dogstatsd_target: http://localhost:17124\n}, - ) - } - end - context 'with dogstatsd_interval set to 5' do - let(:params) do - { - dogstatsd_interval: '5', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^dogstatsd_interval: 5\n}, - ) - } - end - context 'with dogstatsd_interval set to 5' do - let(:params) do - { - dogstatsd_interval: '5', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^dogstatsd_interval: 5\n}, - ) - } - end - context 'with dogstatsd_normalize set to false' do - let(:params) do - { - dogstatsd_normalize: false, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^dogstatsd_normalize: no\n}, - ) - } - end - context 'with statsd_forward_host set to localhost:3958' do - let(:params) do - { - statsd_forward_host: 'localhost:3958', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^statsd_forward_host: localhost:3958\n}, - ) - } - end - context 'with statsd_forward_port set to 8126' do - let(:params) do - { - statsd_forward_port: '8126', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^statsd_forward_port: 8126\n}, - ) - } - end - context 'with statsd_forward_port set to 8126, specified as an integer' do - let(:params) do - { - statsd_forward_port: 8126, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^statsd_forward_port: 8126\n}, - ) - } - end - context 'with device_blacklist_re set to test' do - let(:params) do - { - device_blacklist_re: 'test', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^device_blacklist_re: test\n}, - ) - } - end - context 'with device_blacklist_re set to test' do - let(:params) do - { - device_blacklist_re: 'test', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^device_blacklist_re: test\n}, - ) - } - end - context 'with custom_emitters set to /test/emitter' do - let(:params) do - { - custom_emitters: '/test/emitter/', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{custom_emitters: /test/emitter/\n}, - ) - } - end - context 'with custom_emitters set to /test/emitter' do - let(:params) do - { - custom_emitters: '/test/emitter/', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{custom_emitters: /test/emitter/\n}, - ) - } - end - context 'with collector_log_file set to /test/log' do - let(:params) do - { - collector_log_file: '/test/log', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{collector_log_file: /test/log\n}, - ) - } - end - context 'with forwarder_log_file set to /test/log' do - let(:params) do - { - forwarder_log_file: '/test/log', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{forwarder_log_file: /test/log\n}, - ) - } - end - context 'with forwarder_log_file set to /test/log' do - let(:params) do - { - forwarder_log_file: '/test/log', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{forwarder_log_file: /test/log\n}, - ) - } - end - context 'with dogstatsd_log_file set to /test/log' do - let(:params) do - { - dogstatsd_log_file: '/test/log', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{dogstatsd_log_file: /test/log\n}, - ) - } - end - context 'with pup_log_file set to /test/log' do - let(:params) do - { - pup_log_file: '/test/log', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^pup_log_file: /test/log\n}, - ) - } - end - context 'with syslog location set to localhost' do - let(:params) do - { - syslog_host: 'localhost', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^syslog_host: localhost\n}, - ) - } - end - context 'with syslog port set to 8080' do - let(:params) do - { - syslog_port: '8080', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^syslog_port: 8080\n}, - ) - } - end - context 'with syslog port set to 8080, specified as an integer' do - let(:params) do - { - syslog_port: 8080, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^syslog_port: 8080\n}, - ) - } - end - context 'with apm_enabled set to true' do - let(:params) do - { - apm_enabled: true, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^apm_enabled: true\n}, - ) - } - end - context 'with apm_enabled set to true and env specified' do - let(:params) do - { - apm_enabled: true, - apm_env: 'foo', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^apm_enabled: true\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog apm footer').with( - 'content' => %r{^\[trace.agent\]\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog apm footer').with( - 'content' => %r{^env: foo\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog apm footer').with( - 'order' => '07', - ) - } - end - context 'with apm_enabled and apm_analyzed_spans set' do - let(:params) do - { - apm_enabled: true, - agent_major_version: 5, - apm_analyzed_spans: { - 'foo|bar' => 0.5, - 'haz|qux' => 0.1, - }, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^apm_enabled: true\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog apm footer').with( - 'content' => %r{^\[trace.analyzed_spans\]\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog apm footer').with( - 'content' => %r{^\[trace.analyzed_spans\]\nfoo|bar: 0.5\nhaz|qux: 0.1}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog apm footer').with( - 'order' => '07', - ) - } - end - context 'with service_discovery enabled' do - let(:params) do - { - service_discovery_backend: 'docker', - sd_config_backend: 'etcd', - sd_backend_host: 'localhost', - sd_backend_port: 8080, - sd_jmx_enable: true, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^service_discovery_backend: docker\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^sd_config_backend: etcd\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^sd_backend_host: localhost\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^sd_backend_port: 8080\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^sd_jmx_enable: true\n}, - ) - } - end - context 'with extra_template enabled' do - let(:params) do - { - extra_template: 'custom_datadog/extra_template_test.erb', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog extra_template footer').with( - 'order' => '06', - ) - } - it { - is_expected.to contain_concat__fragment('datadog extra_template footer').with( - 'content' => %r{^# extra template is here\n}, - ) - } - it { - is_expected.not_to contain_concat__fragment('datadog apm footer').with( - 'order' => '07', - ) - } - end - context 'with APM enabled' do - let(:params) do - { - apm_enabled: true, - apm_env: 'foo', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog apm footer').with( - 'order' => '07', - ) - } - end - context 'with APM enabled but no APM env' do - let(:params) do - { - apm_enabled: true, - agent_major_version: 5, - } - end - - it { - is_expected.not_to contain_concat__fragment('datadog apm footer').with( - 'order' => '07', - ) - } - end - context 'with extra_template and APM enabled' do - let(:params) do - { - extra_template: 'custom_datadog/extra_template_test.erb', - apm_enabled: true, - apm_env: 'foo', - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog extra_template footer').with( - 'order' => '06', - ) - } - it { - is_expected.to contain_concat__fragment('datadog extra_template footer').with( - 'content' => %r{^# extra template is here\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog apm footer').with( - 'order' => '07', - ) - } - end - context 'with process_agent enabled' do - let(:params) do - { - process_enabled: true, - agent_major_version: 5, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^process_agent_enabled: true\n}, - ) - } - end - - context 'with data scrubbing disabled' do - let(:params) do - { - process_enabled: true, - agent_major_version: 5, - scrub_args: false, - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^process_agent_enabled: true\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog process agent footer').with( - 'content' => %r{^\[process.config\]\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog process agent footer').with( - 'content' => %r{^scrub_args: false\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog process agent footer').with( - 'content' => %r{^custom_sensitive_words: \n}, - ) - } - end - - context 'with data scrubbing enabled with custom sensitive_words' do - let(:params) do - { - process_enabled: true, - agent_major_version: 5, - custom_sensitive_words: ['consul_token', 'dd_key'], - } - end - - it { - is_expected.to contain_concat__fragment('datadog footer').with( - 'content' => %r{^process_agent_enabled: true\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog process agent footer').with( - 'content' => %r{^\[process.config\]\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog process agent footer').with( - 'content' => %r{^scrub_args: true\n}, - ) - } - it { - is_expected.to contain_concat__fragment('datadog process agent footer').with( - 'content' => %r{^custom_sensitive_words: consul_token,dd_key\n}, - ) - } - end - end - end - - if REDHAT_OS.include?(operatingsystem) - it { is_expected.to contain_class('datadog_agent::redhat') } - end - end - end - describe "datadog_agent 6/7 class with reports on #{operatingsystem}" do let(:params) do { @@ -1662,6 +353,9 @@ 'major' => getosmajor(operatingsystem), 'full' => getosrelease(operatingsystem), }, + 'distro' => { + 'codename' => getoscodename(operatingsystem), + } }, } end @@ -1695,6 +389,9 @@ 'major' => getosmajor(operatingsystem), 'full' => getosrelease(operatingsystem), }, + 'distro' => { + 'codename' => getoscodename(operatingsystem) + }, }, } end @@ -1717,11 +414,6 @@ it { is_expected.to contain_file(install_info_file) } it { is_expected.to contain_file(config_dir + '/conf.d').with_ensure('directory') } - # Agent 5 files - it { is_expected.not_to contain_file('/etc/dd-agent') } - it { is_expected.not_to contain_concat('/etc/dd-agent/datadog.conf') } - it { is_expected.not_to contain_file('/etc/dd-agent/conf.d').with_ensure('directory') } - describe 'install_info check' do let!(:install_info) do contents = catalogue.resource('file', install_info_file).send(:parameters)[:content] @@ -1905,68 +597,6 @@ ) } end - context 'deprecated proxy settings' do - let(:params) do - { - proxy_host: 'foo', - proxy_port: 1234, - proxy_user: 'bar', - proxy_password: 'abcd1234', - } - end - - it { - is_expected.to contain_notify( - 'Setting proxy_host is only used with Agent 5. Please use agent_extra_options to set your proxy', - ) - } - it { - is_expected.to contain_notify( - 'Setting proxy_port is only used with Agent 5. Please use agent_extra_options to set your proxy', - ) - } - it { - is_expected.to contain_notify( - 'Setting proxy_user is only used with Agent 5. Please use agent_extra_options to set your proxy', - ) - } - it { - is_expected.to contain_notify( - 'Setting proxy_password is only used with Agent 5. Please use agent_extra_options to set your proxy', - ) - } - end - context 'deprecated proxy settings with default values' do - let(:params) do - { - proxy_host: '', - proxy_port: '', - proxy_user: '', - proxy_password: '', - } - end - - it { - is_expected.not_to contain_notify( - 'Setting proxy_host is only used with Agent 5. Please use agent_extra_options to set your proxy', - ) - } - it { - is_expected.not_to contain_notify( - 'Setting proxy_port is only used with Agent 5. Please use agent_extra_options to set your proxy', - ) - } - it { - is_expected.not_to contain_notify( - 'Setting proxy_user is only used with Agent 5. Please use agent_extra_options to set your proxy', - ) - } - it { - is_expected.not_to contain_notify( - 'Setting proxy_password is only used with Agent 5. Please use agent_extra_options to set your proxy', - ) - } - end end context 'with additional agents config' do @@ -2311,6 +941,9 @@ 'major' => '6', 'full' => '6.3', }, + 'distro' => { + 'codename' => 'santiago', + } }, } end @@ -2361,6 +994,9 @@ 'major' => '6', 'full' => '6.3', }, + 'distro' => { + 'codename' => 'santiago', + } }, } end @@ -2370,36 +1006,5 @@ .with_content(%r{tags:\n- os.family:redhat\n- facts_array:one\n- facts_array:two\n- facts_hash.actor.first_name:Macaulay\n- looks.like.a.path:but_its_not}) end end - - describe 'a5 ensure facts_array outputs a list of tags' do - let(:params) do - { - agent_major_version: 5, - puppet_run_reports: true, - facts_to_tags: ['osfamily', 'facts_array'], - } - end - let(:facts) do - { - facts_array: ['one', 'two'], - osfamily: 'redhat', - os: { - 'architecture' => 'x86_64', - 'family' => 'redhat', - 'name' => 'CentOS', - 'release' => { - 'major' => '6', - 'full' => '6.3', - }, - }, - } - end - - it { is_expected.to contain_concat('/etc/dd-agent/datadog.conf') } - it { is_expected.to contain_concat__fragment('datadog tags').with_content('tags: ') } - it { is_expected.to contain_concat__fragment('datadog tag osfamily:redhat').with_content('osfamily:redhat, ') } - it { is_expected.to contain_concat__fragment('datadog tag facts_array:one').with_content('facts_array:one, ') } - it { is_expected.to contain_concat__fragment('datadog tag facts_array:two').with_content('facts_array:two, ') } - end end end diff --git a/spec/classes/datadog_agent_ubuntu_spec.rb b/spec/classes/datadog_agent_ubuntu_spec.rb index ee6ef100e..da5c31e97 100644 --- a/spec/classes/datadog_agent_ubuntu_spec.rb +++ b/spec/classes/datadog_agent_ubuntu_spec.rb @@ -23,60 +23,6 @@ end describe 'datadog_agent::ubuntu' do - context 'agent 5' do - if RSpec::Support::OS.windows? - return - end - let(:params) do - { - agent_major_version: 5, - } - end - let(:facts) do - { - os: { - 'architecture' => 'x86_64', - 'family' => 'debian', - 'name' => 'Ubuntu', - 'release' => { - 'major' => '14', - 'full' => '14.04', - }, - }, - } - end - - it do - is_expected.to contain_file('/etc/apt/sources.list.d/datadog5.list') - .with_ensure('absent') - is_expected.to contain_file('/etc/apt/sources.list.d/datadog6.list') - .with_ensure('absent') - is_expected.to contain_file('/etc/apt/sources.list.d/datadog.list')\ - .with_content(%r{deb\s+\[signed-by=/usr/share/keyrings/datadog-archive-keyring.gpg\]\s+https://apt.datadoghq.com/\s+stable\s+main}) - end - - # it should install the mirror - it { is_expected.not_to contain_apt__key('935F5A436A5A6E8788F0765B226AE980C7A7DA52') } - - it do - is_expected.to contain_file('/etc/apt/sources.list.d/datadog.list')\ - .that_notifies('exec[apt_update]') - end - it { is_expected.to contain_exec('apt_update') } - - # it should install the packages - it do - is_expected.to contain_package('datadog-agent-base')\ - .with_ensure('absent')\ - .that_comes_before('package[datadog-agent]') - end - it do - is_expected.to contain_package('datadog-agent')\ - .that_requires('file[/etc/apt/sources.list.d/datadog.list]')\ - .that_requires('exec[apt_update]') - end - end - context 'agent 6' do let(:params) do { diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0989f8444..103363309 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -27,7 +27,7 @@ PERMISSIONS_PROTECTED_FILE = '0660' else ALL_OS = DEBIAN_OS + REDHAT_OS - ALL_SUPPORTED_AGENTS = [5, 6, 7].freeze + ALL_SUPPORTED_AGENTS = [6, 7].freeze CONF_DIR = '/etc/datadog-agent/conf.d' DD_USER = 'dd-agent' DD_GROUP = 'dd-agent' diff --git a/templates/agent-conf.d/cassandra.yaml.erb b/templates/agent-conf.d/cassandra.yaml.erb index afc51389d..86afee025 100644 --- a/templates/agent-conf.d/cassandra.yaml.erb +++ b/templates/agent-conf.d/cassandra.yaml.erb @@ -33,8 +33,7 @@ init_config: ## @param conf - list of objects - required ## List of metrics to be collected by the integration ## Read http://docs.datadoghq.com/integrations/java/ to learn how to customize it - ## Agent 5: Customize all your metrics below - ## Agent 6: The default metrics to be collected are kept in metrics.yaml, but you can still add your own metrics here + ## Agent 6/7: The default metrics to be collected are kept in metrics.yaml, but you can still add your own metrics here # conf: - include: diff --git a/templates/agent-conf.d/kafka.yaml.erb b/templates/agent-conf.d/kafka.yaml.erb index c76955f28..88ffabbc9 100644 --- a/templates/agent-conf.d/kafka.yaml.erb +++ b/templates/agent-conf.d/kafka.yaml.erb @@ -1,11 +1,5 @@ ### MANAGED BY PUPPET -########## -# WARNING -########## -# This sample works only for Kafka >= 0.8.2. -# If you are running a version older than that, you can refer to agent 5.2.x released -# sample files, https://raw.githubusercontent.com/DataDog/dd-agent/5.2.1/conf.d/kafka.yaml.example instances: <% @servers.each do |server| -%> - host: <%= server['host'] %> From 4b78abd1cc7982b4afdb37e48fa5abdddf33f8fc Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 14 Feb 2025 12:57:49 -0500 Subject: [PATCH 102/133] fix rubocop target ruby version --- .rubocop | 2 +- .rubocop.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rubocop b/.rubocop index 92530682b..f0cd84d68 100644 --- a/.rubocop +++ b/.rubocop @@ -1,2 +1,2 @@ --ignore-unrecognized-cops ---autocorrect \ No newline at end of file +--autocorrect diff --git a/.rubocop.yml b/.rubocop.yml index bb7b4a331..056c84ef3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable DisplayCopNames: true - TargetRubyVersion: '3.3' + TargetRubyVersion: '3.2' Include: - "**/*.rb" Exclude: From 25d62bbc403d2b30f1fb7ee682db8e05347b00f1 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 14 Feb 2025 13:00:52 -0500 Subject: [PATCH 103/133] remote --autocorrect from .rubocop --- .rubocop | 1 - 1 file changed, 1 deletion(-) diff --git a/.rubocop b/.rubocop index f0cd84d68..fc40e8e2e 100644 --- a/.rubocop +++ b/.rubocop @@ -1,2 +1 @@ --ignore-unrecognized-cops ---autocorrect From 8f44885d9d510368765f749a96bf4703e899902e Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 14 Feb 2025 12:02:41 -0500 Subject: [PATCH 104/133] add facter and kitchen-puppet gems to kitchen gemfile, disable centos stream kitchen tests --- environments/etc/Gemfile | 6 ++++- kitchen.yml | 48 ++++++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/environments/etc/Gemfile b/environments/etc/Gemfile index 7ac3eebbc..2c67d16f7 100644 --- a/environments/etc/Gemfile +++ b/environments/etc/Gemfile @@ -1,7 +1,11 @@ source 'https://rubygems.org' -gem 'semantic_puppet', '1.1.1' +gem 'semantic_puppet', '1.1.1' gem 'multipart-post', '2.4.1' gem 'r10k', '4.1.0' gem 'json', '2.6.3' gem 'racc', '~> 1.4.0' gem 'net-ssh', '~> 7.3' +gem "facterdb", '~> 3.4.0' +gem "rspec-puppet-facts", '~> 5.2.0' +gem "facter", '~> 4.10.0' +gem "kitchen-puppet", '~> 3.7.0' \ No newline at end of file diff --git a/kitchen.yml b/kitchen.yml index 0c8650128..f8652aefd 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -95,26 +95,36 @@ platforms: # - cd /home && bundle install # - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules -- name: centos-stream9-puppet-8 - driver: - image: 'quay.io/centos/centos:stream9' - platform: centosstream - use_sudo: true - privileged: true - provision_command: - - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo - - yum install -y puppet-agent rubygems ruby-devel - - dnf group install -y "Development Tools" - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - mkdir /home/kitchen/puppet -p - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules +# TODO: validate module support for CentOS Stream +# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' +# Debug: Executing: 'ps -ef' +# Error: /Service[datadog-agent]: Could not evaluate: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps +# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' +# Debug: Executing: 'ps -ef' +# Error: /Service[datadog-agent]: Failed to call refresh: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps +# Error: /Service[datadog-agent]: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps +#- name: centos-stream9-puppet-8 +# driver: +# image: 'quay.io/centos/centos:stream9' +# platform: centosstream +# docker_platform: linux/amd64 +# use_sudo: true +# privileged: true +# provision_command: +# - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo +# - yum install -y puppet-agent rubygems ruby-devel +# - dnf group install -y "Development Tools" +# - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet +# +# - mkdir /home/kitchen/puppet -p +# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile +# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile +# +# - gem install bundler -v '= 2.4.13' +# # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post +# - cd /home && bundle install +# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - name: rocky-9-puppet-8 driver: From 3642387294dbf05a72559720092ced6645d82b48 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 14 Feb 2025 12:13:06 -0500 Subject: [PATCH 105/133] temporarily disable rocky 9 kitchen tests --- kitchen.yml | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/kitchen.yml b/kitchen.yml index f8652aefd..0e5fd7182 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -97,7 +97,7 @@ platforms: # TODO: validate module support for CentOS Stream -# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' +# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' # Debug: Executing: 'ps -ef' # Error: /Service[datadog-agent]: Could not evaluate: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps # Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' @@ -126,24 +126,33 @@ platforms: # - cd /home && bundle install # - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules -- name: rocky-9-puppet-8 - driver: - image: 'rockylinux:9.3' - platform: centosstream # kitchen-docker has issues installing packages otherwises - provision_command: - - dnf install -y https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo - - dnf install -y puppet-agent rubygems ruby-devel - - dnf group install -y "Development Tools" - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules +# TODO: validate module support for Rocky Linux +# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' +# Debug: Executing: 'ps -ef' +# Error: /Service[datadog-agent]: Could not evaluate: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps +# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' +# Debug: Executing: 'ps -ef' +# Error: /Service[datadog-agent]: Failed to call refresh: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps +# Error: /Service[datadog-agent]: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps +#- name: rocky-9-puppet-8 +# driver: +# image: 'rockylinux:9.3' +# platform: centosstream # kitchen-docker has issues installing packages otherwises +# provision_command: +# - dnf install -y https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo +# - dnf install -y puppet-agent rubygems ruby-devel +# - dnf group install -y "Development Tools" +# - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet +# +# - mkdir /home/kitchen/puppet +# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile +# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile +# +# - gem install bundler -v '= 2.4.13' +# +# - cd /home && bundle install +# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules # - name: opensuse/leap-15 # # Workaround for flakes on initializing opensuse/leap-15: From ba41ecfc823d7adad60ef3ce5cbc860bbc59d7ee Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 14 Feb 2025 13:40:25 -0500 Subject: [PATCH 106/133] fix ubuntu kitchen tests --- manifests/init.pp | 2 ++ templates/installer/telemetry/log.json.epp | 2 +- templates/installer/telemetry/trace.json.epp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index badd8b628..952a7673a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -395,6 +395,8 @@ $_agent_major_version = $agent_major_version } else { $_agent_major_version = $datadog_agent::params::default_agent_major_version + $_agent_minor_version = 0 + $_agent_patch_version = 0 } case $facts['os']['name'] { diff --git a/templates/installer/telemetry/log.json.epp b/templates/installer/telemetry/log.json.epp index c0dd58f88..c303a1d8e 100644 --- a/templates/installer/telemetry/log.json.epp +++ b/templates/installer/telemetry/log.json.epp @@ -6,7 +6,7 @@ "seq_id": 2, "origin": "puppet", "host": { - "hostname": "<%= $hostname %>", + "hostname": "<%= $facts['networking']['hostname'] %>", "os": "<%= $facts['os']['name'] %>", "distribution": "<%= $facts['os']['family'] %>", "architecture": "<%= $facts['os']['architecture'] %>", diff --git a/templates/installer/telemetry/trace.json.epp b/templates/installer/telemetry/trace.json.epp index bfb274a78..1c20c0588 100644 --- a/templates/installer/telemetry/trace.json.epp +++ b/templates/installer/telemetry/trace.json.epp @@ -6,7 +6,7 @@ "seq_id": 1, "origin": "puppet", "host": { - "hostname": "<%= $hostname %>", + "hostname": "<%= $facts['networking']['hostname'] %>", "os": "<%= $facts['os']['name'] %>", "distribution": "<%= $facts['os']['family'] %>", "architecture": "<%= $facts['os']['architecture'] %>", From 5e14e3c15ed762bb34a62bb5758b609b9b8b1217 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 17 Feb 2025 11:11:42 +0000 Subject: [PATCH 107/133] clean up doc as per markdown rules. add note about breaking change for disk class --- CHANGELOG.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 646d3e124..8e7653488 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,18 @@ Changes ======= + + + # 4.0.0 / 2025-02-01 +This release has multiple breaking changes, you may need to update your module integration; note that module dependencies has been updated. + * [FEATURE] Add Support for Puppet 8 ([#779]) * [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#800]) * [FEATURE] Class definitions updated with references to DataDog examples * [FEATURE] Update to CI Builds to work with Ruby 3 * [BUGFIX] Fix issue where MSI path was not correctly parsed ([#814]) +* [BUGFIX] BREAKING - `datadog_agent::integrations::disk` now expects booleans for `use_mount`, `all_partitions` and `tag_by_filesystem` * [DEPRECATE] Drop support for Puppet 6 and below * [DEPRECATE] Remove support for supply a String to the SSL_Verify option on the elasticsearch integration. We now use tls_verify which matches core DataDog code. * [DEPRECATE] Support for Jenkins integrations is removed @@ -31,6 +37,7 @@ Changes # 3.21.0 / 2023-07-03 * [FEATURE] Trust new APT and RPM keys. ([#782]) + # 3.20.0 / 2023-01-12 * [DEPRECATE] Remove the old RPM GPG key 4172A230 from hosts that still trust it, and stop trusting it. ([#770][]) @@ -76,7 +83,7 @@ Changes * [BUGFIX] Do not add process integration configuration file if not configured ([#703][]) (Thanks [@yanjunding][]) * [FEATURE] add support for `min_collection_interval` for HTTP check ([#699][]) (Thanks [@yanjunding][]) * [FEATURE] Improvements for APT keys management ([#698][], [#700][], [#701][] and [#714][]) -* [FEATURE] Include 'datadog_agent' class in the catalog when using the generic integration ([#697][]) (Thanks [@stantona][]) +* [FEATURE] Include 'datadog_agent' class in the catalog when using the generic integration ([#697][]) (Thanks [@stantona][]) * [BUGFIX] Update `excluded_interface_re` type to String ([#696][]) (Thanks [@florusboth][]) # 3.12.0 / 2021-05-06 @@ -175,9 +182,9 @@ then it is safe to upgrade. ### Notes * [MAJOR] Agent 7 support. See [#588][]. - * Introduces `agent_major_version` parameter that replaces `agent5_enable`. - * Removes `agent6`/`agent5` prefixes in argument names. - * Unifies config for Agent 5/6 repos and removes the use of facter. + * Introduces `agent_major_version` parameter that replaces `agent5_enable`. + * Removes `agent6`/`agent5` prefixes in argument names. + * Unifies config for Agent 5/6 repos and removes the use of facter. * [IMPROVEMENT] Removes uses of `validate_legacy`. * [IMPROVEMENT] Keeps the group ownership of config files as `dd-agent`. * [IMPROVEMENT] Removes `service_name` and `package_name` parameters. @@ -347,6 +354,7 @@ then it is safe to upgrade. # 2.0.0 / 2018-02-27 ### Overview + This release is a major release, there are a some breaking changes. We have tried to keep the interface as similar as possible to what the community was already used to, but have had to make some changes and cleaned up some @@ -455,7 +463,6 @@ Please read the [docs]() for more details. * [DOCUMENTATION] Cleanup EC2-related parameter docs. See [#252][] (Thanks [@jdavisp3][]) * [DOCUMENTATION] Zookeeper: fix comment to match reality. See [#297][] (Thanks [@generica][]) - # 1.9.0 / 2016-12-20 ### Notes @@ -485,8 +492,6 @@ Please read the [docs]() for more details. * [CI] Multiple fixes related to the spec tests on older puppets. * [CI] Consul: adding spec tests. See [#264][]. (Thanks [@flyinprogrammer][]). - - # 1.8.1 / 2016-08-15 ### Notes @@ -636,6 +641,7 @@ Please read the [docs]() for more details. * [FEATURE] Add `use_mount` option in the base datadog_agent class * [FEATURE] Add proxy options in the base datadog_agent class * [BUGFIX] Use correct JMX-styled tags in JMX integrations + > Careful this means that you probably have to update a buggy array of tags (that gives you nothing in the agent) to a hash of tags. * [BUGFIX] Fix ordering in YAML templates using `to_yaml` broken because of ruby 1.8 @@ -678,7 +684,6 @@ Please read the [docs]() for more details. [#164]: https://github.com/DataDog/puppet-datadog-agent/issues/164 [#168]: https://github.com/DataDog/puppet-datadog-agent/issues/168 [#169]: https://github.com/DataDog/puppet-datadog-agent/issues/169 -[#171]: https://github.com/DataDog/puppet-datadog-agent/issues/171 [#173]: https://github.com/DataDog/puppet-datadog-agent/issues/173 [#174]: https://github.com/DataDog/puppet-datadog-agent/issues/174 [#175]: https://github.com/DataDog/puppet-datadog-agent/issues/175 @@ -1078,4 +1083,4 @@ Please read the [docs]() for more details. [@yrcjaya]: https://github.com/yrcjaya [@zabacad]: https://github.com/zabacad [@zickzackv]: https://github.com/zickzackv -[@zoom-kris-anderson]: https://github.com/zoom-kris-anderson \ No newline at end of file +[@zoom-kris-anderson]: https://github.com/zoom-kris-anderson From 618647c5902877f2688b269d871a6c7d477cb1a5 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 20 Feb 2025 12:39:54 -0500 Subject: [PATCH 108/133] disable rubocop Style/HashSyntax for reporting events --- lib/puppet/reports/datadog_reports.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/reports/datadog_reports.rb b/lib/puppet/reports/datadog_reports.rb index df29af71a..86ffde7f4 100644 --- a/lib/puppet/reports/datadog_reports.rb +++ b/lib/puppet/reports/datadog_reports.rb @@ -147,7 +147,7 @@ def process msg_title: event_title, event_type: 'config_management.run', event_object: @msg_host, - alert_type:, + alert_type: alert_type, # rubocop:disable Style/HashSyntax priority: event_priority, source_type_name: 'puppet', tags: dog_tags), From b9270cf052a023654332f00655f30a71f27a738b Mon Sep 17 00:00:00 2001 From: Niels Tholenaar Date: Fri, 21 Feb 2025 12:57:44 +0100 Subject: [PATCH 109/133] fix: Corrected type of service_enable param --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index b124f2f8a..15d3d965f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -292,7 +292,7 @@ String $log_level = 'info', Boolean $log_to_syslog = true, String $service_ensure = 'running', - Boolean $service_enable = true, + Variant[Boolean, Enum['manual', 'mask', 'delayed']] $service_enable = true, Boolean $manage_repo = true, Boolean $manage_dogapi_gem = true, Boolean $manage_install = true, From f5d77696360177a931209a75f07848b0f3184fcc Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Mon, 24 Feb 2025 09:35:38 +0000 Subject: [PATCH 110/133] update to release notes --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e7653488..f3cc5f2fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,12 @@ Changes -# 4.0.0 / 2025-02-01 +# 4.0.0 / 2025-02-24 This release has multiple breaking changes, you may need to update your module integration; note that module dependencies has been updated. +This release brings support for Puppet 8, which means all classes are now using defined class parameters types; this could break existing implementations. + * [FEATURE] Add Support for Puppet 8 ([#779]) * [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#800]) * [FEATURE] Class definitions updated with references to DataDog examples @@ -19,6 +21,7 @@ This release has multiple breaking changes, you may need to update your module i * [DEPRECATE] No longer possible to use the custom metrics parameter when using the PostgresSQL class * [DEPRECATE] `ganglia` configuration no longer supported as per DataDog Agent v6+ * [DEPRECATE] `skip_event` setting on TCP Check class has been removed from DataDog integration +* [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests # 3.23.0 / 2024-12-09 From 3feaf5ac246f0ce66ef2cd39a2071a84b75d4ca4 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 4 Mar 2025 10:51:46 -0500 Subject: [PATCH 111/133] fix kitchen tests --- kitchen.yml | 349 +++++++++++++++++++++++++--------------------------- 1 file changed, 165 insertions(+), 184 deletions(-) diff --git a/kitchen.yml b/kitchen.yml index 0e5fd7182..89ba9ccc4 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -14,194 +14,175 @@ provisioner: custom_pre_apply_command: 'cp -r /tmp/modules/* /tmp/kitchen/modules/' platforms: -- name: ubuntu-24.04-puppet-8 - driver: - image: 'ubuntu:24.04' - provision_command: - - apt-get install -y apt-utils apt-transport-https ca-certificates - - wget https://apt.puppet.com/puppet8-release-noble.deb - - dpkg -i puppet8-release-noble.deb #installs the puppet-agent repo - - apt-get update - - apt-get install -y puppet-agent rubygems ruby-dev make gcc - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - -- name: ubuntu-22.04-puppet-8 - driver: - image: 'ubuntu:22.04' - provision_command: - - apt-get update - - apt-get install -y apt-utils apt-transport-https ca-certificates wget - - wget https://apt.puppet.com/puppet8-release-jammy.deb - - dpkg -i puppet8-release-jammy.deb #installs the puppet-agent repo - - apt-get update - - apt-get install -y puppet-agent rubygems ruby-dev make gcc - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet -p - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - -- name: ubuntu-20.04-puppet-8 - driver: - image: 'ubuntu:20.04' - docker_platform: linux/amd64 - provision_command: - - apt-get install -y apt-utils apt-transport-https ca-certificates make gcc - - wget https://apt.puppet.com/puppet8-release-focal.deb - - dpkg -i puppet8-release-focal.deb #installs the puppet-agent repo - - apt-get update - - apt-get install -y puppet-agent rubygems ruby-dev - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - -# mirrorlist.centos.org is no longer available for <= centos8/centos-stream8 -# - name: centos-stream8-puppet-8 -# driver_config: -# image: 'quay.io/centos/centos:stream9' -# platform: centosstream -# driver: -# use_sudo: true -# privileged: true -# provision_command: -# - rpm -Uvh https://yum.puppet.com/puppet8-release-el-8.noarch.rpm #installs the puppet-agent repo -# - yum install -y puppet-agent rubygems ruby-devel make gcc -# - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - -# - mkdir /home/kitchen/puppet -p -# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile -# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - -# - gem install bundler -v '= 2.4.13' -# # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post -# - cd /home && bundle install -# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - - -# TODO: validate module support for CentOS Stream -# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' -# Debug: Executing: 'ps -ef' -# Error: /Service[datadog-agent]: Could not evaluate: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps -# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' -# Debug: Executing: 'ps -ef' -# Error: /Service[datadog-agent]: Failed to call refresh: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps -# Error: /Service[datadog-agent]: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps -#- name: centos-stream9-puppet-8 -# driver: -# image: 'quay.io/centos/centos:stream9' -# platform: centosstream + - name: ubuntu-24.04-puppet-8 + driver: + image: 'ubuntu:24.04' + provision_command: + - apt-get install -y apt-utils apt-transport-https ca-certificates + - wget https://apt.puppet.com/puppet8-release-noble.deb + - dpkg -i puppet8-release-noble.deb #installs the puppet-agent repo + - apt-get update + - apt-get install -y puppet-agent rubygems ruby-dev make gcc + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + + - name: ubuntu-22.04-puppet-8 + driver: + image: 'ubuntu:22.04' + provision_command: + - apt-get update + - apt-get install -y apt-utils apt-transport-https ca-certificates wget + - wget https://apt.puppet.com/puppet8-release-jammy.deb + - dpkg -i puppet8-release-jammy.deb #installs the puppet-agent repo + - apt-get update + - apt-get install -y puppet-agent rubygems ruby-dev make gcc + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet -p + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + + - name: ubuntu-20.04-puppet-7 + driver: + image: 'ubuntu:20.04' + docker_platform: linux/amd64 + provision_command: + - apt-get install -y apt-utils apt-transport-https ca-certificates make gcc + - wget https://apt.puppet.com/puppet7-release-focal.deb + - dpkg -i puppet7-release-focal.deb #installs the puppet-agent repo + - apt-get update + - apt-get install -y puppet-agent rubygems ruby-dev + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + + - name: centos-stream9-puppet-8 + driver: + image: 'datadog/docker-library:chef_kitchen_systemd_centos_9' + platform: centosstream + docker_platform: linux/amd64 + privileged: true + run_options: --cgroupns=host --tmpfs=/run --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw + publish_all: true + run_command: /root/start.sh + provision_command: + - dnf module -y reset ruby + - dnf module -y enable ruby:3.1 + - dnf module -y install ruby:3.1/common + + - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo + - yum install -y puppet-agent-8.10.0 rubygems ruby-devel procps-ng + - dnf group install -y "Development Tools" + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet -p + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + + - name: rocky-9-puppet-8 + driver: + image: 'fannyatdd/docker-rocky9-systemd:test-9' + platform: rhel # kitchen-docker has issues installing packages otherwises + docker_platform: linux/amd64 + privileged: true + use_cache: false + run_options: --cgroupns=host --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw + run_command: /root/start.sh + provision_command: + - dnf module -y reset ruby + - dnf module -y enable ruby:3.1 + - dnf module -y install ruby:3.1/common + + - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo + - yum install -y puppet-agent-8.10.0 rubygems ruby-devel procps-ng + - dnf group install -y "Development Tools" + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet -p + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +#- name: opensuse/leap-15 +# # Workaround for flakes on initializing opensuse/leap-15: +# # => SCP did not finish successfully (255): (Net::SCP::Error) +# transport: +# max_ssh_sessions: 1 +# driver_config: +# # we use a custom image that runs systemd +# image: 'datadog/docker-library:chef_kitchen_systemd_opensuse_leap_15' # docker_platform: linux/amd64 -# use_sudo: true -# privileged: true -# provision_command: -# - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo -# - yum install -y puppet-agent rubygems ruby-devel -# - dnf group install -y "Development Tools" -# - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet -# -# - mkdir /home/kitchen/puppet -p -# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile -# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile -# -# - gem install bundler -v '= 2.4.13' -# # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post -# - cd /home && bundle install -# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - - -# TODO: validate module support for Rocky Linux -# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' -# Debug: Executing: 'ps -ef' -# Error: /Service[datadog-agent]: Could not evaluate: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps -# Debug: Service[datadog-agent](provider=base): Executing 'ps -ef' -# Debug: Executing: 'ps -ef' -# Error: /Service[datadog-agent]: Failed to call refresh: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps -# Error: /Service[datadog-agent]: Execution of 'ps -ef' returned 1: Error: Could not execute posix command: No such file or directory - ps -#- name: rocky-9-puppet-8 +# run_command: /root/start.sh # driver: -# image: 'rockylinux:9.3' -# platform: centosstream # kitchen-docker has issues installing packages otherwises # provision_command: -# - dnf install -y https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo -# - dnf install -y puppet-agent rubygems ruby-devel -# - dnf group install -y "Development Tools" -# - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet -# -# - mkdir /home/kitchen/puppet -# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile -# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile +# - zypper ar -G https://yum.puppet.com/puppet/sles/15/x86_64/ puppet-repo +# - zypper refresh +# - zypper install -y puppet-agent +# - export PATH="/opt/puppetlabs/puppet/bin:$PATH" +# - ruby -v +# - puppet --version # -# - gem install bundler -v '= 2.4.13' +# - gem install bundler -v '= 1.17.3' +# - gem install net-ssh -v '= 6.1.0' +# - gem install rspec-its -v '= 1.3.1' +# - gem install serverspec rspec +# - ln -s /usr/bin/rspec.ruby2.7 /usr/bin/rspec +# - ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet +# - mkdir /home/kitchen/puppet +# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile +# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile # -# - cd /home && bundle install -# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - -# - name: opensuse/leap-15 -# # Workaround for flakes on initializing opensuse/leap-15: -# # => SCP did not finish successfully (255): (Net::SCP::Error) -# transport: -# max_ssh_sessions: 1 -# driver_config: -# # we use a custom image that runs systemd -# image: 'datadog/docker-library:chef_kitchen_systemd_opensuse_leap_15' -# run_command: /root/start.sh -# driver: -# 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 -v '= 1.17.3' -# - gem install net-ssh -v '= 6.1.0' -# - gem install rspec-its -v '= 1.3.1' -# - 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 -# - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile -# - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - -# - cd /home && bundle.ruby2.5 install -# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules +# - cd /home && bundle.ruby2.7 install +# - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules suites: -- name: dd-agent - manifests: init.pp - verifier: - name: serverspec - default_pattern: true - additional_install_commmand: source /etc/profile.d/rvm.sh - env_vars: - TARGET_HOST: 127.0.0.1 - TARGET_PORT: 2222 - LOGIN_USER: root - LOGIN_PASSWORD: puppet -- name: dd-installer - manifests: init.pp - provisioner: - manifests_path: environments/etc/installer-manifests - verifier: - name: serverspec - default_pattern: true - additional_install_commmand: source /etc/profile.d/rvm.sh - env_vars: - TARGET_HOST: 127.0.0.1 - TARGET_PORT: 2222 - LOGIN_USER: root - LOGIN_PASSWORD: puppet + - name: dd-agent + manifests: init.pp + verifier: + name: serverspec + default_pattern: true + additional_install_commmand: source /etc/profile.d/rvm.sh + env_vars: + TARGET_HOST: 127.0.0.1 + TARGET_PORT: 2222 + LOGIN_USER: root + LOGIN_PASSWORD: puppet + - name: dd-installer + manifests: init.pp + provisioner: + manifests_path: environments/etc/installer-manifests + verifier: + name: serverspec + default_pattern: true + additional_install_commmand: source /etc/profile.d/rvm.sh + env_vars: + TARGET_HOST: 127.0.0.1 + TARGET_PORT: 2222 + LOGIN_USER: root + LOGIN_PASSWORD: puppet From b35bc88ebaa4f7657e887965b441c782da95f6df Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 4 Mar 2025 15:51:47 -0500 Subject: [PATCH 112/133] clean up integrations manifests --- Gemfile.lock | 76 ++++++++++----------- manifests/integrations/activemq_xml.pp | 42 +++++------- manifests/integrations/apache.pp | 26 +++---- manifests/integrations/cacti.pp | 26 +++---- manifests/integrations/cassandra.pp | 26 +++---- manifests/integrations/ceph.pp | 26 +++---- manifests/integrations/consul.pp | 26 +++---- manifests/integrations/directory.pp | 26 +++---- manifests/integrations/disk.pp | 26 +++---- manifests/integrations/dns_check.pp | 26 +++---- manifests/integrations/docker_daemon.pp | 42 +++--------- manifests/integrations/elasticsearch.pp | 52 ++++++-------- manifests/integrations/fluentd.pp | 26 +++---- manifests/integrations/generic.pp | 26 +++---- manifests/integrations/haproxy.pp | 32 ++++----- manifests/integrations/http_check.pp | 34 ++++----- manifests/integrations/jmx.pp | 26 +++---- manifests/integrations/kafka.pp | 66 ++++++++---------- manifests/integrations/kong.pp | 28 +++----- manifests/integrations/kubernetes.pp | 34 ++++----- manifests/integrations/kubernetes_state.pp | 26 +++---- manifests/integrations/linux_proc_extras.pp | 26 +++---- manifests/integrations/marathon.pp | 28 +++----- manifests/integrations/memcache.pp | 26 +++---- manifests/integrations/mesos_master.pp | 50 ++++++-------- manifests/integrations/mesos_slave.pp | 28 +++----- manifests/integrations/mongo.pp | 26 +++---- manifests/integrations/mysql.pp | 60 +++++++--------- manifests/integrations/network.pp | 26 +++---- manifests/integrations/nginx.pp | 28 +++----- manifests/integrations/ntp.pp | 36 ++++------ manifests/integrations/pgbouncer.pp | 30 +++----- manifests/integrations/php_fpm.pp | 50 ++++++-------- manifests/integrations/postfix.pp | 32 ++++----- manifests/integrations/postgres.pp | 52 ++++---------- manifests/integrations/process.pp | 38 +++++------ manifests/integrations/rabbitmq.pp | 50 ++++++-------- manifests/integrations/redis.pp | 50 +++----------- manifests/integrations/riak.pp | 30 +++----- manifests/integrations/snmp.pp | 26 +++---- manifests/integrations/solr.pp | 26 +++---- manifests/integrations/ssh.pp | 40 +++++------ manifests/integrations/supervisord.pp | 28 +++----- manifests/integrations/system_core.pp | 26 +++---- manifests/integrations/tcp_check.pp | 26 +++---- manifests/integrations/tomcat.pp | 26 +++---- manifests/integrations/twemproxy.pp | 26 +++---- manifests/integrations/varnish.pp | 26 +++---- manifests/integrations/zk.pp | 26 +++---- 49 files changed, 605 insertions(+), 1055 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2f2b16950..852c1e666 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,22 +8,22 @@ GEM ansi (1.5.0) ast (2.4.2) awesome_print (1.9.2) - aws-eventstream (1.3.0) - aws-partitions (1.1027.0) - aws-sdk-core (3.214.0) + aws-eventstream (1.3.1) + aws-partitions (1.1054.0) + aws-sdk-core (3.219.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) + base64 jmespath (~> 1, >= 1.6.1) - aws-sdk-ec2 (1.498.0) - aws-sdk-core (~> 3, >= 3.210.0) + aws-sdk-ec2 (1.506.0) + aws-sdk-core (~> 3, >= 3.216.0) aws-sigv4 (~> 1.5) - aws-sigv4 (1.10.1) + aws-sigv4 (1.11.0) aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcrypt_pbkdf (1.0.1) - bcrypt_pbkdf (1.0.1-x64-mingw32) - bigdecimal (3.1.8) + bigdecimal (3.1.9) bindata (2.5.0) bolt (4.0.0) CFPropertyList (>= 2.2) @@ -53,8 +53,8 @@ GEM concurrent-ruby coderay (1.1.3) colored2 (3.1.2) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) cri (2.15.12) deep_merge (1.2.2) dependency_checker (1.0.1) @@ -62,7 +62,7 @@ GEM puppet_forge (>= 2.2, < 6.0) rake (~> 13.0) semantic_puppet (~> 1.0) - diff-lcs (1.5.1) + diff-lcs (1.6.0) docile (1.4.1) docker-api (2.4.0) excon (>= 0.64.0) @@ -70,7 +70,7 @@ GEM domain_name (0.6.20240107) ed25519 (1.3.0) erubi (1.13.1) - excon (1.2.2) + excon (1.2.3) facter (4.10.0) hocon (~> 1.3) thor (>= 1.0.1, < 1.3) @@ -90,10 +90,11 @@ GEM net-http-persistent (>= 4.0.4, < 5) fast_gettext (2.4.0) prime - ffi (1.16.3) + ffi (1.17.1) + ffi (1.17.1-arm64-darwin) forwardable (1.3.3) getoptlong (0.2.1) - gettext (3.5.0) + gettext (3.5.1) erubi locale (>= 2.0.5) prime @@ -111,7 +112,7 @@ GEM hiera-eyaml (3.4.0) highline optimist - highline (3.1.1) + highline (3.1.2) reline hocon (1.4.0) http-accept (1.7.0) @@ -125,7 +126,7 @@ GEM json-schema (5.1.1) addressable (~> 2.8) bigdecimal (~> 3.1) - jwt (2.9.3) + jwt (2.10.1) base64 kitchen-docker (3.0.0) test-kitchen (>= 1.0.0) @@ -150,11 +151,11 @@ GEM little-plugger (1.1.4) locale (2.1.4) log4r (1.1.10) - logger (1.6.4) + logger (1.6.6) logging (2.4.0) little-plugger (~> 1.1) multi_json (~> 1.14) - metadata-json-lint (4.1.0) + metadata-json-lint (4.2.0) json-schema (>= 2.8, < 6.0) semantic_puppet (~> 1.0) spdx-licenses (~> 1.0) @@ -162,7 +163,7 @@ GEM mime-types (3.6.0) logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.1203) + mime-types-data (3.2025.0220) minitar (0.12.1) mixlib-install (3.12.30) mixlib-shellout @@ -178,7 +179,7 @@ GEM uri net-http-persistent (4.0.5) connection_pool (~> 2.2) - net-scp (4.0.0) + net-scp (4.1.0) net-ssh (>= 2.6.5, < 8.0.0) net-ssh (7.3.0) net-ssh-gateway (2.0.0) @@ -197,7 +198,7 @@ GEM parallel (1.26.3) parallel_tests (3.12.1) parallel - parser (3.3.6.0) + parser (3.3.7.1) ast (~> 2.4.1) racc pastel (0.8.0) @@ -207,12 +208,11 @@ GEM prime (0.1.3) forwardable singleton - pry (0.15.0) + pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) public_suffix (6.0.1) - puppet (8.10.0-universal-darwin) - CFPropertyList (>= 3.0.6, < 4) + puppet (8.10.0) concurrent-ruby (~> 1.0) deep_merge (~> 1.0) facter (>= 4.3.0, < 5) @@ -223,15 +223,14 @@ GEM puppet-resource_api (~> 1.5) scanf (~> 1.0) semantic_puppet (~> 1.0) - puppet (8.10.0-x64-mingw32) + puppet (8.10.0-universal-darwin) + CFPropertyList (>= 3.0.6, < 4) concurrent-ruby (~> 1.0) deep_merge (~> 1.0) facter (>= 4.3.0, < 5) fast_gettext (>= 2.1, < 4) - ffi (>= 1.15.5, < 1.17.0, != 1.16.2, != 1.16.1, != 1.16.0) getoptlong (~> 0.2.0) locale (~> 2.1) - minitar (~> 0.9) multi_json (~> 1.13) puppet-resource_api (~> 1.5) scanf (~> 1.0) @@ -330,7 +329,7 @@ GEM rainbow (3.1.1) rake (13.2.1) rb-readline (0.5.5) - regexp_parser (2.9.3) + regexp_parser (2.10.0) reline (0.6.0) io-console (~> 0.5) rest-client (2.1.0) @@ -338,20 +337,14 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rest-client (2.1.0-x64-mingw32) - ffi (~> 1.9) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) retryable (3.0.5) - rexml (3.4.0) - rgen (0.9.1) + rexml (3.4.1) + rgen (0.10.2) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.2) + rspec-core (3.13.3) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) @@ -383,7 +376,7 @@ GEM rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.37.0) + rubocop-ast (1.38.0) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) @@ -401,9 +394,9 @@ GEM windows_error rubyntlm (0.6.5) base64 - rubyzip (2.3.2) + rubyzip (2.4.1) scanf (1.0.0) - semantic_puppet (1.1.0) + semantic_puppet (1.1.1) serverspec (2.42.3) multi_json rspec (~> 3.0) @@ -414,7 +407,7 @@ GEM docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-console (0.9.2) + simplecov-console (0.9.3) ansi simplecov terminal-table @@ -518,6 +511,7 @@ GEM yard (0.9.36) PLATFORMS + arm64-darwin-22 arm64-darwin-24 x64-mingw32 diff --git a/manifests/integrations/activemq_xml.pp b/manifests/integrations/activemq_xml.pp index 7dc33c08b..8debb24eb 100644 --- a/manifests/integrations/activemq_xml.pp +++ b/manifests/integrations/activemq_xml.pp @@ -52,36 +52,28 @@ # # class datadog_agent::integrations::activemq_xml ( - String $url = 'http://localhost:8161', - Boolean $supress_errors = false, - Optional[String] $username = undef, - Optional[String] $password = undef, - Array[String] $detailed_queues = [], - Array[String] $detailed_topics = [], - Array[String] $detailed_subscribers = [], - Optional[Array] $instances = undef, + String $url = 'http://localhost:8161', + Boolean $supress_errors = false, + Optional[String] $username = undef, + Optional[String] $password = undef, + Array[String] $detailed_queues = [], + Array[String] $detailed_topics = [], + Array[String] $detailed_subscribers = [], + Optional[Array] $instances = undef, ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/activemq_xml.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/activemq_xml.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/activemq_xml.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" if !$instances and $url { $_instances = [{ diff --git a/manifests/integrations/apache.pp b/manifests/integrations/apache.pp index 0a7863f5a..8dd48f8d2 100644 --- a/manifests/integrations/apache.pp +++ b/manifests/integrations/apache.pp @@ -38,25 +38,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/apache.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/apache.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/apache.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/cacti.pp b/manifests/integrations/cacti.pp index 83ff46bb8..1a6f20308 100644 --- a/manifests/integrations/cacti.pp +++ b/manifests/integrations/cacti.pp @@ -23,25 +23,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/cacti.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/cacti.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/cacti.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/cassandra.pp b/manifests/integrations/cassandra.pp index 7a7977738..7a6ad9d6d 100644 --- a/manifests/integrations/cassandra.pp +++ b/manifests/integrations/cassandra.pp @@ -44,25 +44,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/cassandra.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/cassandra.d" + $dst_dir = "${datadog_agent::params::conf_dir}/cassandra.d" - file { $legacy_dst: - ensure => 'absent', - } - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/ceph.pp b/manifests/integrations/ceph.pp index be4316695..afe30bfc6 100644 --- a/manifests/integrations/ceph.pp +++ b/manifests/integrations/ceph.pp @@ -26,25 +26,17 @@ content => "# This file is required for dd ceph \ndd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph\n", } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ceph.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/ceph.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/ceph.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/consul.pp b/manifests/integrations/consul.pp index 543146663..bd12020a7 100644 --- a/manifests/integrations/consul.pp +++ b/manifests/integrations/consul.pp @@ -38,25 +38,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/consul.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/consul.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/consul.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/directory.pp b/manifests/integrations/directory.pp index 70f989ae9..f240614e4 100644 --- a/manifests/integrations/directory.pp +++ b/manifests/integrations/directory.pp @@ -90,25 +90,17 @@ $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/directory.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/directory.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/directory.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/disk.pp b/manifests/integrations/disk.pp index 715a7f960..ff39b8206 100644 --- a/manifests/integrations/disk.pp +++ b/manifests/integrations/disk.pp @@ -85,25 +85,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/disk.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/disk.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/disk.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/dns_check.pp b/manifests/integrations/dns_check.pp index 5bbc3b855..3ee9f7a33 100644 --- a/manifests/integrations/dns_check.pp +++ b/manifests/integrations/dns_check.pp @@ -38,25 +38,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/dns_check.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/dns_check.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/dns_check.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/docker_daemon.pp b/manifests/integrations/docker_daemon.pp index cdd65e2c2..6de9affaa 100644 --- a/manifests/integrations/docker_daemon.pp +++ b/manifests/integrations/docker_daemon.pp @@ -67,41 +67,17 @@ notify => Service[$datadog_agent::params::service_name], } - if $datadog_agent::_agent_major_version > 5 { - $legacy_dir = "${datadog_agent::params::conf_dir}/docker_daemon.d" + $dst_dir = "${datadog_agent::params::conf_dir}/docker.d" - file { $legacy_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $legacy_conf = "${legacy_dir}/conf.yaml" - } else { - $legacy_conf = "${datadog_agent::params::legacy_conf_dir}/docker.yaml" - } - - file { $legacy_conf: - ensure => 'absent', - } - - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/docker.d" - - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = "${datadog_agent::params::legacy_conf_dir}/docker_daemon.yaml" + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/elasticsearch.pp b/manifests/integrations/elasticsearch.pp index 28c384eca..866dcb36e 100644 --- a/manifests/integrations/elasticsearch.pp +++ b/manifests/integrations/elasticsearch.pp @@ -27,19 +27,19 @@ # } # class datadog_agent::integrations::elasticsearch ( - Boolean $cluster_stats = false, - Boolean $index_stats = false, - Optional[String] $password = undef, - Boolean$pending_task_stats = true, - Boolean $pshard_stats = false, - Optional[String] $ssl_cert = undef, - Optional[String] $ssl_key = undef, - Boolean $ssl_verify = true, #kept for backwards compatibility - Boolean $tls_verify = $ssl_verify, - Array $tags = [], - String $url = 'http://localhost:9200', - Optional[String] $username = undef, - Optional[Array] $instances = undef + Boolean $cluster_stats = false, + Boolean $index_stats = false, + Optional[String] $password = undef, + Boolean$pending_task_stats = true, + Boolean $pshard_stats = false, + Optional[String] $ssl_cert = undef, + Optional[String] $ssl_key = undef, + Boolean $ssl_verify = true, #kept for backwards compatibility + Boolean $tls_verify = $ssl_verify, + Array $tags = [], + String $url = 'http://localhost:9200', + Optional[String] $username = undef, + Optional[Array] $instances = undef ) inherits datadog_agent::params { require datadog_agent @@ -63,25 +63,17 @@ $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/elastic.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/elastic.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/elastic.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/fluentd.pp b/manifests/integrations/fluentd.pp index c39471ff7..96e99c669 100644 --- a/manifests/integrations/fluentd.pp +++ b/manifests/integrations/fluentd.pp @@ -26,25 +26,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/fluentd.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/fluentd.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/fluentd.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/generic.pp b/manifests/integrations/generic.pp index 754ae7185..265a0ea34 100644 --- a/manifests/integrations/generic.pp +++ b/manifests/integrations/generic.pp @@ -23,25 +23,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/${integration_name}.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/${integration_name}.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/${integration_name}.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/haproxy.pp b/manifests/integrations/haproxy.pp index b12891c1b..d4a32fec6 100644 --- a/manifests/integrations/haproxy.pp +++ b/manifests/integrations/haproxy.pp @@ -20,9 +20,9 @@ # } # class datadog_agent::integrations::haproxy ( - Hash $creds = {}, - String $url = "http://${facts['networking']['ip']}:8080", - Hash $options = {}, + Hash $creds = {}, + String $url = "http://${facts['networking']['ip']}:8080", + Hash $options = {}, Optional[Array] $instances = undef ) inherits datadog_agent::params { require datadog_agent @@ -39,25 +39,17 @@ $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/haproxy.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/haproxy.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/haproxy.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index 539eba8e3..ba1f247d6 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -7,10 +7,10 @@ # # Parameters: # sitename -# The name of the instance. +# (Required) The name of the instance. # # url -# The url to check. +# (Required) The url to check. # # timeout # The (optional) timeout in seconds. @@ -170,8 +170,8 @@ # }] # } class datadog_agent::integrations::http_check ( - Optional[String] $sitename = undef, - Optional[String] $url = undef, + String $sitename, + String $url, Optional[String] $username = undef, Optional[Any] $password = undef, Integer $timeout = 1, @@ -241,25 +241,17 @@ $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/http_check.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/http_check.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/http_check.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/jmx.pp b/manifests/integrations/jmx.pp index 997602962..2cfe4d505 100644 --- a/manifests/integrations/jmx.pp +++ b/manifests/integrations/jmx.pp @@ -70,25 +70,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/jmx.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/jmx.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/jmx.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/kafka.pp b/manifests/integrations/kafka.pp index 8a5f6521d..01e2105d1 100644 --- a/manifests/integrations/kafka.pp +++ b/manifests/integrations/kafka.pp @@ -62,32 +62,32 @@ # } # class datadog_agent::integrations::kafka ( - String $host = 'localhost', - Variant[String[1], Integer] $port = 9999, - Optional[String[1]] $username = undef, - Optional[String[1]] $password = undef, - Optional[String[1]] $process_name_regex = undef, - Optional[String[1]] $tools_jar_path = undef, - Optional[String[1]] $java_bin_path = undef, - Optional[String[1]] $trust_store_path = undef, - Optional[String[1]] $trust_store_password = undef, - Optional[Hash[String[1], String[1]]] $tags = undef, + String $host = 'localhost', + Variant[String[1], Integer] $port = 9999, + Optional[String[1]] $username = undef, + Optional[String[1]] $password = undef, + Optional[String[1]] $process_name_regex = undef, + Optional[String[1]] $tools_jar_path = undef, + Optional[String[1]] $java_bin_path = undef, + Optional[String[1]] $trust_store_path = undef, + Optional[String[1]] $trust_store_password = undef, + Optional[Hash[String[1], String[1]]] $tags = undef, Optional[Array[Hash[String[1], Data]]] $instances = undef, ) inherits datadog_agent::params { require datadog_agent if !$instances and $host and $port { $servers = [{ - 'host' => $host, - 'port' => $port, - 'username' => $username, - 'password' => $password, - 'process_name_regex' => $process_name_regex, - 'tools_jar_path' => $tools_jar_path, - 'java_bin_path' => $java_bin_path, - 'trust_store_path' => $trust_store_path, - 'trust_store_password' => $trust_store_password, - 'tags' => $tags, + 'host' => $host, + 'port' => $port, + 'username' => $username, + 'password' => $password, + 'process_name_regex' => $process_name_regex, + 'tools_jar_path' => $tools_jar_path, + 'java_bin_path' => $java_bin_path, + 'trust_store_path' => $trust_store_path, + 'trust_store_password' => $trust_store_password, + 'tags' => $tags, }] } elsif !$instances { $servers = [] @@ -95,25 +95,17 @@ $servers = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kafka.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/kafka.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/kafka.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/kong.pp b/manifests/integrations/kong.pp index 34d309aac..13aaa4884 100644 --- a/manifests/integrations/kong.pp +++ b/manifests/integrations/kong.pp @@ -31,31 +31,23 @@ Array $instances = [ { 'status_url' => 'http://localhost:8001/status/', - 'tags' => [] + 'tags' => [] } ] ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kong.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/kong.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/kong.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/kubernetes.pp b/manifests/integrations/kubernetes.pp index 04ad849e9..8d04767cb 100644 --- a/manifests/integrations/kubernetes.pp +++ b/manifests/integrations/kubernetes.pp @@ -25,35 +25,27 @@ # } # class datadog_agent::integrations::kubernetes ( - String $api_server_url = 'Enter_Your_API_url', + String $api_server_url = 'Enter_Your_API_url', String $apiserver_client_crt = '/path/to/crt', String $apiserver_client_key = '/path/to/key', - String $kubelet_client_crt = '/path/to/crt', - String $kubelet_client_key = '/path/to/key', - Array $tags = [], + String $kubelet_client_crt = '/path/to/crt', + String $kubelet_client_key = '/path/to/key', + Array $tags = [], ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kubernetes.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/kubernetes.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/kubernetes.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/kubernetes_state.pp b/manifests/integrations/kubernetes_state.pp index e8e1e59f3..11910e961 100644 --- a/manifests/integrations/kubernetes_state.pp +++ b/manifests/integrations/kubernetes_state.pp @@ -27,25 +27,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/kubernetes_state.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/kubernetes_state.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/kubernetes_state.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/linux_proc_extras.pp b/manifests/integrations/linux_proc_extras.pp index 837897a14..92dd6c71d 100644 --- a/manifests/integrations/linux_proc_extras.pp +++ b/manifests/integrations/linux_proc_extras.pp @@ -20,25 +20,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/linux_proc_extras.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/linux_proc_extras.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/linux_proc_extras.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/marathon.pp b/manifests/integrations/marathon.pp index 8b2c29455..9f106a7d0 100644 --- a/manifests/integrations/marathon.pp +++ b/manifests/integrations/marathon.pp @@ -17,29 +17,21 @@ # class datadog_agent::integrations::marathon ( Integer $marathon_timeout = 5, - String $url = 'http://localhost:8080' + String $url = 'http://localhost:8080' ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/marathon.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/marathon.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/marathon.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/memcache.pp b/manifests/integrations/memcache.pp index 13ad9d1e9..d433eb1cb 100644 --- a/manifests/integrations/memcache.pp +++ b/manifests/integrations/memcache.pp @@ -57,25 +57,17 @@ $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mcache.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/mcache.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/mcache.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/mesos_master.pp b/manifests/integrations/mesos_master.pp index 7692f0715..fc6772e3d 100644 --- a/manifests/integrations/mesos_master.pp +++ b/manifests/integrations/mesos_master.pp @@ -17,49 +17,37 @@ # class datadog_agent::integrations::mesos_master ( Integer $mesos_timeout = 10, - String $url = 'http://localhost:5050' + String $url = 'http://localhost:5050' ) inherits datadog_agent::params { require datadog_agent - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/mesos.d" + $dst_dir = "${datadog_agent::params::conf_dir}/mesos.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = "${datadog_agent::params::legacy_conf_dir}/mesos.yaml" + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => 'absent', } - $legacy_dst_master = "${datadog_agent::params::legacy_conf_dir}/mesos_master.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_master_dir = "${datadog_agent::params::conf_dir}/mesos_master.d" - file { $legacy_dst_master: - ensure => 'absent', - } + $dst_master_dir = "${datadog_agent::params::conf_dir}/mesos_master.d" - file { $dst_master_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst_master = "${dst_master_dir}/conf.yaml" - } else { - $dst_master = $legacy_dst_master + file { $dst_master_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst_master = "${dst_master_dir}/conf.yaml" file { $dst_master: ensure => file, diff --git a/manifests/integrations/mesos_slave.pp b/manifests/integrations/mesos_slave.pp index 8ff388b44..3d8238cb0 100644 --- a/manifests/integrations/mesos_slave.pp +++ b/manifests/integrations/mesos_slave.pp @@ -17,27 +17,19 @@ # class datadog_agent::integrations::mesos_slave ( Integer $mesos_timeout = 10, - String $url = 'http://localhost:5051' + String $url = 'http://localhost:5051' ) inherits datadog_agent::params { - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mesos_slave.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/mesos_slave.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/mesos_slave.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/mongo.pp b/manifests/integrations/mongo.pp index a71e80184..c29a12e23 100644 --- a/manifests/integrations/mongo.pp +++ b/manifests/integrations/mongo.pp @@ -101,25 +101,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mongo.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/mongo.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/mongo.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/mysql.pp b/manifests/integrations/mysql.pp index 5947e0009..0931c6443 100644 --- a/manifests/integrations/mysql.pp +++ b/manifests/integrations/mysql.pp @@ -70,23 +70,23 @@ # # class datadog_agent::integrations::mysql ( - String $host = 'localhost', - String $user = 'datadog', - Variant[String, Integer] $port = 3306, - Optional[String] $password = undef, - Optional[String] $sock = undef, - Array $tags = [], - String $replication = '0', - String $galera_cluster = '0', - Boolean $extra_status_metrics = false, - Boolean $extra_innodb_metrics = false, - Boolean $extra_performance_metrics = false, - Boolean $schema_size_metrics = false, - Boolean $disable_innodb_metrics = false, - Optional[Boolean] $dbm = undef, - Array $queries = [], - Optional[Array] $instances = undef, - Array $logs = [], + String $host = 'localhost', + String $user = 'datadog', + Variant[String, Integer] $port = 3306, + Optional[String] $password = undef, + Optional[String] $sock = undef, + Array $tags = [], + String $replication = '0', + String $galera_cluster = '0', + Boolean $extra_status_metrics = false, + Boolean $extra_innodb_metrics = false, + Boolean $extra_performance_metrics = false, + Boolean $schema_size_metrics = false, + Boolean $disable_innodb_metrics = false, + Optional[Boolean] $dbm = undef, + Array $queries = [], + Optional[Array] $instances = undef, + Array $logs = [], ) inherits datadog_agent::params { require datadog_agent @@ -119,25 +119,17 @@ $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mysql.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/mysql.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/mysql.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/network.pp b/manifests/integrations/network.pp index d26a57e22..f42c2d296 100644 --- a/manifests/integrations/network.pp +++ b/manifests/integrations/network.pp @@ -44,25 +44,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/network.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/network.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/network.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/nginx.pp b/manifests/integrations/nginx.pp index 9d52fb32b..7e16a3952 100644 --- a/manifests/integrations/nginx.pp +++ b/manifests/integrations/nginx.pp @@ -62,30 +62,22 @@ # sourcecategory: 'http_web_access' # class datadog_agent::integrations::nginx ( - Array $instances = [], + Array $instances = [], Optional[Array] $logs = undef, ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/nginx.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/nginx.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/nginx.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/ntp.pp b/manifests/integrations/ntp.pp index 61cee0331..3d533c5c5 100644 --- a/manifests/integrations/ntp.pp +++ b/manifests/integrations/ntp.pp @@ -26,33 +26,25 @@ # } # class datadog_agent::integrations::ntp ( - Integer $offset_threshold = 60, - Optional[String] $host = undef, - Optional[Integer] $port = undef, - Optional[String] $version = undef, - Optional[Integer] $timeout = undef, + Integer $offset_threshold = 60, + Optional[String] $host = undef, + Optional[Integer] $port = undef, + Optional[String] $version = undef, + Optional[Integer] $timeout = undef, ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ntp.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/ntp.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/ntp.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/pgbouncer.pp b/manifests/integrations/pgbouncer.pp index 038ddd46b..801e60acb 100644 --- a/manifests/integrations/pgbouncer.pp +++ b/manifests/integrations/pgbouncer.pp @@ -51,30 +51,22 @@ String $host = 'localhost', Variant[String, Integer] $port = '6432', String $username = 'datadog', - Array $tags = [], - Array $pgbouncers = [], + Array $tags = [], + Array $pgbouncers = [], ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/pgbouncer.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/pgbouncer.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/pgbouncer.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/php_fpm.pp b/manifests/integrations/php_fpm.pp index 0d05163ef..0fa7b80b3 100644 --- a/manifests/integrations/php_fpm.pp +++ b/manifests/integrations/php_fpm.pp @@ -28,48 +28,40 @@ # } # class datadog_agent::integrations::php_fpm ( - String $status_url = 'http://localhost/status', - String $ping_url = 'http://localhost/ping', - String $ping_reply = 'pong', - Optional[String] $http_host = undef, - Array $tags = [], - Optional[Array] $instances = undef, - String $use_fastcgi = 'false' + String $status_url = 'http://localhost/status', + String $ping_url = 'http://localhost/ping', + String $ping_reply = 'pong', + Optional[String] $http_host = undef, + Array $tags = [], + Optional[Array] $instances = undef, + String $use_fastcgi = 'false' ) inherits datadog_agent::params { require datadog_agent if !$instances { $_instances = [{ - 'http_host' => $http_host, - 'status_url' => $status_url, - 'ping_url' => $ping_url, - 'ping_reply' => $ping_reply, - 'tags' => $tags, + 'http_host' => $http_host, + 'status_url' => $status_url, + 'ping_url' => $ping_url, + 'ping_reply' => $ping_reply, + 'tags' => $tags, 'use_fastcgi' => $use_fastcgi, }] } else { $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/php_fpm.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/php_fpm.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/php_fpm.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/postfix.pp b/manifests/integrations/postfix.pp index 18c1769d4..d44501b05 100644 --- a/manifests/integrations/postfix.pp +++ b/manifests/integrations/postfix.pp @@ -41,9 +41,9 @@ if !$instances and $directory { $_instances = [{ - 'directory' => $directory, - 'queues' => $queues, - 'tags' => $tags + 'directory' => $directory, + 'queues' => $queues, + 'tags' => $tags }] } elsif !$instances { $_instances = [] @@ -51,25 +51,17 @@ $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/postfix.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/postfix.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/postfix.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/postgres.pp b/manifests/integrations/postgres.pp index b2dd29f9c..7c4232097 100644 --- a/manifests/integrations/postgres.pp +++ b/manifests/integrations/postgres.pp @@ -17,19 +17,7 @@ # $username # The username for the datadog user # $ssl -# This option determines whether or not and with what priority a secure SSL TCP/IP connection -# is negotiated with the server. There are six modes: -# - `disable`: Only tries a non-SSL connection. -# - `allow`: First tries a non-SSL connection; if if fails, tries an SSL connection. -# - `prefer`: First tries an SSL connection; if it fails, tries a non-SSL connection. -# - `require`: Only tries an SSL connection. If a root CA file is present, verifies the certificate in -# the same way as if verify-ca was specified. -# - `verify-ca`: Only tries an SSL connection, and verifies that the server certificate is issued by a -# trusted certificate authority (CA). -# - `verify-full`: Only tries an SSL connection and verifies that the server certificate is issued by a -# trusted CA and that the requested server host name matches the one in the certificate. -# -# For a detailed description of how these options work see https://www.postgresql.org/docs/current/libpq-ssl.html +# Boolean to enable SSL # $use_psycopg2 # Boolean to flag connecting to postgres with psycopg2 instead of pg8000. # Warning, psycopg2 doesn't support ssl mode. @@ -71,15 +59,7 @@ # dbname: 'postgres' # username: 'datadog' # password: 'some_pass' -# ssl: 'allow' -# custom_metrics: -# a_custom_query: -# query: 'select tag_column, %s from table' -# relation: false -# metrics: -# value_column: ["value_column.datadog.tag", "GAUGE"] -# descriptors: -# - ["tag_column", "tag_column.datadog.tag"] +# ssl: false # class datadog_agent::integrations::postgres ( Optional[String] $password = undef, @@ -87,7 +67,7 @@ String $dbname = 'postgres', Variant[String, Integer] $port = '5432', String $username = 'datadog', - String $ssl = 'allow', + Boolean $ssl = false, Boolean $use_psycopg2 = false, Boolean $collect_function_metrics = false, Boolean $collect_count_metrics = false, @@ -100,25 +80,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/postgres.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/postgres.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/postgres.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" if !$instances and $host { $_instances = [{ diff --git a/manifests/integrations/process.pp b/manifests/integrations/process.pp index 81d72701e..80b2249ac 100644 --- a/manifests/integrations/process.pp +++ b/manifests/integrations/process.pp @@ -45,39 +45,35 @@ # class datadog_agent::integrations::process ( Boolean $hiera_processes = false, - Hash $init_config = {}, - Array $processes = [], + Hash $init_config = {}, + Array $processes = [], ) inherits datadog_agent::params { require datadog_agent if $hiera_processes { - $local_processes = lookup({ 'name' => 'datadog_agent::integrations::process::processes', 'merge' => 'unique', 'default_value' => $processes }) + $local_processes = lookup({ 'name' => 'datadog_agent::integrations::process::processes', 'merge' => 'unique', + 'default_value' => $processes }) } else { $local_processes = $processes } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/process.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/process.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/process.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: - ensure => $local_processes.length ? { 0 => 'absent', default => file }, + ensure => $local_processes.length ? { + 0 => 'absent', + default => file + }, owner => $datadog_agent::dd_user, group => $datadog_agent::params::dd_group, mode => $datadog_agent::params::permissions_protected_file, diff --git a/manifests/integrations/rabbitmq.pp b/manifests/integrations/rabbitmq.pp index a911d52d9..c83b78a40 100644 --- a/manifests/integrations/rabbitmq.pp +++ b/manifests/integrations/rabbitmq.pp @@ -53,40 +53,32 @@ # } # class datadog_agent::integrations::rabbitmq ( - Optional[String] $url = undef, - String $username = 'guest', - String $password = 'guest', - Boolean $ssl_verify = true, - Boolean $tag_families = false, - Array $nodes = [], - Array $nodes_regexes = [], - Array $queues = [], - Array $queues_regexes = [], - Array $vhosts = [], - Array $exchanges = [], - Array $exchanges_regexes = [], + Optional[String] $url = undef, + String $username = 'guest', + String $password = 'guest', + Boolean $ssl_verify = true, + Boolean $tag_families = false, + Array $nodes = [], + Array $nodes_regexes = [], + Array $queues = [], + Array $queues_regexes = [], + Array $vhosts = [], + Array $exchanges = [], + Array $exchanges_regexes = [], ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/rabbitmq.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/rabbitmq.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/rabbitmq.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/redis.pp b/manifests/integrations/redis.pp index a3d17fe5c..ade6694fd 100644 --- a/manifests/integrations/redis.pp +++ b/manifests/integrations/redis.pp @@ -14,20 +14,6 @@ # The main redis port. # $ports # Array of redis ports: overrides port (optional) -# $ssl -# Enable SSL/TLS encryption for the check (optional) -# $ssl_keyfile -# The path to the client-side private keyfile (optional) -# $ssl_certfile -# The path to the client-side certificate file (optional) -# $ssl_ca_certs -# The path to the ca_certs file (optional) -# $ssl_cert_reqs -# Specifies whether a certificate is required from the -# other side of the connection, and whether it's validated if provided (optional) -# * 0 for ssl.CERT_NONE (certificates ignored) -# * 1 for ssl.CERT_OPTIONAL (not required, but validated if provided) -# * 2 for ssl.CERT_REQUIRED (required and validated) # $slowlog_max_len # The max length of the slow-query log (optional) # $tags @@ -62,11 +48,6 @@ String $password = '', Variant[String, Integer] $port = '6379', Optional[Array] $ports = undef, - Boolean $ssl = false, - String $ssl_keyfile = '', - String $ssl_certfile = '', - String $ssl_ca_certs = '', - Optional[Integer] $ssl_cert_reqs = undef, Variant[String, Integer] $slowlog_max_len = '', Array $tags = [], Array $keys = [], @@ -88,11 +69,6 @@ 'host' => $host, 'password' => $password, 'port' => $instance_port, - 'ssl' => $ssl, - 'ssl_keyfile' => $ssl_keyfile, - 'ssl_certfile' => $ssl_certfile, - 'ssl_ca_certs' => $ssl_ca_certs, - 'ssl_cert_reqs' => $ssl_cert_reqs, 'slowlog_max_len' => $slowlog_max_len, 'tags' => $tags, 'keys' => $keys, @@ -101,25 +77,17 @@ } } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/redisdb.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/redisdb.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/redisdb.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" if !$instances and $host { $_instances = $_port_instances diff --git a/manifests/integrations/riak.pp b/manifests/integrations/riak.pp index 81b631f83..54004b092 100644 --- a/manifests/integrations/riak.pp +++ b/manifests/integrations/riak.pp @@ -22,30 +22,22 @@ # } # class datadog_agent::integrations::riak ( - String $url = 'http://localhost:8098/stats', - Array $tags = [], + String $url = 'http://localhost:8098/stats', + Array $tags = [], ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/riak.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/riak.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/riak.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: diff --git a/manifests/integrations/snmp.pp b/manifests/integrations/snmp.pp index d60c10dba..e21e018d3 100755 --- a/manifests/integrations/snmp.pp +++ b/manifests/integrations/snmp.pp @@ -69,25 +69,17 @@ 3 => $snmp_v3_instances, } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/snmp.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/snmp.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/snmp.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/solr.pp b/manifests/integrations/solr.pp index 6d164e0be..bbf26867f 100644 --- a/manifests/integrations/solr.pp +++ b/manifests/integrations/solr.pp @@ -47,25 +47,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/solr.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/solr.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/solr.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/ssh.pp b/manifests/integrations/ssh.pp index 51cf6a652..f0a807095 100644 --- a/manifests/integrations/ssh.pp +++ b/manifests/integrations/ssh.pp @@ -29,35 +29,27 @@ # } # class datadog_agent::integrations::ssh ( - String $host = $trusted['certname'], - Integer $port = 22, - String $username = $datadog_agent::dd_user, - Optional[Any] $password = undef, - Boolean $sftp_check = true, - Optional[String] $private_key_file = undef, - Boolean $add_missing_keys = true, + String $host = $trusted['certname'], + Integer $port = 22, + String $username = $datadog_agent::dd_user, + Optional[Any] $password = undef, + Boolean $sftp_check = true, + Optional[String] $private_key_file = undef, + Boolean $add_missing_keys = true, ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/ssh.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/ssh_check.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/ssh_check.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/supervisord.pp b/manifests/integrations/supervisord.pp index 7c7335d5e..14a18c863 100644 --- a/manifests/integrations/supervisord.pp +++ b/manifests/integrations/supervisord.pp @@ -44,29 +44,21 @@ # # class datadog_agent::integrations::supervisord ( - Array $instances = [{ 'servername' => 'server0', 'hostname' => 'localhost', 'port' => '9001' }], + Array $instances = [{ 'servername' => 'server0', 'hostname' => 'localhost', 'port' => '9001' }], ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/supervisord.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/supervisord.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/supervisord.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/system_core.pp b/manifests/integrations/system_core.pp index e4bdd9d1b..0da643878 100644 --- a/manifests/integrations/system_core.pp +++ b/manifests/integrations/system_core.pp @@ -12,25 +12,17 @@ class datadog_agent::integrations::system_core inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/system_core.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/system_core.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/system_core.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/tcp_check.pp b/manifests/integrations/tcp_check.pp index 2782a79d2..78d2710b8 100644 --- a/manifests/integrations/tcp_check.pp +++ b/manifests/integrations/tcp_check.pp @@ -110,25 +110,17 @@ $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/tcp_check.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/tcp_check.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/tcp_check.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/tomcat.pp b/manifests/integrations/tomcat.pp index e1d09f64a..f8ad3692e 100644 --- a/manifests/integrations/tomcat.pp +++ b/manifests/integrations/tomcat.pp @@ -50,25 +50,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/tomcat.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/tomcat.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/tomcat.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/twemproxy.pp b/manifests/integrations/twemproxy.pp index b56edfbaa..ecbb80e65 100644 --- a/manifests/integrations/twemproxy.pp +++ b/manifests/integrations/twemproxy.pp @@ -44,25 +44,17 @@ $_instances = $instances } - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/twemproxy.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/twemproxy.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/twemproxy.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/varnish.pp b/manifests/integrations/varnish.pp index 5e8c9a89a..498e37dfd 100644 --- a/manifests/integrations/varnish.pp +++ b/manifests/integrations/varnish.pp @@ -31,25 +31,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/varnish.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/varnish.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/varnish.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, diff --git a/manifests/integrations/zk.pp b/manifests/integrations/zk.pp index a36375c13..0fc031115 100644 --- a/manifests/integrations/zk.pp +++ b/manifests/integrations/zk.pp @@ -35,25 +35,17 @@ ) inherits datadog_agent::params { require datadog_agent - $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/zk.yaml" - if $datadog_agent::_agent_major_version > 5 { - $dst_dir = "${datadog_agent::params::conf_dir}/zk.d" - file { $legacy_dst: - ensure => 'absent', - } + $dst_dir = "${datadog_agent::params::conf_dir}/zk.d" - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_directory, - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } - $dst = "${dst_dir}/conf.yaml" - } else { - $dst = $legacy_dst + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_directory, + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } + $dst = "${dst_dir}/conf.yaml" file { $dst: ensure => file, From 6c7db20b816e6a8f2a586a5f45a1808e39d76a0f Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 4 Mar 2025 16:39:45 -0500 Subject: [PATCH 113/133] clean up integrations specs --- .../datadog_agent_integrations_activemq_xml_spec.rb | 6 +----- .../datadog_agent_integrations_apache_spec.rb | 6 +----- .../datadog_agent_integrations_cacti_spec.rb | 6 +----- .../datadog_agent_integrations_cassandra_spec.rb | 6 +----- .../classes/datadog_agent_integrations_ceph_spec.rb | 6 +----- .../datadog_agent_integrations_consul_spec.rb | 6 +----- .../datadog_agent_integrations_directory_spec.rb | 6 +----- .../datadog_agent_integrations_dns_check_spec.rb | 6 +----- ...datadog_agent_integrations_docker_daemon_spec.rb | 6 +----- ...datadog_agent_integrations_elasticsearch_spec.rb | 6 +----- .../datadog_agent_integrations_fluentd_spec.rb | 6 +----- .../datadog_agent_integrations_haproxy_spec.rb | 6 +----- .../datadog_agent_integrations_http_check_spec.rb | 6 +----- spec/classes/datadog_agent_integrations_jmx_spec.rb | 6 +----- .../classes/datadog_agent_integrations_kong_spec.rb | 6 +----- .../datadog_agent_integrations_kubernetes_spec.rb | 6 +----- ...adog_agent_integrations_kubernetes_state_spec.rb | 6 +----- .../datadog_agent_integrations_marathon_spec.rb | 6 +----- .../datadog_agent_integrations_memcache_spec.rb | 6 +----- .../datadog_agent_integrations_mesos_master_spec.rb | 6 +----- .../datadog_agent_integrations_mongo_spec.rb | 6 +----- .../datadog_agent_integrations_mysql_spec.rb | 6 +----- .../datadog_agent_integrations_network_spec.rb | 6 +----- .../datadog_agent_integrations_nginx_spec.rb | 6 +----- spec/classes/datadog_agent_integrations_ntp_spec.rb | 6 +----- .../datadog_agent_integrations_pgbouncer_spec.rb | 6 +----- .../datadog_agent_integrations_php_fpm_spec.rb | 6 +----- .../datadog_agent_integrations_postfix_spec.rb | 6 +----- .../datadog_agent_integrations_postgres_spec.rb | 6 +----- .../datadog_agent_integrations_process_spec.rb | 6 +----- .../datadog_agent_integrations_rabbitmq_spec.rb | 6 +----- .../datadog_agent_integrations_redis_spec.rb | 6 +----- .../classes/datadog_agent_integrations_riak_spec.rb | 6 +----- .../classes/datadog_agent_integrations_snmp_spec.rb | 6 +----- .../classes/datadog_agent_integrations_solr_spec.rb | 6 +----- spec/classes/datadog_agent_integrations_ssh_spec.rb | 6 +----- .../datadog_agent_integrations_supervisrd_spec.rb | 6 +----- .../datadog_agent_integrations_system_core_spec.rb | 6 +----- .../datadog_agent_integrations_tcp_check_spec.rb | 6 +----- .../datadog_agent_integrations_tomcat_spec.rb | 6 +----- .../datadog_agent_integrations_twemproxy_spec.rb | 6 +----- .../datadog_agent_integrations_varnish_spec.rb | 6 +----- spec/classes/datadog_agent_integrations_zk_spec.rb | 6 +----- spec/defines/datadog_agent__integration_spec.rb | 13 ++++--------- 44 files changed, 47 insertions(+), 224 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_activemq_xml_spec.rb b/spec/classes/datadog_agent_integrations_activemq_xml_spec.rb index ff5cd0bec..503464218 100644 --- a/spec/classes/datadog_agent_integrations_activemq_xml_spec.rb +++ b/spec/classes/datadog_agent_integrations_activemq_xml_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/activemq_xml.yaml' - else - "#{CONF_DIR}/activemq_xml.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/activemq_xml.d/conf.yaml" context 'with default parameters' do it { is_expected.to compile } diff --git a/spec/classes/datadog_agent_integrations_apache_spec.rb b/spec/classes/datadog_agent_integrations_apache_spec.rb index eef84648e..b2282031e 100644 --- a/spec/classes/datadog_agent_integrations_apache_spec.rb +++ b/spec/classes/datadog_agent_integrations_apache_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/apache.yaml' - else - "#{CONF_DIR}/apache.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/apache.d/conf.yaml" it { is_expected.to 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 02db98133..9cded143d 100644 --- a/spec/classes/datadog_agent_integrations_cacti_spec.rb +++ b/spec/classes/datadog_agent_integrations_cacti_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/cacti.yaml' - else - "#{CONF_DIR}/cacti.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/cacti.d/conf.yaml" context 'with default parameters' do it { is_expected.to compile } diff --git a/spec/classes/datadog_agent_integrations_cassandra_spec.rb b/spec/classes/datadog_agent_integrations_cassandra_spec.rb index 91de455e8..cb3ea59f1 100644 --- a/spec/classes/datadog_agent_integrations_cassandra_spec.rb +++ b/spec/classes/datadog_agent_integrations_cassandra_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/cassandra.yaml' - else - "#{CONF_DIR}/cassandra.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/cassandra.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { is_expected.to 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 add49ee72..59e4c85fe 100644 --- a/spec/classes/datadog_agent_integrations_ceph_spec.rb +++ b/spec/classes/datadog_agent_integrations_ceph_spec.rb @@ -10,11 +10,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/ceph.yaml' - else - "#{CONF_DIR}/ceph.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/ceph.d/conf.yaml" sudo_conf_file = '/etc/sudoers.d/datadog_ceph' diff --git a/spec/classes/datadog_agent_integrations_consul_spec.rb b/spec/classes/datadog_agent_integrations_consul_spec.rb index 50b7a724f..7b44097d3 100644 --- a/spec/classes/datadog_agent_integrations_consul_spec.rb +++ b/spec/classes/datadog_agent_integrations_consul_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/consul.yaml' - else - "#{CONF_DIR}/consul.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/consul.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_directory_spec.rb b/spec/classes/datadog_agent_integrations_directory_spec.rb index 3742e3bd7..e1bd5e22f 100644 --- a/spec/classes/datadog_agent_integrations_directory_spec.rb +++ b/spec/classes/datadog_agent_integrations_directory_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/directory.yaml' - else - "#{CONF_DIR}/directory.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/directory.d/conf.yaml" context 'with default parameters' do it { is_expected.not_to compile } diff --git a/spec/classes/datadog_agent_integrations_dns_check_spec.rb b/spec/classes/datadog_agent_integrations_dns_check_spec.rb index fbcfcdada..298c8cbc5 100644 --- a/spec/classes/datadog_agent_integrations_dns_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_dns_check_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/dns_check.yaml' - else - "#{CONF_DIR}/dns_check.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/dns_check.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb b/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb index db741f274..75d991d34 100644 --- a/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb +++ b/spec/classes/datadog_agent_integrations_docker_daemon_spec.rb @@ -10,11 +10,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/docker_daemon.yaml' - else - "#{CONF_DIR}/docker.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/docker.d/conf.yaml" it { is_expected.to 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 5cbb1e498..1486e8f6a 100644 --- a/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb +++ b/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/elastic.yaml' - else - "#{CONF_DIR}/elastic.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/elastic.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_fluentd_spec.rb b/spec/classes/datadog_agent_integrations_fluentd_spec.rb index 40996438c..119df625f 100644 --- a/spec/classes/datadog_agent_integrations_fluentd_spec.rb +++ b/spec/classes/datadog_agent_integrations_fluentd_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/fluentd.yaml' - else - "#{CONF_DIR}/fluentd.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/fluentd.d/conf.yaml" context 'with default parameters' do it { is_expected.to compile } diff --git a/spec/classes/datadog_agent_integrations_haproxy_spec.rb b/spec/classes/datadog_agent_integrations_haproxy_spec.rb index cd03c8a5a..1c9d4d091 100644 --- a/spec/classes/datadog_agent_integrations_haproxy_spec.rb +++ b/spec/classes/datadog_agent_integrations_haproxy_spec.rb @@ -10,11 +10,7 @@ } end - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/haproxy.yaml' - else - "#{CONF_DIR}/haproxy.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/haproxy.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_http_check_spec.rb b/spec/classes/datadog_agent_integrations_http_check_spec.rb index 4dfec85dc..450a842da 100644 --- a/spec/classes/datadog_agent_integrations_http_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_http_check_spec.rb @@ -11,11 +11,7 @@ } end - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/http_check.yaml' - else - "#{CONF_DIR}/http_check.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/http_check.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_jmx_spec.rb b/spec/classes/datadog_agent_integrations_jmx_spec.rb index 49765a12c..512c40ad9 100644 --- a/spec/classes/datadog_agent_integrations_jmx_spec.rb +++ b/spec/classes/datadog_agent_integrations_jmx_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/jmx.yaml' - else - "#{CONF_DIR}/jmx.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/jmx.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_kong_spec.rb b/spec/classes/datadog_agent_integrations_kong_spec.rb index 767051db9..c00215650 100644 --- a/spec/classes/datadog_agent_integrations_kong_spec.rb +++ b/spec/classes/datadog_agent_integrations_kong_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/kong.yaml' - else - "#{CONF_DIR}/kong.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/kong.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_kubernetes_spec.rb b/spec/classes/datadog_agent_integrations_kubernetes_spec.rb index 300a83186..287191337 100644 --- a/spec/classes/datadog_agent_integrations_kubernetes_spec.rb +++ b/spec/classes/datadog_agent_integrations_kubernetes_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/kubernetes.yaml' - else - "#{CONF_DIR}/kubernetes.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/kubernetes.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_kubernetes_state_spec.rb b/spec/classes/datadog_agent_integrations_kubernetes_state_spec.rb index efea143f0..138868ae5 100644 --- a/spec/classes/datadog_agent_integrations_kubernetes_state_spec.rb +++ b/spec/classes/datadog_agent_integrations_kubernetes_state_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/kubernetes_state.yaml' - else - "#{CONF_DIR}/kubernetes_state.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/kubernetes_state.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_marathon_spec.rb b/spec/classes/datadog_agent_integrations_marathon_spec.rb index 207a1731f..24035aaa3 100644 --- a/spec/classes/datadog_agent_integrations_marathon_spec.rb +++ b/spec/classes/datadog_agent_integrations_marathon_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/marathon.yaml' - else - "#{CONF_DIR}/marathon.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/marathon.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_memcache_spec.rb b/spec/classes/datadog_agent_integrations_memcache_spec.rb index 9514a931c..f141c880b 100644 --- a/spec/classes/datadog_agent_integrations_memcache_spec.rb +++ b/spec/classes/datadog_agent_integrations_memcache_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/mcache.yaml' - else - "#{CONF_DIR}/mcache.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/mcache.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_mesos_master_spec.rb b/spec/classes/datadog_agent_integrations_mesos_master_spec.rb index d4db54e42..9861aa3b2 100644 --- a/spec/classes/datadog_agent_integrations_mesos_master_spec.rb +++ b/spec/classes/datadog_agent_integrations_mesos_master_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/mesos_master.yaml' - else - "#{CONF_DIR}/mesos_master.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/mesos_master.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_mongo_spec.rb b/spec/classes/datadog_agent_integrations_mongo_spec.rb index 99072dd0b..d326e3ed5 100644 --- a/spec/classes/datadog_agent_integrations_mongo_spec.rb +++ b/spec/classes/datadog_agent_integrations_mongo_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/mongo.yaml' - else - "#{CONF_DIR}/mongo.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/mongo.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_mysql_spec.rb b/spec/classes/datadog_agent_integrations_mysql_spec.rb index 74c86804a..5c31f72d0 100644 --- a/spec/classes/datadog_agent_integrations_mysql_spec.rb +++ b/spec/classes/datadog_agent_integrations_mysql_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/mysql.yaml' - else - "#{CONF_DIR}/mysql.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/mysql.d/conf.yaml" context 'with default parameters' do it { is_expected.to compile } diff --git a/spec/classes/datadog_agent_integrations_network_spec.rb b/spec/classes/datadog_agent_integrations_network_spec.rb index b432eed58..fb1439096 100644 --- a/spec/classes/datadog_agent_integrations_network_spec.rb +++ b/spec/classes/datadog_agent_integrations_network_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/network.yaml' - else - "#{CONF_DIR}/network.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/network.d/conf.yaml" context 'with default parameters' do it { is_expected.to compile } diff --git a/spec/classes/datadog_agent_integrations_nginx_spec.rb b/spec/classes/datadog_agent_integrations_nginx_spec.rb index b25a40281..2bb7de38e 100644 --- a/spec/classes/datadog_agent_integrations_nginx_spec.rb +++ b/spec/classes/datadog_agent_integrations_nginx_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/nginx.yaml' - else - "#{CONF_DIR}/nginx.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/nginx.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_ntp_spec.rb b/spec/classes/datadog_agent_integrations_ntp_spec.rb index 2b98a253b..1cd38d192 100644 --- a/spec/classes/datadog_agent_integrations_ntp_spec.rb +++ b/spec/classes/datadog_agent_integrations_ntp_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/ntp.yaml' - else - "#{CONF_DIR}/ntp.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/ntp.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_pgbouncer_spec.rb b/spec/classes/datadog_agent_integrations_pgbouncer_spec.rb index c52ae9b03..0c2eabea6 100644 --- a/spec/classes/datadog_agent_integrations_pgbouncer_spec.rb +++ b/spec/classes/datadog_agent_integrations_pgbouncer_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/pgbouncer.yaml' - else - "#{CONF_DIR}/pgbouncer.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/pgbouncer.d/conf.yaml" context 'with default parameters' do let(:params) do diff --git a/spec/classes/datadog_agent_integrations_php_fpm_spec.rb b/spec/classes/datadog_agent_integrations_php_fpm_spec.rb index f95e8e38f..f3c8c636e 100644 --- a/spec/classes/datadog_agent_integrations_php_fpm_spec.rb +++ b/spec/classes/datadog_agent_integrations_php_fpm_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/php_fpm.yaml' - else - "#{CONF_DIR}/php_fpm.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/php_fpm.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_postfix_spec.rb b/spec/classes/datadog_agent_integrations_postfix_spec.rb index 9656e5032..7c77a9330 100644 --- a/spec/classes/datadog_agent_integrations_postfix_spec.rb +++ b/spec/classes/datadog_agent_integrations_postfix_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/postfix.yaml' - else - "#{CONF_DIR}/postfix.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/postfix.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_postgres_spec.rb b/spec/classes/datadog_agent_integrations_postgres_spec.rb index 877bc0286..5ded38acb 100644 --- a/spec/classes/datadog_agent_integrations_postgres_spec.rb +++ b/spec/classes/datadog_agent_integrations_postgres_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/postgres.yaml' - else - "#{CONF_DIR}/postgres.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/postgres.d/conf.yaml" context 'with default parameters' do it { is_expected.to compile } diff --git a/spec/classes/datadog_agent_integrations_process_spec.rb b/spec/classes/datadog_agent_integrations_process_spec.rb index 8195a0d3d..88d29635e 100644 --- a/spec/classes/datadog_agent_integrations_process_spec.rb +++ b/spec/classes/datadog_agent_integrations_process_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/process.yaml' - else - "#{CONF_DIR}/process.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/process.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_rabbitmq_spec.rb b/spec/classes/datadog_agent_integrations_rabbitmq_spec.rb index e1f479019..bf54edef7 100644 --- a/spec/classes/datadog_agent_integrations_rabbitmq_spec.rb +++ b/spec/classes/datadog_agent_integrations_rabbitmq_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/rabbitmq.yaml' - else - "#{CONF_DIR}/rabbitmq.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/rabbitmq.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_redis_spec.rb b/spec/classes/datadog_agent_integrations_redis_spec.rb index 8f710846b..bf66c1867 100644 --- a/spec/classes/datadog_agent_integrations_redis_spec.rb +++ b/spec/classes/datadog_agent_integrations_redis_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/redisdb.yaml' - else - "#{CONF_DIR}/redisdb.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/redisdb.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_riak_spec.rb b/spec/classes/datadog_agent_integrations_riak_spec.rb index c15c0f6e1..df2c2667f 100644 --- a/spec/classes/datadog_agent_integrations_riak_spec.rb +++ b/spec/classes/datadog_agent_integrations_riak_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/riak.yaml' - else - "#{CONF_DIR}/riak.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/riak.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_snmp_spec.rb b/spec/classes/datadog_agent_integrations_snmp_spec.rb index f92eb48c1..e0510d8a8 100644 --- a/spec/classes/datadog_agent_integrations_snmp_spec.rb +++ b/spec/classes/datadog_agent_integrations_snmp_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/snmp.yaml' - else - "#{CONF_DIR}/snmp.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/snmp.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_solr_spec.rb b/spec/classes/datadog_agent_integrations_solr_spec.rb index d14ac4edd..c5ad2b42f 100644 --- a/spec/classes/datadog_agent_integrations_solr_spec.rb +++ b/spec/classes/datadog_agent_integrations_solr_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/solr.yaml' - else - "#{CONF_DIR}/solr.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/solr.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_ssh_spec.rb b/spec/classes/datadog_agent_integrations_ssh_spec.rb index 70551a65e..22e350623 100644 --- a/spec/classes/datadog_agent_integrations_ssh_spec.rb +++ b/spec/classes/datadog_agent_integrations_ssh_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/ssh.yaml' - else - "#{CONF_DIR}/ssh_check.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/ssh_check.d/conf.yaml" context 'with default parameters' do it { is_expected.to compile } diff --git a/spec/classes/datadog_agent_integrations_supervisrd_spec.rb b/spec/classes/datadog_agent_integrations_supervisrd_spec.rb index 1dc5e4685..97185ba13 100644 --- a/spec/classes/datadog_agent_integrations_supervisrd_spec.rb +++ b/spec/classes/datadog_agent_integrations_supervisrd_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/supervisord.yaml' - else - "#{CONF_DIR}/supervisord.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/supervisord.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_system_core_spec.rb b/spec/classes/datadog_agent_integrations_system_core_spec.rb index 1ed0dd9ea..6942495be 100644 --- a/spec/classes/datadog_agent_integrations_system_core_spec.rb +++ b/spec/classes/datadog_agent_integrations_system_core_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/system_core.yaml' - else - "#{CONF_DIR}/system_core.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/system_core.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb index e287dc8e5..d17838678 100644 --- a/spec/classes/datadog_agent_integrations_tcp_check_spec.rb +++ b/spec/classes/datadog_agent_integrations_tcp_check_spec.rb @@ -12,11 +12,7 @@ } end - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/tcp_check.yaml' - else - "#{CONF_DIR}/tcp_check.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/tcp_check.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_tomcat_spec.rb b/spec/classes/datadog_agent_integrations_tomcat_spec.rb index 0a3105ec9..2057f50f7 100644 --- a/spec/classes/datadog_agent_integrations_tomcat_spec.rb +++ b/spec/classes/datadog_agent_integrations_tomcat_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/tomcat.yaml' - else - "#{CONF_DIR}/tomcat.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/tomcat.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_twemproxy_spec.rb b/spec/classes/datadog_agent_integrations_twemproxy_spec.rb index fa3f24c60..7a86ed703 100644 --- a/spec/classes/datadog_agent_integrations_twemproxy_spec.rb +++ b/spec/classes/datadog_agent_integrations_twemproxy_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/twemproxy.yaml' - else - "#{CONF_DIR}/twemproxy.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/twemproxy.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_varnish_spec.rb b/spec/classes/datadog_agent_integrations_varnish_spec.rb index f5c3888ac..9273a7bca 100644 --- a/spec/classes/datadog_agent_integrations_varnish_spec.rb +++ b/spec/classes/datadog_agent_integrations_varnish_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/varnish.yaml' - else - "#{CONF_DIR}/varnish.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/varnish.d/conf.yaml" it { is_expected.to compile.with_all_deps } it { diff --git a/spec/classes/datadog_agent_integrations_zk_spec.rb b/spec/classes/datadog_agent_integrations_zk_spec.rb index 332089afe..55fbb462c 100644 --- a/spec/classes/datadog_agent_integrations_zk_spec.rb +++ b/spec/classes/datadog_agent_integrations_zk_spec.rb @@ -5,11 +5,7 @@ context 'supported agents' do let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } - conf_file = if agent_major_version == 5 - '/etc/dd-agent/conf.d/zk.yaml' - else - "#{CONF_DIR}/zk.d/conf.yaml" - end + conf_file = "#{CONF_DIR}/zk.d/conf.yaml" it { is_expected.to compile.with_all_deps } diff --git a/spec/defines/datadog_agent__integration_spec.rb b/spec/defines/datadog_agent__integration_spec.rb index bbdacab9b..fdea34f2b 100644 --- a/spec/defines/datadog_agent__integration_spec.rb +++ b/spec/defines/datadog_agent__integration_spec.rb @@ -3,20 +3,15 @@ describe 'datadog_agent::integration' do ALL_SUPPORTED_AGENTS.each do |agent_major_version| context 'supported agents' do - if agent_major_version == 5 - conf_file = '/etc/dd-agent/conf.d/test.yaml' - else - conf_dir = "#{CONF_DIR}/test.d" - conf_file = "#{conf_dir}/conf.yaml" - end + conf_dir = "#{CONF_DIR}/test.d" + conf_file = "#{conf_dir}/conf.yaml" let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } let(:title) { 'test' } - if agent_major_version > 5 - it { is_expected.to contain_file(conf_dir.to_s).that_comes_before("File[#{conf_file}]") } - end + it { is_expected.to contain_file(conf_dir.to_s).that_comes_before("File[#{conf_file}]") } + it { is_expected.to contain_file(conf_file.to_s).that_notifies("Service[#{SERVICE_NAME}]") } context 'with instances' do From 8c7ab1b0028b606d26ca9614dee8fe03f622aa09 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 4 Mar 2025 16:57:59 -0500 Subject: [PATCH 114/133] clean up more manifests --- manifests/init.pp | 10 +++------- manifests/integration.pp | 22 +++++++++------------- manifests/integrations/logs.pp | 20 +++++++++----------- manifests/redhat.pp | 8 ++------ manifests/suse.pp | 3 +-- manifests/tag5.pp | 28 ---------------------------- manifests/ubuntu.pp | 1 - 7 files changed, 24 insertions(+), 68 deletions(-) delete mode 100644 manifests/tag5.pp diff --git a/manifests/init.pp b/manifests/init.pp index d6c5c3fdd..c7b0eee86 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -413,8 +413,8 @@ default: { $agent_full_version = $agent_version } } - if $_agent_major_version != 5 and $_agent_major_version != 6 and $_agent_major_version != 7 { - fail("agent_major_version must be either 5, 6 or 7, not ${_agent_major_version}") + if $_agent_major_version != 6 and $_agent_major_version != 7 { + fail("agent_major_version must be either 6 or 7, not ${_agent_major_version}") } if ($facts['os']['name'] == 'Windows' and $windows_ddagentuser_name != undef) { @@ -424,11 +424,7 @@ } if $conf_dir == undef { - if $_agent_major_version == 5 { - $_conf_dir = $datadog_agent::params::legacy_conf_dir - } else { - $_conf_dir = $datadog_agent::params::conf_dir - } + $_conf_dir = $datadog_agent::params::conf_dir } else { $_conf_dir = $conf_dir } diff --git a/manifests/integration.pp b/manifests/integration.pp index ac98ab10a..97afa0c53 100644 --- a/manifests/integration.pp +++ b/manifests/integration.pp @@ -14,20 +14,16 @@ # 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" - $dst = "${dst_dir}/${$conf_file}.yaml" - if (! defined(File[$dst_dir])) { - file { $dst_dir: - ensure => directory, - owner => $datadog_agent::dd_user, - group => $datadog_agent::dd_group, - mode => $datadog_agent::params::permissions_directory, - before => File[$dst], - } + $dst_dir = "${datadog_agent::params::conf_dir}/${integration}.d" + $dst = "${dst_dir}/${$conf_file}.yaml" + if (! defined(File[$dst_dir])) { + file { $dst_dir: + ensure => directory, + owner => $datadog_agent::dd_user, + group => $datadog_agent::dd_group, + mode => $datadog_agent::params::permissions_directory, + before => File[$dst], } - } else { - $dst = "${datadog_agent::params::legacy_conf_dir}/${integration}.yaml" } $file_ensure = $ensure ? { default => 'file', 'absent' => absent } diff --git a/manifests/integrations/logs.pp b/manifests/integrations/logs.pp index 914f7d83a..388192f79 100644 --- a/manifests/integrations/logs.pp +++ b/manifests/integrations/logs.pp @@ -41,17 +41,15 @@ class datadog_agent::integrations::logs ( Array $logs = [], ) inherits datadog_agent::params { - unless $datadog_agent::_agent_major_version == 5 { - require datadog_agent + require datadog_agent - file { "${datadog_agent::params::conf_dir}/logs.yaml": - ensure => file, - owner => $datadog_agent::dd_user, - group => $datadog_agent::params::dd_group, - mode => $datadog_agent::params::permissions_protected_file, - content => template('datadog_agent/agent-conf.d/logs.yaml.erb'), - require => Package[$datadog_agent::params::package_name], - notify => Service[$datadog_agent::params::service_name], - } + file { "${datadog_agent::params::conf_dir}/logs.yaml": + ensure => file, + owner => $datadog_agent::dd_user, + group => $datadog_agent::params::dd_group, + mode => $datadog_agent::params::permissions_protected_file, + content => template('datadog_agent/agent-conf.d/logs.yaml.erb'), + require => Package[$datadog_agent::params::package_name], + notify => Service[$datadog_agent::params::service_name], } } diff --git a/manifests/redhat.pp b/manifests/redhat.pp index 6a142dad9..1566e8011 100644 --- a/manifests/redhat.pp +++ b/manifests/redhat.pp @@ -19,7 +19,7 @@ ] #In this regex, version '1:6.15.0~rc.1-1' would match as $1='1:', $2='6', $3='15', $4='0', $5='~rc.1', $6='1' if $agent_version =~ /([0-9]+:)?([0-9]+)\.([0-9]+)\.([0-9]+)((?:~|-)[^0-9\s-]+[^-\s]*)?(?:-([0-9]+))?/ or $agent_version == 'latest' { - if $agent_major_version > 5 and ($agent_version == 'latest' or 0 + $3 > 35) { + if $agent_major_version >= 6 and ($agent_version == 'latest' or 0 + $3 > 35) { $keys = $all_keys[0,3] } else { $keys = $all_keys @@ -31,7 +31,7 @@ if ($rpm_repo_gpgcheck != undef) { $repo_gpgcheck = $rpm_repo_gpgcheck } else { - if ($agent_repo_uri == undef) and ($agent_major_version > 5) { + if ($agent_repo_uri == undef) and ($agent_major_version >= 6) { case $facts['os']['name'] { 'RedHat', 'CentOS', 'OracleLinux': { # disable repo_gpgcheck on 8.1 because of https://bugzilla.redhat.com/show_bug.cgi?id=1792506 @@ -51,10 +51,6 @@ } case $agent_major_version { - 5 : { - $defaulturl = "https://yum.datadoghq.com/rpm/${facts['os']['architecture']}/" - $gpgkeys = $keys - } 6 : { $defaulturl = "https://yum.datadoghq.com/stable/6/${facts['os']['architecture']}/" $gpgkeys = $keys diff --git a/manifests/suse.pp b/manifests/suse.pp index ae9f51d6f..c3f21c11a 100644 --- a/manifests/suse.pp +++ b/manifests/suse.pp @@ -19,7 +19,7 @@ ] #In this regex, version '1:6.15.0~rc.1-1' would match as $1='1:', $2='6', $3='15', $4='0', $5='~rc.1', $6='1' if $agent_version =~ /([0-9]+:)?([0-9]+)\.([0-9]+)\.([0-9]+)((?:~|-)[^0-9\s-]+[^-\s]*)?(?:-([0-9]+))?/ or $agent_version == 'latest' { - if $agent_major_version > 5 and ($agent_version == 'latest' or 0 + $3 > 35) { + if $agent_major_version >= 6 and ($agent_version == 'latest' or 0 + $3 > 35) { $keys_to_use = $all_keys[0,3] } else { $keys_to_use = $all_keys @@ -39,7 +39,6 @@ } case $agent_major_version { - 5 : { fail('Agent v5 package not available in SUSE') } 6 : { $gpgkeys = $keys_to_use } 7 : { $gpgkeys = $keys_to_use } default: { fail('invalid agent_major_version') } diff --git a/manifests/tag5.pp b/manifests/tag5.pp deleted file mode 100644 index 77e49bcb5..000000000 --- a/manifests/tag5.pp +++ /dev/null @@ -1,28 +0,0 @@ -# Allow custom tags via a define -define datadog_agent::tag5 ( - String $tag_name = $name, - Boolean $lookup_fact = false, -) { - if $lookup_fact { - $value = getvar($tag_name) - - if $value.is_a(Array) { - $tags = prefix($value, "${tag_name}:") - datadog_agent::tag5 { $tags: } - } else { - if $value { - concat::fragment { "datadog tag ${tag_name}:${value}": - target => '/etc/dd-agent/datadog.conf', - content => "${tag_name}:${value}, ", - order => '03', - } - } - } - } else { - concat::fragment { "datadog tag ${tag_name}": - target => '/etc/dd-agent/datadog.conf', - content => "${tag_name}, ", - order => '03', - } - } -} diff --git a/manifests/ubuntu.pp b/manifests/ubuntu.pp index bb590767f..149c78858 100644 --- a/manifests/ubuntu.pp +++ b/manifests/ubuntu.pp @@ -26,7 +26,6 @@ } case $agent_major_version { - 5 : { $repos = 'main' } 6 : { $repos = '6' } 7 : { $repos = '7' } default: { fail('invalid agent_major_version') } From 3b9c9a36afb46b5d766e12802fe1dab83bc353a8 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 4 Mar 2025 18:12:28 -0500 Subject: [PATCH 115/133] update rocky image --- kitchen.yml | 276 ++++++++++++++++++++++++++-------------------------- 1 file changed, 138 insertions(+), 138 deletions(-) diff --git a/kitchen.yml b/kitchen.yml index 89ba9ccc4..2238cd1b6 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -14,120 +14,120 @@ provisioner: custom_pre_apply_command: 'cp -r /tmp/modules/* /tmp/kitchen/modules/' platforms: - - name: ubuntu-24.04-puppet-8 - driver: - image: 'ubuntu:24.04' - provision_command: - - apt-get install -y apt-utils apt-transport-https ca-certificates - - wget https://apt.puppet.com/puppet8-release-noble.deb - - dpkg -i puppet8-release-noble.deb #installs the puppet-agent repo - - apt-get update - - apt-get install -y puppet-agent rubygems ruby-dev make gcc - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - - - name: ubuntu-22.04-puppet-8 - driver: - image: 'ubuntu:22.04' - provision_command: - - apt-get update - - apt-get install -y apt-utils apt-transport-https ca-certificates wget - - wget https://apt.puppet.com/puppet8-release-jammy.deb - - dpkg -i puppet8-release-jammy.deb #installs the puppet-agent repo - - apt-get update - - apt-get install -y puppet-agent rubygems ruby-dev make gcc - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet -p - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - - - name: ubuntu-20.04-puppet-7 - driver: - image: 'ubuntu:20.04' - docker_platform: linux/amd64 - provision_command: - - apt-get install -y apt-utils apt-transport-https ca-certificates make gcc - - wget https://apt.puppet.com/puppet7-release-focal.deb - - dpkg -i puppet7-release-focal.deb #installs the puppet-agent repo - - apt-get update - - apt-get install -y puppet-agent rubygems ruby-dev - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - - - name: centos-stream9-puppet-8 - driver: - image: 'datadog/docker-library:chef_kitchen_systemd_centos_9' - platform: centosstream - docker_platform: linux/amd64 - privileged: true - run_options: --cgroupns=host --tmpfs=/run --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw - publish_all: true - run_command: /root/start.sh - provision_command: - - dnf module -y reset ruby - - dnf module -y enable ruby:3.1 - - dnf module -y install ruby:3.1/common - - - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo - - yum install -y puppet-agent-8.10.0 rubygems ruby-devel procps-ng - - dnf group install -y "Development Tools" - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet -p - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules - - - name: rocky-9-puppet-8 - driver: - image: 'fannyatdd/docker-rocky9-systemd:test-9' - platform: rhel # kitchen-docker has issues installing packages otherwises - docker_platform: linux/amd64 - privileged: true - use_cache: false - run_options: --cgroupns=host --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw - run_command: /root/start.sh - provision_command: - - dnf module -y reset ruby - - dnf module -y enable ruby:3.1 - - dnf module -y install ruby:3.1/common - - - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo - - yum install -y puppet-agent-8.10.0 rubygems ruby-devel procps-ng - - dnf group install -y "Development Tools" - - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet - - - mkdir /home/kitchen/puppet -p - - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile - - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile - - - gem install bundler -v '= 2.4.13' - # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post - - cd /home && bundle install - - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules +- name: ubuntu-24.04-puppet-8 + driver: + image: 'ubuntu:24.04' + provision_command: + - apt-get install -y apt-utils apt-transport-https ca-certificates + - wget https://apt.puppet.com/puppet8-release-noble.deb + - dpkg -i puppet8-release-noble.deb #installs the puppet-agent repo + - apt-get update + - apt-get install -y puppet-agent rubygems ruby-dev make gcc + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +- name: ubuntu-22.04-puppet-8 + driver: + image: 'ubuntu:22.04' + provision_command: + - apt-get update + - apt-get install -y apt-utils apt-transport-https ca-certificates wget + - wget https://apt.puppet.com/puppet8-release-jammy.deb + - dpkg -i puppet8-release-jammy.deb #installs the puppet-agent repo + - apt-get update + - apt-get install -y puppet-agent rubygems ruby-dev make gcc + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet -p + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +- name: ubuntu-20.04-puppet-7 + driver: + image: 'ubuntu:20.04' + docker_platform: linux/amd64 + provision_command: + - apt-get install -y apt-utils apt-transport-https ca-certificates make gcc + - wget https://apt.puppet.com/puppet7-release-focal.deb + - dpkg -i puppet7-release-focal.deb #installs the puppet-agent repo + - apt-get update + - apt-get install -y puppet-agent rubygems ruby-dev + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +- name: centos-stream9-puppet-8 + driver: + image: 'datadog/docker-library:chef_kitchen_systemd_centos_9' + platform: centosstream + docker_platform: linux/amd64 + privileged: true + run_options: --cgroupns=host --tmpfs=/run --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw + publish_all: true + run_command: /root/start.sh + provision_command: + - dnf module -y reset ruby + - dnf module -y enable ruby:3.1 + - dnf module -y install ruby:3.1/common + + - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo + - yum install -y puppet-agent-8.10.0 rubygems ruby-devel procps-ng + - dnf group install -y "Development Tools" + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet -p + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules + +- name: rocky-9-puppet-8 + driver: + image: 'datadog/docker-library:chef_kitchen_systemd_rocky_9' + platform: rhel # kitchen-docker has issues installing packages otherwises + docker_platform: linux/amd64 + privileged: true + use_cache: false + run_options: --cgroupns=host --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw + run_command: /root/start.sh + provision_command: + - dnf module -y reset ruby + - dnf module -y enable ruby:3.1 + - dnf module -y install ruby:3.1/common + + - rpm -Uvh https://yum.puppet.com/puppet8-release-el-9.noarch.rpm #installs the puppet-agent repo + - yum install -y puppet-agent-8.10.0 rubygems ruby-devel procps-ng + - dnf group install -y "Development Tools" + - ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet + + - mkdir /home/kitchen/puppet -p + - printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile + - printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile + + - gem install bundler -v '= 2.4.13' + # we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post + - cd /home && bundle install + - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules #- name: opensuse/leap-15 # # Workaround for flakes on initializing opensuse/leap-15: @@ -162,27 +162,27 @@ platforms: # - cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules suites: - - name: dd-agent - manifests: init.pp - verifier: - name: serverspec - default_pattern: true - additional_install_commmand: source /etc/profile.d/rvm.sh - env_vars: - TARGET_HOST: 127.0.0.1 - TARGET_PORT: 2222 - LOGIN_USER: root - LOGIN_PASSWORD: puppet - - name: dd-installer - manifests: init.pp - provisioner: - manifests_path: environments/etc/installer-manifests - verifier: - name: serverspec - default_pattern: true - additional_install_commmand: source /etc/profile.d/rvm.sh - env_vars: - TARGET_HOST: 127.0.0.1 - TARGET_PORT: 2222 - LOGIN_USER: root - LOGIN_PASSWORD: puppet +- name: dd-agent + manifests: init.pp + verifier: + name: serverspec + default_pattern: true + additional_install_commmand: source /etc/profile.d/rvm.sh + env_vars: + TARGET_HOST: 127.0.0.1 + TARGET_PORT: 2222 + LOGIN_USER: root + LOGIN_PASSWORD: puppet +- name: dd-installer + manifests: init.pp + provisioner: + manifests_path: environments/etc/installer-manifests + verifier: + name: serverspec + default_pattern: true + additional_install_commmand: source /etc/profile.d/rvm.sh + env_vars: + TARGET_HOST: 127.0.0.1 + TARGET_PORT: 2222 + LOGIN_USER: root + LOGIN_PASSWORD: puppet From fa7dcce8ab0af0b62ce56a120699048bebd2c44a Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 4 Mar 2025 19:02:03 -0500 Subject: [PATCH 116/133] cleanup --- kitchen.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/kitchen.yml b/kitchen.yml index 2238cd1b6..998d744f6 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -80,7 +80,6 @@ platforms: docker_platform: linux/amd64 privileged: true run_options: --cgroupns=host --tmpfs=/run --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw - publish_all: true run_command: /root/start.sh provision_command: - dnf module -y reset ruby @@ -107,7 +106,6 @@ platforms: platform: rhel # kitchen-docker has issues installing packages otherwises docker_platform: linux/amd64 privileged: true - use_cache: false run_options: --cgroupns=host --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw run_command: /root/start.sh provision_command: From 5b1bc4a701ed5d7a29c26ddf9046cc759661af88 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Wed, 5 Mar 2025 10:05:31 -0500 Subject: [PATCH 117/133] update deprecated ensure_packages function --- manifests/ubuntu_installer.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/ubuntu_installer.pp b/manifests/ubuntu_installer.pp index 427098dad..6f22c797a 100644 --- a/manifests/ubuntu_installer.pp +++ b/manifests/ubuntu_installer.pp @@ -67,7 +67,7 @@ # Do not re-install keys as it is already managed in `ubuntu.pp` if ! $manage_agent_install { if !$skip_apt_key_trusting { - ensure_packages(['gnupg']) + stdlib::ensure_packages(['gnupg']) file { $apt_usr_share_keyring: ensure => file, From 645c2e059eab351c51dc90e13a4196207a676ec2 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 4 Mar 2025 18:11:04 -0500 Subject: [PATCH 118/133] fail installation for agent 5 --- spec/classes/datadog_agent_spec.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/spec/classes/datadog_agent_spec.rb b/spec/classes/datadog_agent_spec.rb index 0fc614fed..a874bfb5c 100644 --- a/spec/classes/datadog_agent_spec.rb +++ b/spec/classes/datadog_agent_spec.rb @@ -29,6 +29,36 @@ end end + context 'autodetect major version agent 5' do + let(:params) do + { + agent_version: '5.15.1', + } + end + let(:facts) do + { + os: { + 'architecture' => 'x86_64', + 'family' => 'debian', + 'name' => 'Ubuntu', + 'release' => { + 'major' => '14', + 'full' => '14.04', + }, + 'distro' => { + 'codename' => 'trusty', + }, + }, + } + end + + it do + expect { + is_expected.to contain_package('module') + }.to raise_error(Puppet::Error, %r{agent_major_version must be either 6 or 7, not 5}) + end + end + context 'autodetect major version agent 6' do let(:params) do { From 2b43f402a12d3dcdcf1cff7c79795345076a32fe Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Thu, 6 Mar 2025 08:03:22 +0000 Subject: [PATCH 119/133] updated change log to state removal of SSL settings from Redis integration --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb815fbc8..3b0facd77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,13 +17,14 @@ This release brings support for Puppet 8, which means all classes are now using * [FEATURE] Update to CI Builds to work with Ruby 3 * [BUGFIX] Fix issue where MSI path was not correctly parsed ([#814]) * [BUGFIX] BREAKING - `datadog_agent::integrations::disk` now expects booleans for `use_mount`, `all_partitions` and `tag_by_filesystem` +* [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests * [DEPRECATE] Drop support for Puppet 6 and below * [DEPRECATE] Remove support for supply a String to the SSL_Verify option on the elasticsearch integration. We now use tls_verify which matches core DataDog code. * [DEPRECATE] Support for Jenkins integrations is removed * [DEPRECATE] No longer possible to use the custom metrics parameter when using the PostgresSQL class * [DEPRECATE] `ganglia` configuration no longer supported as per DataDog Agent v6+ * [DEPRECATE] `skip_event` setting on TCP Check class has been removed from DataDog integration -* [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests +* [DEPRECATE] Removal of SSL settings from the Redis integration # 3.24.0 / 2025-02-25 From 6e7d725071594af1db3e8cfe05f7bd76cef39f88 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Thu, 6 Mar 2025 12:43:47 +0000 Subject: [PATCH 120/133] update with note about postgres --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b0facd77..c56a75b7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ This release brings support for Puppet 8, which means all classes are now using * [DEPRECATE] `ganglia` configuration no longer supported as per DataDog Agent v6+ * [DEPRECATE] `skip_event` setting on TCP Check class has been removed from DataDog integration * [DEPRECATE] Removal of SSL settings from the Redis integration +* [DEPRECATE] Postgres implementation now only accepts booleans for `ssl` settings. # 3.24.0 / 2025-02-25 From 6aa3831791da7a2904a6eb2393a3a3514a172a85 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Mar 2025 11:07:06 -0500 Subject: [PATCH 121/133] add back multi-instances fix --- manifests/integrations/http_check.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/integrations/http_check.pp b/manifests/integrations/http_check.pp index ba1f247d6..26ba2d948 100644 --- a/manifests/integrations/http_check.pp +++ b/manifests/integrations/http_check.pp @@ -7,10 +7,10 @@ # # Parameters: # sitename -# (Required) The name of the instance. +# The name of the instance. # # url -# (Required) The url to check. +# The url to check. # # timeout # The (optional) timeout in seconds. @@ -170,8 +170,8 @@ # }] # } class datadog_agent::integrations::http_check ( - String $sitename, - String $url, + Optional[String] $sitename = undef, + Optional[String] $url = undef, Optional[String] $username = undef, Optional[Any] $password = undef, Integer $timeout = 1, From 46324bd4c17786bcda954eb4072509a90e156a68 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Mar 2025 15:10:19 -0500 Subject: [PATCH 122/133] address linter warnings --- Gemfile | 2 ++ Gemfile.lock | 23 +++++++++-------------- manifests/init.pp | 2 +- manifests/redhat.pp | 6 +++--- manifests/suse.pp | 2 +- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Gemfile b/Gemfile index 5cd72cd04..86d4d3b99 100644 --- a/Gemfile +++ b/Gemfile @@ -46,6 +46,7 @@ group :development do gem "metadata-json-lint", '~> 3.0.3', require: false gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false gem "dependency_checker", '= 0.3.0', require: false + gem 'puppet-lint', '~> 3.4.0', require: false else gem "facterdb", '~> 3.4.0', require: false gem "test-kitchen", '~> 3.7.0' @@ -58,6 +59,7 @@ group :development do gem "metadata-json-lint", '~> 4.0', require: false gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false gem "dependency_checker", '~> 1.0.0', require: false + gem 'puppet-lint', '~> 4.3.0', require: false end end group :development, :release_prep do diff --git a/Gemfile.lock b/Gemfile.lock index 852c1e666..7ea5c941c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,6 +23,7 @@ GEM aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcrypt_pbkdf (1.0.1) + bcrypt_pbkdf (1.0.1-x64-mingw32) bigdecimal (3.1.9) bindata (2.5.0) bolt (4.0.0) @@ -91,7 +92,6 @@ GEM fast_gettext (2.4.0) prime ffi (1.17.1) - ffi (1.17.1-arm64-darwin) forwardable (1.3.3) getoptlong (0.2.1) gettext (3.5.1) @@ -223,18 +223,6 @@ GEM puppet-resource_api (~> 1.5) scanf (~> 1.0) semantic_puppet (~> 1.0) - puppet (8.10.0-universal-darwin) - CFPropertyList (>= 3.0.6, < 4) - concurrent-ruby (~> 1.0) - deep_merge (~> 1.0) - facter (>= 4.3.0, < 5) - fast_gettext (>= 2.1, < 4) - getoptlong (~> 0.2.0) - locale (~> 2.1) - multi_json (~> 1.13) - puppet-resource_api (~> 1.5) - scanf (~> 1.0) - semantic_puppet (~> 1.0) puppet-blacksmith (7.1.0) puppet-modulebuilder (~> 1.0) rest-client (~> 2.0) @@ -247,7 +235,7 @@ GEM rb-readline (>= 0.5.5) table_print (>= 1.0.0) tty-pager (~> 0.14) - puppet-lint (4.2.4) + puppet-lint (4.3.0) puppet-lint-absolute_classname-check (4.0.0) puppet-lint (>= 3.0, < 5) puppet-lint-anchor-check (2.0.0) @@ -337,6 +325,12 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + rest-client (2.1.0-x64-mingw32) + ffi (~> 1.9) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) retryable (3.0.5) rexml (3.4.1) rgen (0.10.2) @@ -534,6 +528,7 @@ DEPENDENCIES puppet puppet-blacksmith (~> 7.0) puppet-debugger (~> 1.0) + puppet-lint (~> 4.3.0) puppet-strings (~> 4.0) puppet_litmus (~> 1.0) puppetlabs_spec_helper (~> 8.0) diff --git a/manifests/init.pp b/manifests/init.pp index c7b0eee86..ab9e712b2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -799,7 +799,7 @@ if ($facts['os']['name'] == 'Windows') { file { 'C:/ProgramData/Datadog': - ensure => directory, + ensure => directory, } file { 'C:/ProgramData/Datadog/datadog.yaml': diff --git a/manifests/redhat.pp b/manifests/redhat.pp index 1566e8011..6bab9e165 100644 --- a/manifests/redhat.pp +++ b/manifests/redhat.pp @@ -78,11 +78,11 @@ } yumrepo { 'datadog5': - ensure => absent, + ensure => absent, } yumrepo { 'datadog6': - ensure => absent, + ensure => absent, } yumrepo { 'datadog': @@ -100,7 +100,7 @@ } } else { package { $agent_flavor: - ensure => $agent_version, + ensure => $agent_version, } } } diff --git a/manifests/suse.pp b/manifests/suse.pp index c3f21c11a..90d78f46b 100644 --- a/manifests/suse.pp +++ b/manifests/suse.pp @@ -96,6 +96,6 @@ } package { $agent_flavor: - ensure => $agent_version, + ensure => $agent_version, } } From 92ffb5ba3d8d22a3c5cb99d56cae8f18f12c2a0c Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Mar 2025 16:01:41 -0500 Subject: [PATCH 123/133] align spaces --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 86d4d3b99..09077c191 100644 --- a/Gemfile +++ b/Gemfile @@ -48,11 +48,11 @@ group :development do gem "dependency_checker", '= 0.3.0', require: false gem 'puppet-lint', '~> 3.4.0', require: false else - gem "facterdb", '~> 3.4.0', require: false + gem "facterdb", '~> 3.4.0', require: false gem "test-kitchen", '~> 3.7.0' gem "rubocop", '~> 1.50.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false - gem "rspec-puppet-facts", '~> 5.2.0', require: false + gem "rspec-puppet-facts", '~> 5.2.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "librarian-puppet", '~> 5.0' gem "io-console", '= 0.7.2', require: false From 15f32807159315c8972849d1f2fddcd0dea21d29 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Thu, 6 Mar 2025 18:31:13 -0500 Subject: [PATCH 124/133] add back redis ssl --- manifests/integrations/redis.pp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/manifests/integrations/redis.pp b/manifests/integrations/redis.pp index ade6694fd..2142c4029 100644 --- a/manifests/integrations/redis.pp +++ b/manifests/integrations/redis.pp @@ -14,6 +14,20 @@ # The main redis port. # $ports # Array of redis ports: overrides port (optional) +# $ssl +# Enable SSL/TLS encryption for the check (optional) +# $ssl_keyfile +# The path to the client-side private keyfile (optional) +# $ssl_certfile +# The path to the client-side certificate file (optional) +# $ssl_ca_certs +# The path to the ca_certs file (optional) +# $ssl_cert_reqs +# Specifies whether a certificate is required from the +# other side of the connection, and whether it's validated if provided (optional) +# * 0 for ssl.CERT_NONE (certificates ignored) +# * 1 for ssl.CERT_OPTIONAL (not required, but validated if provided) +# * 2 for ssl.CERT_REQUIRED (required and validated) # $slowlog_max_len # The max length of the slow-query log (optional) # $tags @@ -48,6 +62,11 @@ String $password = '', Variant[String, Integer] $port = '6379', Optional[Array] $ports = undef, + Boolean $ssl = false, + String $ssl_keyfile = '', + String $ssl_certfile = '', + String $ssl_ca_certs = '', + Optional[Integer] $ssl_cert_reqs = undef, Variant[String, Integer] $slowlog_max_len = '', Array $tags = [], Array $keys = [], @@ -69,6 +88,11 @@ 'host' => $host, 'password' => $password, 'port' => $instance_port, + 'ssl' => $ssl, + 'ssl_keyfile' => $ssl_keyfile, + 'ssl_certfile' => $ssl_certfile, + 'ssl_ca_certs' => $ssl_ca_certs, + 'ssl_cert_reqs' => $ssl_cert_reqs, 'slowlog_max_len' => $slowlog_max_len, 'tags' => $tags, 'keys' => $keys, From 660afb4241a8116760d077e69016f1161f4db3b5 Mon Sep 17 00:00:00 2001 From: Darren Gipson Date: Fri, 7 Mar 2025 07:23:05 +0000 Subject: [PATCH 125/133] remove comment following revert of redis change --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c56a75b7f..01cfde3dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,6 @@ This release brings support for Puppet 8, which means all classes are now using * [DEPRECATE] No longer possible to use the custom metrics parameter when using the PostgresSQL class * [DEPRECATE] `ganglia` configuration no longer supported as per DataDog Agent v6+ * [DEPRECATE] `skip_event` setting on TCP Check class has been removed from DataDog integration -* [DEPRECATE] Removal of SSL settings from the Redis integration * [DEPRECATE] Postgres implementation now only accepts booleans for `ssl` settings. # 3.24.0 / 2025-02-25 From 1d1f6cdd901cca1e4170215246cf8ee6d3a35570 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 7 Mar 2025 10:48:07 -0500 Subject: [PATCH 126/133] fix postgres and elastic --- CHANGELOG.md | 4 +- manifests/integrations/elasticsearch.pp | 18 ++++- manifests/integrations/postgres.pp | 46 ++++++++++- .../integrations/postgres_custom_metric.pp | 27 +++++++ ...g_agent_integrations_elasticsearch_spec.rb | 77 ++++++++++++++++--- ...atadog_agent_integrations_postgres_spec.rb | 53 +++++++++++++ templates/agent-conf.d/elastic.yaml.erb | 29 ++++++- 7 files changed, 230 insertions(+), 24 deletions(-) create mode 100644 manifests/integrations/postgres_custom_metric.pp diff --git a/CHANGELOG.md b/CHANGELOG.md index 01cfde3dc..2876a6eef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,12 +19,10 @@ This release brings support for Puppet 8, which means all classes are now using * [BUGFIX] BREAKING - `datadog_agent::integrations::disk` now expects booleans for `use_mount`, `all_partitions` and `tag_by_filesystem` * [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests * [DEPRECATE] Drop support for Puppet 6 and below -* [DEPRECATE] Remove support for supply a String to the SSL_Verify option on the elasticsearch integration. We now use tls_verify which matches core DataDog code. +* [DEPRECATE] Remove support for supplying a String to the `ssl_verify` option on the elasticsearch integration. Add updated `tls_*` options to match core Datadog code. * [DEPRECATE] Support for Jenkins integrations is removed -* [DEPRECATE] No longer possible to use the custom metrics parameter when using the PostgresSQL class * [DEPRECATE] `ganglia` configuration no longer supported as per DataDog Agent v6+ * [DEPRECATE] `skip_event` setting on TCP Check class has been removed from DataDog integration -* [DEPRECATE] Postgres implementation now only accepts booleans for `ssl` settings. # 3.24.0 / 2025-02-25 diff --git a/manifests/integrations/elasticsearch.pp b/manifests/integrations/elasticsearch.pp index 866dcb36e..0d10cd202 100644 --- a/manifests/integrations/elasticsearch.pp +++ b/manifests/integrations/elasticsearch.pp @@ -34,8 +34,15 @@ Boolean $pshard_stats = false, Optional[String] $ssl_cert = undef, Optional[String] $ssl_key = undef, - Boolean $ssl_verify = true, #kept for backwards compatibility + Boolean $ssl_verify = true, # kept for backwards compatibility Boolean $tls_verify = $ssl_verify, + Boolean $tls_use_host_header = false, + Boolean $tls_ignore_warning = false, + Optional[String] $tls_cert = undef, + Optional[String] $tls_private_key = undef, + Optional[String] $tls_ca_cert = undef, + Array $tls_protocols_allowed = [], + Array $tls_ciphers = [], Array $tags = [], String $url = 'http://localhost:9200', Optional[String] $username = undef, @@ -55,7 +62,14 @@ 'tls_verify' => $tls_verify, 'tags' => $tags, 'url' => $url, - 'username' => $username + 'username' => $username, + 'tls_use_host_header' => $tls_use_host_header, + 'tls_ignore_warning' => $tls_ignore_warning, + 'tls_cert' => $tls_cert, + 'tls_private_key' => $tls_private_key, + 'tls_ca_cert' => $tls_ca_cert, + 'tls_protocols_allowed' => $tls_protocols_allowed, + 'tls_ciphers' => $tls_ciphers, }] } elsif !$instances { $_instances = [] diff --git a/manifests/integrations/postgres.pp b/manifests/integrations/postgres.pp index 7c4232097..cdfe6fd21 100644 --- a/manifests/integrations/postgres.pp +++ b/manifests/integrations/postgres.pp @@ -17,7 +17,19 @@ # $username # The username for the datadog user # $ssl -# Boolean to enable SSL +# This option determines whether or not and with what priority a secure SSL TCP/IP connection +# is negotiated with the server. There are six modes: +# - `disable`: Only tries a non-SSL connection. +# - `allow`: First tries a non-SSL connection; if if fails, tries an SSL connection. +# - `prefer`: First tries an SSL connection; if it fails, tries a non-SSL connection. +# - `require`: Only tries an SSL connection. If a root CA file is present, verifies the certificate in +# the same way as if verify-ca was specified. +# - `verify-ca`: Only tries an SSL connection, and verifies that the server certificate is issued by a +# trusted certificate authority (CA). +# - `verify-full`: Only tries an SSL connection and verifies that the server certificate is issued by a +# trusted CA and that the requested server host name matches the one in the certificate. +# +# For a detailed description of how these options work see https://www.postgresql.org/docs/current/libpq-ssl.html # $use_psycopg2 # Boolean to flag connecting to postgres with psycopg2 instead of pg8000. # Warning, psycopg2 doesn't support ssl mode. @@ -41,6 +53,10 @@ # (10 + 10 per index) # $tags # Optional array of tags +# $custom_metrics +# A hash of custom metrics with the following keys - query, metrics, +# relation, descriptors. Refer to this guide for details on those fields: +# https://help.datadoghq.com/hc/en-us/articles/208385813-Postgres-custom-metric-collection-explained # # Sample Usage: # @@ -50,6 +66,18 @@ # username => 'datadog', # password => 'some_pass', # ssl => false, +# custom_metrics => { +# a_custom_query => { +# query => "select tag_column, %s from table", +# relation => false, +# metrics => { +# value_column => ["value_column.datadog.tag", "GAUGE"] +# }, +# descriptors => [ +# ["tag_column", "tag_column.datadog.tag"] +# ] +# } +# } # } # # Hiera Usage: @@ -59,7 +87,15 @@ # dbname: 'postgres' # username: 'datadog' # password: 'some_pass' -# ssl: false +# ssl: 'allow' +# custom_metrics: +# a_custom_query: +# query: 'select tag_column, %s from table' +# relation: false +# metrics: +# value_column: ["value_column.datadog.tag", "GAUGE"] +# descriptors: +# - ["tag_column", "tag_column.datadog.tag"] # class datadog_agent::integrations::postgres ( Optional[String] $password = undef, @@ -67,7 +103,7 @@ String $dbname = 'postgres', Variant[String, Integer] $port = '5432', String $username = 'datadog', - Boolean $ssl = false, + String $ssl = 'allow', Boolean $use_psycopg2 = false, Boolean $collect_function_metrics = false, Boolean $collect_count_metrics = false, @@ -76,6 +112,7 @@ Boolean $collect_default_database = false, Array[String] $tags = [], Array[String] $tables = [], + Hash $custom_metrics = {}, Optional[Array] $instances = undef, ) inherits datadog_agent::params { require datadog_agent @@ -103,6 +140,7 @@ 'use_psycopg2' => $use_psycopg2, 'tags' => $tags, 'tables' => $tables, + 'custom_metrics' => $custom_metrics, 'collect_function_metrics' => $collect_function_metrics, 'collect_count_metrics' => $collect_count_metrics, 'collect_activity_metrics' => $collect_activity_metrics, @@ -124,4 +162,6 @@ require => Package[$datadog_agent::params::package_name], notify => Service[$datadog_agent::params::service_name], } + + create_resources('datadog_agent::integrations::postgres_custom_metric', $custom_metrics) } diff --git a/manifests/integrations/postgres_custom_metric.pp b/manifests/integrations/postgres_custom_metric.pp new file mode 100644 index 000000000..92011034f --- /dev/null +++ b/manifests/integrations/postgres_custom_metric.pp @@ -0,0 +1,27 @@ +## +# The postgres_custom_metric defines a custom sql metric. +# https://help.datadoghq.com/hc/en-us/articles/208385813-Postgres-custom-metric-collection-explained +# +# $query: +# The custom metric SQL query. It must contain a '%s' for defining the metrics. +# +# $metrics: +# a hash of column name to metric definition. a metric definition is an array +# consisting of two columns -- the datadog metric name and the metric type. +# +# $relation: +# ? +# +# $descriptor: +# an array that maps an sql column's to a tag. Each descriptor consists of two +# fields -- column name, and datadog tag. +define datadog_agent::integrations::postgres_custom_metric ( + String $query, + Hash $metrics, + Boolean $relation = false, + Array $descriptors = [], +) { + if $query !~ '^.*%s.*$' { + fail('custom_metrics require %s for metric substitution') + } +} diff --git a/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb b/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb index 1486e8f6a..1ad42e22f 100644 --- a/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb +++ b/spec/classes/datadog_agent_integrations_elasticsearch_spec.rb @@ -28,8 +28,11 @@ it { is_expected.not_to contain_file(conf_file).with_content(%r{ username}) } it { is_expected.not_to contain_file(conf_file).with_content(%r{ password}) } it { is_expected.not_to contain_file(conf_file).with_content(%r{ tls_verify}) } - it { is_expected.not_to contain_file(conf_file).with_content(%r{ ssl_cert}) } - it { is_expected.not_to contain_file(conf_file).with_content(%r{ ssl_key}) } + it { is_expected.not_to contain_file(conf_file).with_content(%r{ tls_cert}) } + it { is_expected.not_to contain_file(conf_file).with_content(%r{ tls_ca_cert}) } + it { is_expected.not_to contain_file(conf_file).with_content(%r{ tls_private_key}) } + it { is_expected.not_to contain_file(conf_file).with_content(%r{ tls_use_host_header}) } + it { is_expected.not_to contain_file(conf_file).with_content(%r{ tls_ignore_warning}) } it { is_expected.not_to contain_file(conf_file).with_content(%r{ tags:}) } end @@ -40,9 +43,14 @@ pending_task_stats: false, url: 'https://foo:4242', username: 'username', - ssl_cert: '/etc/ssl/certs/client.pem', - ssl_key: '/etc/ssl/private/client.key', - tags: ['tag1:key1'], + tls_cert: '/etc/ssl/certs/client.pem', + tls_ca_cert: '/etc/ssl/certs/ca.pem', + tls_private_key: '/etc/ssl/private/client.key', + tls_use_host_header: true, + tls_ignore_warning: true, + tls_protocols_allowed: ['TLSv1.2', 'TLSv1.3'], + tls_ciphers: ['TLS_AES_256_GCM_SHA384', 'TLS_CHACHA20_POLY1305_SHA256'], + tags: ['tag1:key1'], } end @@ -50,11 +58,20 @@ it { is_expected.to contain_file(conf_file).with_content(%r{ pending_task_stats: false}) } it { is_expected.to contain_file(conf_file).with_content(%r{ username: username}) } it { is_expected.to contain_file(conf_file).with_content(%r{ password: password}) } - it { is_expected.to contain_file(conf_file).with_content(%r{ tls_verify: true}) } - it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_cert: /etc/ssl/certs/client.pem}) } - it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_key: /etc/ssl/private/client.key}) } it { is_expected.to contain_file(conf_file).with_content(%r{ tags:}) } it { is_expected.to contain_file(conf_file).with_content(%r{ - tag1:key1}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_verify: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_cert: /etc/ssl/certs/client.pem}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_ca_cert: /etc/ssl/certs/ca.pem}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_private_key: /etc/ssl/private/client.key}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_use_host_header: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_ignore_warning: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_protocols_allowed:}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ - TLSv1.2}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ - TLSv1.3}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_ciphers:}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ - TLS_AES_256_GCM_SHA384}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ - TLS_CHACHA20_POLY1305_SHA256}) } end context 'with multiple instances set' do @@ -70,8 +87,8 @@ 'url' => 'https://foo:4242', 'username' => 'username', 'tls_verify' => true, - 'ssl_cert' => '/etc/ssl/certs/client.pem', - 'ssl_key' => '/etc/ssl/private/client.key', + 'tls_cert' => '/etc/ssl/certs/client.pem', + 'tls_private_key' => '/etc/ssl/private/client.key', 'tags' => ['tag1:key1'], }, { @@ -84,6 +101,10 @@ 'username' => 'username_2', 'tls_verify' => false, 'tags' => ['tag2:key2'], + 'tls_use_host_header' => true, + 'tls_ignore_warning' => true, + 'tls_protocols_allowed' => ['TLSv1.2', 'TLSv1.3'], + 'tls_ciphers' => ['TLS_AES_256_GCM_SHA384', 'TLS_CHACHA20_POLY1305_SHA256'], }, ], } @@ -98,8 +119,8 @@ it { is_expected.to contain_file(conf_file).with_content(%r{ password: password}) } it { is_expected.to contain_file(conf_file).with_content(%r{ pshard_stats: true}) } it { is_expected.to contain_file(conf_file).with_content(%r{ tls_verify: true}) } - it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_cert: /etc/ssl/certs/client.pem}) } - it { is_expected.to contain_file(conf_file).with_content(%r{ ssl_key: /etc/ssl/private/client.key}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_cert: /etc/ssl/certs/client.pem}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_private_key: /etc/ssl/private/client.key}) } it { is_expected.to contain_file(conf_file).with_content(%r{ tags:\n - tag1:key1}) } it { is_expected.to contain_file(conf_file).with_content(%r{ - url: https://bar:2424}) } it { is_expected.to contain_file(conf_file).with_content(%r{ cluster_stats: false}) } @@ -110,6 +131,38 @@ it { is_expected.to contain_file(conf_file).with_content(%r{ pshard_stats: false}) } it { is_expected.to contain_file(conf_file).with_content(%r{ tls_verify: false}) } it { is_expected.to contain_file(conf_file).with_content(%r{ tags:\n - tag2:key2}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_use_host_header: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_ignore_warning: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_protocols_allowed:}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ - TLSv1.2}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ - TLSv1.3}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_ciphers:}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ - TLS_AES_256_GCM_SHA384}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ - TLS_CHACHA20_POLY1305_SHA256}) } + end + + context 'with legacy ssl_verify parameter set' do + let(:params) do + { + password: 'password', + url: 'https://foo:4242', + username: 'username', + ssl_verify: true, + tls_cert: '/etc/ssl/certs/client.pem', + tls_ca_cert: '/etc/ssl/certs/ca.pem', + tls_private_key: '/etc/ssl/private/client.key', + } + end + + it { is_expected.to contain_file(conf_file).with_content(%r{instances:}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ - url: https://foo:4242}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ cluster_stats: false}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ index_stats: false}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ pending_task_stats: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ pshard_stats: false}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_verify: true}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_cert: /etc/ssl/certs/client.pem}) } + it { is_expected.to contain_file(conf_file).with_content(%r{ tls_private_key: /etc/ssl/private/client.key}) } end end end diff --git a/spec/classes/datadog_agent_integrations_postgres_spec.rb b/spec/classes/datadog_agent_integrations_postgres_spec.rb index 5ded38acb..975bbec55 100644 --- a/spec/classes/datadog_agent_integrations_postgres_spec.rb +++ b/spec/classes/datadog_agent_integrations_postgres_spec.rb @@ -97,6 +97,59 @@ it { is_expected.to contain_file(conf_file).with_content(%r{username: monitoring}) } it { is_expected.to contain_file(conf_file).with_content(%r{^[^#]*tags:\s+- foo\s+- bar\s+- baz}) } it { is_expected.to contain_file(conf_file).with_content(%r{^[^#]*relations:\s+- furry\s+- fuzzy\s+- funky}) } + + context 'with custom metric query missing %s' do + let(:params) do + { + host: 'postgres1', + dbname: 'cats', + port: 4142, + username: 'monitoring', + password: 'abc123', + custom_metrics: { + 'query_is_missing_%s' => { + 'query' => 'select * from fuzz', + 'metrics' => {}, + }, + }, + } + end + + it do + expect { + is_expected.to compile + }.to raise_error(%r{custom_metrics require %s for metric substitution}) + end + end + + context 'with custom metric query' do + let(:params) do + { + host: 'postgres1', + dbname: 'cats', + port: 4142, + username: 'monitoring', + password: 'abc123', + custom_metrics: { + 'foo_gooo_bar_query' => { + 'query' => 'select foo, %s from bar', + 'metrics' => { + 'gooo' => ['custom_metric.tag.gooo', 'GAUGE'], + }, + 'descriptors' => [['foo', 'custom_metric.tag.foo']], + }, + }, + } + end + + it { is_expected.to compile } + it { is_expected.to contain_file(conf_file).with_content(%r{^[^#]*custom_metrics:}) } + it { is_expected.to contain_file(conf_file).with_content(%r{\s+query:\s*['"]?select foo, %s from bar['"]?}) } + it { is_expected.to contain_file(conf_file).with_content(%r{\s+metrics:}) } + it { is_expected.to contain_file(conf_file).with_content(%r{\s+"gooo":\s+\[custom_metric.tag.gooo, GAUGE\]}) } + it { is_expected.to contain_file(conf_file).with_content(%r{\s+query.*[\r\n]+\s+relation:\s*false}) } + it { is_expected.to contain_file(conf_file).with_content(%r{\s+descriptors.*[\r\n]+\s+-\s+\[foo, custom_metric.tag.foo\]}) } + end end end end diff --git a/templates/agent-conf.d/elastic.yaml.erb b/templates/agent-conf.d/elastic.yaml.erb index 561a88cb7..a461ad3a4 100644 --- a/templates/agent-conf.d/elastic.yaml.erb +++ b/templates/agent-conf.d/elastic.yaml.erb @@ -18,11 +18,20 @@ instances: <%- if instance['url'].match(/^https/) -%> tls_verify: <%= instance['tls_verify'] %> <%- end -%> -<%- if instance['ssl_cert'] && instance['ssl_cert'] != :undef -%> - ssl_cert: <%= instance['ssl_cert'] %> +<%- if instance['tls_cert'] && instance['tls_cert'] != :undef -%> + tls_cert: <%= instance['tls_cert'] %> <%- end -%> -<%- if instance['ssl_key'] && instance['ssl_key'] != :undef -%> - ssl_key: <%= instance['ssl_key'] %> +<%- if instance['tls_ca_cert'] && instance['tls_ca_cert'] != :undef -%> + tls_ca_cert: <%= instance['tls_ca_cert'] %> +<%- end -%> +<%- if instance['tls_private_key'] && instance['tls_private_key'] != :undef -%> + tls_private_key: <%= instance['tls_private_key'] %> +<%- end -%> +<%- if instance['tls_use_host_header'] && instance['tls_use_host_header'] != :undef -%> + tls_use_host_header: <%= instance['tls_use_host_header'] %> +<%- end -%> +<%- if instance['tls_ignore_warning'] && instance['tls_ignore_warning'] != :undef -%> + tls_ignore_warning: <%= instance['tls_ignore_warning'] %> <%- end -%> <%- unless instance['tags'].empty? -%> tags: @@ -30,4 +39,16 @@ instances: - <%= tag %> <%- end -%> <%- end -%> +<%- unless instance['tls_protocols_allowed'].nil? -%> + tls_protocols_allowed: + <%- instance['tls_protocols_allowed'].each do |protocol| -%> + - <%= protocol %> + <%- end -%> +<%- end -%> +<%- unless instance['tls_ciphers'].nil? -%> + tls_ciphers: + <%- instance['tls_ciphers'].each do |cipher| -%> + - <%= cipher %> + <%- end -%> +<%- end -%> <%- end -%> From 8d9620b9bde83ed36e875e97b1b9869debe724f3 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 7 Mar 2025 10:50:08 -0500 Subject: [PATCH 127/133] update docs, cleanups --- .fixtures.yml | 2 +- CHANGELOG.md | 490 ++++++++++++++++++++++++++++-- README.md | 115 ++++--- manifests/init.pp | 14 - templates/datadog_footer.conf.erb | 66 ---- 5 files changed, 542 insertions(+), 145 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 4f93d810a..7269a844e 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,7 +1,7 @@ fixtures: repositories: stdlib: - repo: "https://github.com/puppetlabs/puppetlabs-stdlib.git" # TODO: why git: and not https:? + repo: "https://github.com/puppetlabs/puppetlabs-stdlib.git" ref: "v9.7.0" # Puppet >= 7.0.0 < 9.0.0 concat: repo: "https://github.com/puppetlabs/puppetlabs-concat.git" diff --git a/CHANGELOG.md b/CHANGELOG.md index 2876a6eef..c75b970ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,24 +5,27 @@ Changes -# 4.0.0 / 2025-02-28 +# 4.0.0 / 2025-03-07 -This release has multiple breaking changes, you may need to update your module integration; note that module dependencies has been updated. +This release has multiple breaking changes, you may need to update your module integration; note that module +dependencies has been updated. -This release brings support for Puppet 8, which means all classes are now using defined class parameters types; this could break existing implementations. +This release brings support for Puppet 8, which means all classes are now using defined class parameters types; this +could break existing implementations. * [FEATURE] Add Support for Puppet 8 ([#779]) * [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#800]) -* [FEATURE] Class definitions updated with references to DataDog examples +* [FEATURE] Class definitions updated with references to Datadog examples * [FEATURE] Update to CI Builds to work with Ruby 3 * [BUGFIX] Fix issue where MSI path was not correctly parsed ([#814]) * [BUGFIX] BREAKING - `datadog_agent::integrations::disk` now expects booleans for `use_mount`, `all_partitions` and `tag_by_filesystem` -* [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests * [DEPRECATE] Drop support for Puppet 6 and below +* [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests +* [DEPRECATE] Remove `ganglia`, `graphite`, `dogstreams`, `custom_emitters` and `use_curl_http_client` legacy configuration options which are no longer supported since Datadog Agent v6+ +* [DEPRECATE] Remove support for supplying a string to the `ssl_verify` option on the elasticsearch integration. We now use `tls_verify` which matches core Datadog code. +* [DEPRECATE] Remove legacy Jenkins integration +* [DEPRECATE] `skip_event` setting on TCP Check class has been removed from DataDog integration (removed since Datadog Agent v6.4+) * [DEPRECATE] Remove support for supplying a String to the `ssl_verify` option on the elasticsearch integration. Add updated `tls_*` options to match core Datadog code. -* [DEPRECATE] Support for Jenkins integrations is removed -* [DEPRECATE] `ganglia` configuration no longer supported as per DataDog Agent v6+ -* [DEPRECATE] `skip_event` setting on TCP Check class has been removed from DataDog integration # 3.24.0 / 2025-02-25 @@ -35,7 +38,8 @@ This release brings support for Puppet 8, which means all classes are now using * [FEATURE] Add support for Datadog installer on Linux systems ([#820]) * [DEPRECATE] Deprecate CentOS 6 to 7.51.1 maximum and install only relevant gpg keys on redhat based systems ([#806]) * [SANITY] Remove a duplicate parameter in the documentation ([#799])(thanks [@albertollamaso]) -* [FEATURE] Allow defining `apm_filter_tags` and `apm_filter_tags_regex` to filter traces/spans ([#798])(thanks [@erik-frontify]) +* [FEATURE] Allow defining `apm_filter_tags` and `apm_filter_tags_regex` to filter traces/spans ([#798])( + thanks [@erik-frontify]) # 3.22.0 / 2023-11-15 @@ -92,7 +96,8 @@ This release brings support for Puppet 8, which means all classes are now using * [BUGFIX] Do not add process integration configuration file if not configured ([#703][]) (Thanks [@yanjunding][]) * [FEATURE] add support for `min_collection_interval` for HTTP check ([#699][]) (Thanks [@yanjunding][]) * [FEATURE] Improvements for APT keys management ([#698][], [#700][], [#701][] and [#714][]) -* [FEATURE] Include 'datadog_agent' class in the catalog when using the generic integration ([#697][]) (Thanks [@stantona][]) +* [FEATURE] Include 'datadog_agent' class in the catalog when using the generic integration ([#697][]) ( + Thanks [@stantona][]) * [BUGFIX] Update `excluded_interface_re` type to String ([#696][]) (Thanks [@florusboth][]) # 3.12.0 / 2021-05-06 @@ -168,8 +173,10 @@ This release brings support for Puppet 8, which means all classes are now using # 3.1.0 / 2020-01-14 * [FEATURE] Accept the same version string in Debian/Ubuntu than in other OSes when pinning the Agent. See [#591][] -* [FEATURE] Add the `check_hostname` and `ssl_server_name` parameters to the `http_check` integration. See [#599][] (Thanks [@asenci][]) -* [BUGFIX] Remove include from `system_probe.pp` that caused error "This Function Call is unacceptable as a top level construct in this location" on recent Puppet versions. See [#596][] (thanks again [@asenci][]) +* [FEATURE] Add the `check_hostname` and `ssl_server_name` parameters to the `http_check` integration. See [#599][] ( + Thanks [@asenci][]) +* [BUGFIX] Remove include from `system_probe.pp` that caused error "This Function Call is unacceptable as a top level + construct in this location" on recent Puppet versions. See [#596][] (thanks again [@asenci][]) * [BUGFIX] Fix broken `facts_to_tags` on Agent 5. See [#598][] * [CHORE] Migrate project to PDK (Puppet Development Kit). See [#597][] @@ -225,8 +232,10 @@ then it is safe to upgrade. * [FEATURE] Initial Windows support. See [#557][] * [FEATURE] Add ignore_ssl_warning to HTTP check. See [#556][] (Thanks [@zabacad][]) * [FEATURE] Add logs_open_files_limit parameter [#548][]. (Thanks [@rmrf-run][]) -* [BUGFIX] Fix a warning caused by calling `validate_legacy` with the default `additional_checksd` value of `undef`. See [#551][]. -* [BUGFIX] Fix Redis integration, where tags weren't evaluated when the keys param was empty. See [#558][] (Thanks [@jubagarie][]) +* [BUGFIX] Fix a warning caused by calling `validate_legacy` with the default `additional_checksd` value of `undef`. + See [#551][]. +* [BUGFIX] Fix Redis integration, where tags weren't evaluated when the keys param was empty. See [#558][] ( + Thanks [@jubagarie][]) * [DOCUMENTATION] Fix doc for HTTP check include_content. See [#555][] (Thanks [@zabacad][]) # 2.7.0 / 2019-07-11 @@ -235,7 +244,8 @@ then it is safe to upgrade. * [FEATURE] Support puppet 6. See [#537][] * [FEATURE] Added a define that wraps the agent integration command. See [#534][] -* [BUGFIX] Add whitespace surpression to redisdb.yaml.erb to ensure a valid yaml. See [#533][] (Thanks again [@Aramack][]) +* [BUGFIX] Add whitespace surpression to redisdb.yaml.erb to ensure a valid yaml. See [#533][] (Thanks + again [@Aramack][]) * [BUGFIX] Do not include additional_checksd if not set. See [#545][] (Thanks [@turnopil][]) * [IMPROVEMENT] Raise if hostname_extraction_regex doesn't capture hostname. See [#544][] @@ -249,7 +259,8 @@ then it is safe to upgrade. * [FEATURE] Redis: adding multi-instance support. See [#520][] * [FEATURE] HTTP check: add support for `method`, `data` configuration. See [#515][] (Thanks [@Aramack][]) * [FEATURE] HTTP check: add reverse content-match support. See [#524][] (Thanks [@dorg-kanderson][]) -* [BUGFIX] Agent 6: track integration configuration directories - fixes `conf_dir_purge`. See [#525][] (Thanks [@Aramack][]) +* [BUGFIX] Agent 6: track integration configuration directories - fixes `conf_dir_purge`. See [#525][] ( + Thanks [@Aramack][]) * [BUGFIX] Agent 6: fixes `additional_checksd` not appearing in agent config. See [#513][] (Thanks [@gotyaio][]) * [BUGFIX] Postgres: allow setting password in Hiera. See [#514][] (Thanks [@cabrinha][]) * [BUGFIX] Redis: fix trying to call `empty?` on an integer on template. See [#527][] @@ -352,7 +363,8 @@ then it is safe to upgrade. * [BUGFIX] Stdlib: fix deprecations after stdlib 4.24.0. See [#403][] and [#404][] (Thanks [@teintuc][]) * [BUGFIX] RHEL: stop specifying service resource provider `redhat`. See [#401][] (Thanks [@milescrabill][]) * [IMPROVEMENT] Add types to multiple manifest parameters. See [#404][] -* [COMPATIBILITY] Drop puppetlabs-apt dependency lower bound to `2.4.0`. See [#404][] and 400 (Thanks [@samueljamesmarshall][]) +* [COMPATIBILITY] Drop puppetlabs-apt dependency lower bound to `2.4.0`. See [#404][] and 400 ( + Thanks [@samueljamesmarshall][]) # 2.0.1 / 2018-02-28 @@ -383,7 +395,8 @@ Please read the [docs]() for more details. ### Notes -* [MAJOR] Datadog agent defaults to 6.x. Puppet >=4.6. See [#387][] and [docs](https://github.com/DataDog/puppet-datadog-agent/blob/master/README.md) +* [MAJOR] Datadog agent defaults to 6.x. Puppet >=4.6. See [#387][] + and [docs](https://github.com/DataDog/puppet-datadog-agent/blob/master/README.md) * [FEATURE] Postgresl: adding SSL parameter support. See [#391][] (thanks [@com6056][]) * [FEATURE] Docker_daemon: parametrize integration. See [#378][] (thanks [@flyinprogrammer][]) * [FEATURE] Kafka: added support for multiple instances. See [#343][], [#395][] (thanks [@jensendw][]) @@ -480,11 +493,13 @@ Please read the [docs]() for more details. * [BUGFIX] Reporting: allow the report processor to run on Puppet Enterprise. See [#266][]. (Thanks [@binford2k][]). * [BUGFIX] RHEL/CentOS: Fix gpg and test binary paths. See [#259][]. (Thanks [@sethcleveland][]). * [BUGFIX] NTP: fix template. See [#280][]. (Thanks [@MartinDelta][]). -* [BUGFIX] Multiple integrations: swapped order of optional vs. non-optional parameters. See [#232][]. (Thanks [@sethcleveland][]). +* [BUGFIX] Multiple integrations: swapped order of optional vs. non-optional parameters. See [#232][]. ( + Thanks [@sethcleveland][]). * [IMPROVEMENT] [rpm+deb] repo keys rotated. See [#242][]. * [IMPROVEMENT] MySQL: Allow multiple MySQL instances See [#267][]. (Thanks [@IanCrouch][]). -* [IMPROVEMENT] Http check: `allow_redirects` + `check_certificate_expiration` improvement. See [#282][]. (Thanks [@cristianjuve][]). +* [IMPROVEMENT] Http check: `allow_redirects` + `check_certificate_expiration` improvement. See [#282][]. ( + Thanks [@cristianjuve][]). * [IMPROVEMENT] Http_check: update to include new attributes. See [#276][]. (Thanks [@aepod][]). * [IMPROVEMENT] Http_check: set disable_ssl_validation parameter. See [#258][]. * [IMPROVEMENT] Postgres: support generic postgres custom metrics. See [#224][]. (Thanks [@sethcleveland][]). @@ -552,18 +567,22 @@ Please read the [docs]() for more details. * [FEATURE] Added manifest for PGBouncer. See [#175][]. (Thanks [@mcasper][]). * [FEATURE] Added manifest for Consul. See [#174][]. (Thanks [@flyinprogrammer][]). -* [FEATURE] Added mesos master and slave manifests for individual management. See [#174][]. (Thanks [@flyinprogrammer][] and [@jangie][]). -* [FEATURE] Added option to extract the hostname from puppet hostname strings with a regex capture group. See [#173][]. (Thanks [@LeoCavaille][]). +* [FEATURE] Added mesos master and slave manifests for individual management. See [#174][]. (Thanks [@flyinprogrammer][] + and [@jangie][]). +* [FEATURE] Added option to extract the hostname from puppet hostname strings with a regex capture group. + See [#173][]. (Thanks [@LeoCavaille][]). * [FEATURE] Added support on multiple ports per host on Redis integration. See [#169][]. (Thanks [@fzwart][]). * [FEATURE] Added support for `disable_ssl_validation` on Apache integration. See[#171. (Thanks [@BIAndrews][]). -* [FEATURE] Added support for SSL, additional metrics and database connection in Mongo integration. See [#164][]. (Thanks [@bflad][]). +* [FEATURE] Added support for SSL, additional metrics and database connection in Mongo integration. See [#164][]. ( + Thanks [@bflad][]). * [FEATURE] Added support for multiple instance in HTTP check. See [#155][]. (Thanks [@jniesen][]). * [FEATURE] Added support for multiple new datadog.conf directives. See [#79][]. (Thanks [@obowersa][]). * [FEATURE] Decouple yum repo from agent package. See [#168][]. (Thanks [@b2jrock][]). * [IMPROVEMENT] Moved GPG key to its own parameter. See [#158][]. (Thanks [@davidgibbons][]). -* [BUFIX] Updated docker to use more current `docker_daemon`. See [#174][]. (Thanks [@flyinprogrammer][] and [@jangie][]). +* [BUFIX] Updated docker to use more current `docker_daemon`. See [#174][]. (Thanks [@flyinprogrammer][] + and [@jangie][]). * [DEPRECATE] Deprecated old docker manifest. See [#174][]. (Thanks [@flyinprogrammer][]). * [DEPRECATE] Deprecated `new_tag_names` in `docker_daemon` manifest. See [#176][]. @@ -581,7 +600,8 @@ Please read the [docs]() for more details. * [BIGFIX] Use ensure_packages(), to be more polite about apt-transport-https. See [#154][]. (Thanks [@rtyler][]). * [BUGFIX] Fixed Zookeeper template. See [#150][] (Thanks [@tuxinaut][]). -* [BUGFIX] Raised priority of `changed` event types to normal - they'll now show in Datadog UI. See [#156][]. (Thanks [@rtyler][]). +* [BUGFIX] Raised priority of `changed` event types to normal - they'll now show in Datadog UI. See [#156][]. ( + Thanks [@rtyler][]). * [BUGFIX] Require stdlib >=4.6 (provide `validate_integer()`). See [#161][]. (Thanks [@mrunkel-ut][]). * [CI] Testable up to puppet 4.2. See [#161][]. (Thanks [@grubernaut][]). @@ -626,7 +646,7 @@ Please read the [docs]() for more details. * [FEATURE] Add `sock` parameter in MySQL integration * [FEATURE] Add support for graphite listener option in the main class * [FEATURE] Add NTP integration -* [FEATURE] Add support for dogstreams array in the main class +* [FEATURE] Add support for dogstreams array in the main class * [FEATURE] Add HAProxy integration * [FEATURE] Add RabbitMQ integration * [FEATURE] Add support for an extra template appended to datadog.conf @@ -651,7 +671,8 @@ Please read the [docs]() for more details. * [FEATURE] Add proxy options in the base datadog_agent class * [BUGFIX] Use correct JMX-styled tags in JMX integrations -> Careful this means that you probably have to update a buggy array of tags (that gives you nothing in the agent) to a hash of tags. +> Careful this means that you probably have to update a buggy array of tags (that gives you nothing in the agent) to a +> hash of tags. * [BUGFIX] Fix ordering in YAML templates using `to_yaml` broken because of ruby 1.8 * [CI] Add boilerpate for specs and linting rake tasks @@ -680,418 +701,833 @@ Please read the [docs]() for more details. [docs]: https://github.com/DataDog/puppet-datadog-agent/blob/master/README.md + [#79]: https://github.com/DataDog/puppet-datadog-agent/issues/79 + [#139]: https://github.com/DataDog/puppet-datadog-agent/issues/139 + [#145]: https://github.com/DataDog/puppet-datadog-agent/issues/145 + [#149]: https://github.com/DataDog/puppet-datadog-agent/issues/149 + [#150]: https://github.com/DataDog/puppet-datadog-agent/issues/150 + [#154]: https://github.com/DataDog/puppet-datadog-agent/issues/154 + [#155]: https://github.com/DataDog/puppet-datadog-agent/issues/155 + [#156]: https://github.com/DataDog/puppet-datadog-agent/issues/156 + [#158]: https://github.com/DataDog/puppet-datadog-agent/issues/158 + [#161]: https://github.com/DataDog/puppet-datadog-agent/issues/161 + [#164]: https://github.com/DataDog/puppet-datadog-agent/issues/164 + [#168]: https://github.com/DataDog/puppet-datadog-agent/issues/168 + [#169]: https://github.com/DataDog/puppet-datadog-agent/issues/169 + [#173]: https://github.com/DataDog/puppet-datadog-agent/issues/173 + [#174]: https://github.com/DataDog/puppet-datadog-agent/issues/174 + [#175]: https://github.com/DataDog/puppet-datadog-agent/issues/175 + [#176]: https://github.com/DataDog/puppet-datadog-agent/issues/176 + [#183]: https://github.com/DataDog/puppet-datadog-agent/issues/183 + [#186]: https://github.com/DataDog/puppet-datadog-agent/issues/186 + [#187]: https://github.com/DataDog/puppet-datadog-agent/issues/187 + [#188]: https://github.com/DataDog/puppet-datadog-agent/issues/188 + [#189]: https://github.com/DataDog/puppet-datadog-agent/issues/189 + [#195]: https://github.com/DataDog/puppet-datadog-agent/issues/195 + [#197]: https://github.com/DataDog/puppet-datadog-agent/issues/197 + [#202]: https://github.com/DataDog/puppet-datadog-agent/issues/202 + [#203]: https://github.com/DataDog/puppet-datadog-agent/issues/203 + [#204]: https://github.com/DataDog/puppet-datadog-agent/issues/204 + [#205]: https://github.com/DataDog/puppet-datadog-agent/issues/205 + [#207]: https://github.com/DataDog/puppet-datadog-agent/issues/207 + [#208]: https://github.com/DataDog/puppet-datadog-agent/issues/208 + [#209]: https://github.com/DataDog/puppet-datadog-agent/issues/209 + [#210]: https://github.com/DataDog/puppet-datadog-agent/issues/210 + [#211]: https://github.com/DataDog/puppet-datadog-agent/issues/211 + [#212]: https://github.com/DataDog/puppet-datadog-agent/issues/212 + [#213]: https://github.com/DataDog/puppet-datadog-agent/issues/213 + [#214]: https://github.com/DataDog/puppet-datadog-agent/issues/214 + [#215]: https://github.com/DataDog/puppet-datadog-agent/issues/215 + [#216]: https://github.com/DataDog/puppet-datadog-agent/issues/216 + [#217]: https://github.com/DataDog/puppet-datadog-agent/issues/217 + [#219]: https://github.com/DataDog/puppet-datadog-agent/issues/219 + [#222]: https://github.com/DataDog/puppet-datadog-agent/issues/222 + [#223]: https://github.com/DataDog/puppet-datadog-agent/issues/223 + [#224]: https://github.com/DataDog/puppet-datadog-agent/issues/224 + [#231]: https://github.com/DataDog/puppet-datadog-agent/issues/231 + [#232]: https://github.com/DataDog/puppet-datadog-agent/issues/232 + [#233]: https://github.com/DataDog/puppet-datadog-agent/issues/233 + [#242]: https://github.com/DataDog/puppet-datadog-agent/issues/242 + [#243]: https://github.com/DataDog/puppet-datadog-agent/issues/243 + [#247]: https://github.com/DataDog/puppet-datadog-agent/issues/247 + [#252]: https://github.com/DataDog/puppet-datadog-agent/issues/252 + [#256]: https://github.com/DataDog/puppet-datadog-agent/issues/256 + [#258]: https://github.com/DataDog/puppet-datadog-agent/issues/258 + [#259]: https://github.com/DataDog/puppet-datadog-agent/issues/259 + [#261]: https://github.com/DataDog/puppet-datadog-agent/issues/261 + [#263]: https://github.com/DataDog/puppet-datadog-agent/issues/263 + [#264]: https://github.com/DataDog/puppet-datadog-agent/issues/264 + [#266]: https://github.com/DataDog/puppet-datadog-agent/issues/266 + [#267]: https://github.com/DataDog/puppet-datadog-agent/issues/267 + [#276]: https://github.com/DataDog/puppet-datadog-agent/issues/276 + [#279]: https://github.com/DataDog/puppet-datadog-agent/issues/279 + [#280]: https://github.com/DataDog/puppet-datadog-agent/issues/280 + [#281]: https://github.com/DataDog/puppet-datadog-agent/issues/281 + [#282]: https://github.com/DataDog/puppet-datadog-agent/issues/282 + [#283]: https://github.com/DataDog/puppet-datadog-agent/issues/283 + [#286]: https://github.com/DataDog/puppet-datadog-agent/issues/286 + [#288]: https://github.com/DataDog/puppet-datadog-agent/issues/288 + [#290]: https://github.com/DataDog/puppet-datadog-agent/issues/290 + [#291]: https://github.com/DataDog/puppet-datadog-agent/issues/291 + [#292]: https://github.com/DataDog/puppet-datadog-agent/issues/292 + [#293]: https://github.com/DataDog/puppet-datadog-agent/issues/293 + [#296]: https://github.com/DataDog/puppet-datadog-agent/issues/296 + [#297]: https://github.com/DataDog/puppet-datadog-agent/issues/297 + [#299]: https://github.com/DataDog/puppet-datadog-agent/issues/299 + [#302]: https://github.com/DataDog/puppet-datadog-agent/issues/302 + [#309]: https://github.com/DataDog/puppet-datadog-agent/issues/309 + [#310]: https://github.com/DataDog/puppet-datadog-agent/issues/310 + [#311]: https://github.com/DataDog/puppet-datadog-agent/issues/311 + [#313]: https://github.com/DataDog/puppet-datadog-agent/issues/313 + [#315]: https://github.com/DataDog/puppet-datadog-agent/issues/315 + [#316]: https://github.com/DataDog/puppet-datadog-agent/issues/316 + [#318]: https://github.com/DataDog/puppet-datadog-agent/issues/318 + [#322]: https://github.com/DataDog/puppet-datadog-agent/issues/322 + [#323]: https://github.com/DataDog/puppet-datadog-agent/issues/323 + [#325]: https://github.com/DataDog/puppet-datadog-agent/issues/325 + [#326]: https://github.com/DataDog/puppet-datadog-agent/issues/326 + [#327]: https://github.com/DataDog/puppet-datadog-agent/issues/327 + [#329]: https://github.com/DataDog/puppet-datadog-agent/issues/329 + [#331]: https://github.com/DataDog/puppet-datadog-agent/issues/331 + [#332]: https://github.com/DataDog/puppet-datadog-agent/issues/332 + [#333]: https://github.com/DataDog/puppet-datadog-agent/issues/333 + [#334]: https://github.com/DataDog/puppet-datadog-agent/issues/334 + [#335]: https://github.com/DataDog/puppet-datadog-agent/issues/335 + [#336]: https://github.com/DataDog/puppet-datadog-agent/issues/336 + [#338]: https://github.com/DataDog/puppet-datadog-agent/issues/338 + [#340]: https://github.com/DataDog/puppet-datadog-agent/issues/340 + [#341]: https://github.com/DataDog/puppet-datadog-agent/issues/341 + [#343]: https://github.com/DataDog/puppet-datadog-agent/issues/343 + [#346]: https://github.com/DataDog/puppet-datadog-agent/issues/346 + [#347]: https://github.com/DataDog/puppet-datadog-agent/issues/347 + [#352]: https://github.com/DataDog/puppet-datadog-agent/issues/352 + [#356]: https://github.com/DataDog/puppet-datadog-agent/issues/356 + [#357]: https://github.com/DataDog/puppet-datadog-agent/issues/357 + [#359]: https://github.com/DataDog/puppet-datadog-agent/issues/359 + [#361]: https://github.com/DataDog/puppet-datadog-agent/issues/361 + [#362]: https://github.com/DataDog/puppet-datadog-agent/issues/362 + [#369]: https://github.com/DataDog/puppet-datadog-agent/issues/369 + [#370]: https://github.com/DataDog/puppet-datadog-agent/issues/370 + [#373]: https://github.com/DataDog/puppet-datadog-agent/issues/373 + [#374]: https://github.com/DataDog/puppet-datadog-agent/issues/374 + [#375]: https://github.com/DataDog/puppet-datadog-agent/issues/375 + [#376]: https://github.com/DataDog/puppet-datadog-agent/issues/376 + [#377]: https://github.com/DataDog/puppet-datadog-agent/issues/377 + [#378]: https://github.com/DataDog/puppet-datadog-agent/issues/378 + [#379]: https://github.com/DataDog/puppet-datadog-agent/issues/379 + [#381]: https://github.com/DataDog/puppet-datadog-agent/issues/381 + [#384]: https://github.com/DataDog/puppet-datadog-agent/issues/384 + [#387]: https://github.com/DataDog/puppet-datadog-agent/issues/387 + [#389]: https://github.com/DataDog/puppet-datadog-agent/issues/389 + [#390]: https://github.com/DataDog/puppet-datadog-agent/issues/390 + [#391]: https://github.com/DataDog/puppet-datadog-agent/issues/391 + [#394]: https://github.com/DataDog/puppet-datadog-agent/issues/394 + [#395]: https://github.com/DataDog/puppet-datadog-agent/issues/395 + [#397]: https://github.com/DataDog/puppet-datadog-agent/issues/397 + [#401]: https://github.com/DataDog/puppet-datadog-agent/issues/401 + [#403]: https://github.com/DataDog/puppet-datadog-agent/issues/403 + [#404]: https://github.com/DataDog/puppet-datadog-agent/issues/404 + [#406]: https://github.com/DataDog/puppet-datadog-agent/issues/406 + [#408]: https://github.com/DataDog/puppet-datadog-agent/issues/408 + [#411]: https://github.com/DataDog/puppet-datadog-agent/issues/411 + [#412]: https://github.com/DataDog/puppet-datadog-agent/issues/412 + [#417]: https://github.com/DataDog/puppet-datadog-agent/issues/417 + [#418]: https://github.com/DataDog/puppet-datadog-agent/issues/418 + [#420]: https://github.com/DataDog/puppet-datadog-agent/issues/420 + [#424]: https://github.com/DataDog/puppet-datadog-agent/issues/424 + [#426]: https://github.com/DataDog/puppet-datadog-agent/issues/426 + [#427]: https://github.com/DataDog/puppet-datadog-agent/issues/427 + [#431]: https://github.com/DataDog/puppet-datadog-agent/issues/431 + [#433]: https://github.com/DataDog/puppet-datadog-agent/issues/433 + [#437]: https://github.com/DataDog/puppet-datadog-agent/issues/437 + [#438]: https://github.com/DataDog/puppet-datadog-agent/issues/438 + [#439]: https://github.com/DataDog/puppet-datadog-agent/issues/439 + [#443]: https://github.com/DataDog/puppet-datadog-agent/issues/443 + [#444]: https://github.com/DataDog/puppet-datadog-agent/issues/444 + [#445]: https://github.com/DataDog/puppet-datadog-agent/issues/445 + [#446]: https://github.com/DataDog/puppet-datadog-agent/issues/446 + [#449]: https://github.com/DataDog/puppet-datadog-agent/issues/449 + [#455]: https://github.com/DataDog/puppet-datadog-agent/issues/455 + [#462]: https://github.com/DataDog/puppet-datadog-agent/issues/462 + [#463]: https://github.com/DataDog/puppet-datadog-agent/issues/463 + [#464]: https://github.com/DataDog/puppet-datadog-agent/issues/464 + [#466]: https://github.com/DataDog/puppet-datadog-agent/issues/466 + [#468]: https://github.com/DataDog/puppet-datadog-agent/issues/468 + [#470]: https://github.com/DataDog/puppet-datadog-agent/issues/470 + [#471]: https://github.com/DataDog/puppet-datadog-agent/issues/471 + [#472]: https://github.com/DataDog/puppet-datadog-agent/issues/472 + [#473]: https://github.com/DataDog/puppet-datadog-agent/issues/473 + [#475]: https://github.com/DataDog/puppet-datadog-agent/issues/475 + [#481]: https://github.com/DataDog/puppet-datadog-agent/issues/481 + [#482]: https://github.com/DataDog/puppet-datadog-agent/issues/482 + [#484]: https://github.com/DataDog/puppet-datadog-agent/issues/484 + [#485]: https://github.com/DataDog/puppet-datadog-agent/issues/485 + [#486]: https://github.com/DataDog/puppet-datadog-agent/issues/486 + [#487]: https://github.com/DataDog/puppet-datadog-agent/issues/487 + [#490]: https://github.com/DataDog/puppet-datadog-agent/issues/490 + [#492]: https://github.com/DataDog/puppet-datadog-agent/issues/492 + [#493]: https://github.com/DataDog/puppet-datadog-agent/issues/493 + [#496]: https://github.com/DataDog/puppet-datadog-agent/issues/496 + [#498]: https://github.com/DataDog/puppet-datadog-agent/issues/498 + [#501]: https://github.com/DataDog/puppet-datadog-agent/issues/501 + [#502]: https://github.com/DataDog/puppet-datadog-agent/issues/502 + [#503]: https://github.com/DataDog/puppet-datadog-agent/issues/503 + [#504]: https://github.com/DataDog/puppet-datadog-agent/issues/504 + [#506]: https://github.com/DataDog/puppet-datadog-agent/issues/506 + [#507]: https://github.com/DataDog/puppet-datadog-agent/issues/507 + [#508]: https://github.com/DataDog/puppet-datadog-agent/issues/508 + [#511]: https://github.com/DataDog/puppet-datadog-agent/issues/511 + [#513]: https://github.com/DataDog/puppet-datadog-agent/issues/513 + [#514]: https://github.com/DataDog/puppet-datadog-agent/issues/514 + [#515]: https://github.com/DataDog/puppet-datadog-agent/issues/515 + [#516]: https://github.com/DataDog/puppet-datadog-agent/issues/516 + [#519]: https://github.com/DataDog/puppet-datadog-agent/issues/519 + [#520]: https://github.com/DataDog/puppet-datadog-agent/issues/520 + [#521]: https://github.com/DataDog/puppet-datadog-agent/issues/521 + [#524]: https://github.com/DataDog/puppet-datadog-agent/issues/524 + [#525]: https://github.com/DataDog/puppet-datadog-agent/issues/525 + [#527]: https://github.com/DataDog/puppet-datadog-agent/issues/527 + [#528]: https://github.com/DataDog/puppet-datadog-agent/issues/528 + [#533]: https://github.com/DataDog/puppet-datadog-agent/issues/533 + [#534]: https://github.com/DataDog/puppet-datadog-agent/issues/534 + [#537]: https://github.com/DataDog/puppet-datadog-agent/issues/537 + [#544]: https://github.com/DataDog/puppet-datadog-agent/issues/544 + [#545]: https://github.com/DataDog/puppet-datadog-agent/issues/545 + [#548]: https://github.com/DataDog/puppet-datadog-agent/issues/548 + [#551]: https://github.com/DataDog/puppet-datadog-agent/issues/551 + [#555]: https://github.com/DataDog/puppet-datadog-agent/issues/555 + [#556]: https://github.com/DataDog/puppet-datadog-agent/issues/556 + [#557]: https://github.com/DataDog/puppet-datadog-agent/issues/557 + [#558]: https://github.com/DataDog/puppet-datadog-agent/issues/558 + [#562]: https://github.com/DataDog/puppet-datadog-agent/issues/562 + [#571]: https://github.com/DataDog/puppet-datadog-agent/issues/571 + [#572]: https://github.com/DataDog/puppet-datadog-agent/issues/572 + [#574]: https://github.com/DataDog/puppet-datadog-agent/issues/574 + [#576]: https://github.com/DataDog/puppet-datadog-agent/issues/576 + [#578]: https://github.com/DataDog/puppet-datadog-agent/issues/578 + [#581]: https://github.com/DataDog/puppet-datadog-agent/issues/581 + [#584]: https://github.com/DataDog/puppet-datadog-agent/issues/584 + [#587]: https://github.com/DataDog/puppet-datadog-agent/issues/587 + [#588]: https://github.com/DataDog/puppet-datadog-agent/issues/588 + [#591]: https://github.com/DataDog/puppet-datadog-agent/issues/591 + [#596]: https://github.com/DataDog/puppet-datadog-agent/issues/596 + [#597]: https://github.com/DataDog/puppet-datadog-agent/issues/597 + [#598]: https://github.com/DataDog/puppet-datadog-agent/issues/598 + [#599]: https://github.com/DataDog/puppet-datadog-agent/issues/599 + [#608]: https://github.com/DataDog/puppet-datadog-agent/issues/608 + [#613]: https://github.com/DataDog/puppet-datadog-agent/issues/613 + [#615]: https://github.com/DataDog/puppet-datadog-agent/issues/615 + [#616]: https://github.com/DataDog/puppet-datadog-agent/issues/616 + [#621]: https://github.com/DataDog/puppet-datadog-agent/issues/621 + [#622]: https://github.com/DataDog/puppet-datadog-agent/issues/622 + [#624]: https://github.com/DataDog/puppet-datadog-agent/issues/624 + [#626]: https://github.com/DataDog/puppet-datadog-agent/issues/626 + [#628]: https://github.com/DataDog/puppet-datadog-agent/issues/628 + [#630]: https://github.com/DataDog/puppet-datadog-agent/issues/630 + [#633]: https://github.com/DataDog/puppet-datadog-agent/issues/633 + [#636]: https://github.com/DataDog/puppet-datadog-agent/issues/636 + [#639]: https://github.com/DataDog/puppet-datadog-agent/issues/639 + [#641]: https://github.com/DataDog/puppet-datadog-agent/issues/641 + [#643]: https://github.com/DataDog/puppet-datadog-agent/issues/643 + [#653]: https://github.com/DataDog/puppet-datadog-agent/issues/653 + [#654]: https://github.com/DataDog/puppet-datadog-agent/issues/654 + [#656]: https://github.com/DataDog/puppet-datadog-agent/issues/656 + [#658]: https://github.com/DataDog/puppet-datadog-agent/issues/658 + [#661]: https://github.com/DataDog/puppet-datadog-agent/issues/661 + [#662]: https://github.com/DataDog/puppet-datadog-agent/issues/662 + [#664]: https://github.com/DataDog/puppet-datadog-agent/issues/664 + [#666]: https://github.com/DataDog/puppet-datadog-agent/issues/666 + [#667]: https://github.com/DataDog/puppet-datadog-agent/issues/667 + [#672]: https://github.com/DataDog/puppet-datadog-agent/issues/672 + [#675]: https://github.com/DataDog/puppet-datadog-agent/issues/675 + [#677]: https://github.com/DataDog/puppet-datadog-agent/issues/677 + [#679]: https://github.com/DataDog/puppet-datadog-agent/issues/679 + [#681]: https://github.com/DataDog/puppet-datadog-agent/issues/681 + [#682]: https://github.com/DataDog/puppet-datadog-agent/issues/682 + [#686]: https://github.com/DataDog/puppet-datadog-agent/issues/686 + [#687]: https://github.com/DataDog/puppet-datadog-agent/issues/687 + [#688]: https://github.com/DataDog/puppet-datadog-agent/issues/688 + [#690]: https://github.com/DataDog/puppet-datadog-agent/issues/690 + [#692]: https://github.com/DataDog/puppet-datadog-agent/issues/692 + [#693]: https://github.com/DataDog/puppet-datadog-agent/issues/693 + [#696]: https://github.com/DataDog/puppet-datadog-agent/issues/696 + [#697]: https://github.com/DataDog/puppet-datadog-agent/issues/697 + [#698]: https://github.com/DataDog/puppet-datadog-agent/issues/698 + [#699]: https://github.com/DataDog/puppet-datadog-agent/issues/699 + [#700]: https://github.com/DataDog/puppet-datadog-agent/issues/700 + [#701]: https://github.com/DataDog/puppet-datadog-agent/issues/701 + [#703]: https://github.com/DataDog/puppet-datadog-agent/issues/703 + [#706]: https://github.com/DataDog/puppet-datadog-agent/issues/706 + [#709]: https://github.com/DataDog/puppet-datadog-agent/issues/709 + [#712]: https://github.com/DataDog/puppet-datadog-agent/issues/712 + [#714]: https://github.com/DataDog/puppet-datadog-agent/issues/714 + [#719]: https://github.com/DataDog/puppet-datadog-agent/issues/719 + [#721]: https://github.com/DataDog/puppet-datadog-agent/issues/721 + [#725]: https://github.com/DataDog/puppet-datadog-agent/issues/725 + [#726]: https://github.com/DataDog/puppet-datadog-agent/issues/726 + [#728]: https://github.com/DataDog/puppet-datadog-agent/issues/728 + [#732]: https://github.com/DataDog/puppet-datadog-agent/issues/732 + [#733]: https://github.com/DataDog/puppet-datadog-agent/issues/733 + [#741]: https://github.com/DataDog/puppet-datadog-agent/issues/741 + [#746]: https://github.com/DataDog/puppet-datadog-agent/issues/746 + [#748]: https://github.com/DataDog/puppet-datadog-agent/issues/748 + [#751]: https://github.com/DataDog/puppet-datadog-agent/issues/751 + [#752]: https://github.com/DataDog/puppet-datadog-agent/issues/752 + [#755]: https://github.com/DataDog/puppet-datadog-agent/issues/755 + [#756]: https://github.com/DataDog/puppet-datadog-agent/issues/756 + [#761]: https://github.com/DataDog/puppet-datadog-agent/issues/761 + [#770]: https://github.com/DataDog/puppet-datadog-agent/issues/770 + [#779]: https://github.com/DataDog/puppet-datadog-agent/issues/779 + [#782]: https://github.com/DataDog/puppet-datadog-agent/issues/782 + [#785]: https://github.com/DataDog/puppet-datadog-agent/issues/785 + [#789]: https://github.com/DataDog/puppet-datadog-agent/issues/789 + [#790]: https://github.com/DataDog/puppet-datadog-agent/issues/790 + [#798]: https://github.com/DataDog/puppet-datadog-agent/issues/798 + [#799]: https://github.com/DataDog/puppet-datadog-agent/issues/799 + [#800]: https://github.com/DataDog/puppet-datadog-agent/issues/800 + [#806]: https://github.com/DataDog/puppet-datadog-agent/issues/806 + [#814]: https://github.com/DataDog/puppet-datadog-agent/issues/814 + [#820]: https://github.com/DataDog/puppet-datadog-agent/issues/820 + [#821]: https://github.com/DataDog/puppet-datadog-agent/issues/821 + [#824]: https://github.com/DataDog/puppet-datadog-agent/issues/824 + [#835]: https://github.com/DataDog/puppet-datadog-agent/issues/835 + [@Aramack]: https://github.com/Aramack + [@BIAndrews]: https://github.com/BIAndrews + [@ChannoneArif-nbcuni]: https://github.com/ChannoneArif-nbcuni + [@ColinHebert]: https://github.com/ColinHebert + [@ColinHerbert]: https://github.com/ColinHerbert + [@DDRBoxman]: https://github.com/DDRBoxman + [@IanCrouch]: https://github.com/IanCrouch + [@LeoCavaille]: https://github.com/LeoCavaille + [@MartinDelta]: https://github.com/MartinDelta + [@Mstrodl]: https://github.com/Mstrodl + [@NoodlesNZ]: https://github.com/NoodlesNZ + [@aaron-miller]: https://github.com/aaron-miller + [@aepod]: https://github.com/aepod + [@ajvb]: https://github.com/ajvb + [@albertollamaso]: https://github.com/albertollamaso + [@alexberry]: https://github.com/alexberry + [@alexfouche]: https://github.com/alexfouche + [@alexharv074]: https://github.com/alexharv074 + [@alvin-huang]: https://github.com/alvin-huang + [@ardichoke]: https://github.com/ardichoke + [@arkpoah]: https://github.com/arkpoah + [@asenci]: https://github.com/asenci + [@atayts]: https://github.com/atayts + [@b2jrock]: https://github.com/b2jrock + [@bflad]: https://github.com/bflad + [@binford2k]: https://github.com/binford2k + [@bit-herder]: https://github.com/bit-herder + [@bittner]: https://github.com/bittner + [@butangero]: https://github.com/butangero + [@cabrinha]: https://github.com/cabrinha + [@charles-ferguson]: https://github.com/charles-ferguson + [@ckolos]: https://github.com/ckolos + [@cocker-cc]: https://github.com/cocker-cc + [@com6056]: https://github.com/com6056 + [@craigwatson]: https://github.com/craigwatson + [@cristianjuve]: https://github.com/cristianjuve + [@cwood]: https://github.com/cwood + [@damonmaria]: https://github.com/damonmaria + [@dan70402]: https://github.com/dan70402 + [@davejrt]: https://github.com/davejrt + [@davidgibbons]: https://github.com/davidgibbons + [@dbednall]: https://github.com/dbednall + [@degemer]: https://github.com/degemer + [@denmat]: https://github.com/denmat + [@devinmatte]: https://github.com/devinmatte + [@diogokiss]: https://github.com/diogokiss + [@djova]: https://github.com/djova + [@dorg-kanderson]: https://github.com/dorg-kanderson + [@dpricha89]: https://github.com/dpricha89 + [@dschaaff]: https://github.com/dschaaff + [@dzinek]: https://github.com/dzinek + [@eddmann]: https://github.com/eddmann + [@erik-frontify]: https://github.com/erik-frontify + [@evansj]: https://github.com/evansj + [@ewansteele]: https://github.com/ewansteele + [@ffleming]: https://github.com/ffleming + [@ffrants]: https://github.com/ffrants + [@florusboth]: https://github.com/florusboth + [@flyinbutrs]: https://github.com/flyinbutrs + [@flyinprogrammer]: https://github.com/flyinprogrammer + [@fr3nd]: https://github.com/fr3nd + [@fwelschen]: https://github.com/fwelschen + [@fzwart]: https://github.com/fzwart + [@generica]: https://github.com/generica + [@gotyaio]: https://github.com/gotyaio + [@grubernaut]: https://github.com/grubernaut + [@jabbate19]: https://github.com/jabbate19 + [@jacobbednarz]: https://github.com/jacobbednarz + [@jadams-av]: https://github.com/jadams-av + [@jameynelson]: https://github.com/jameynelson + [@jangie]: https://github.com/jangie + [@jcarr-sailthru]: https://github.com/jcarr-sailthru + [@jdavisp3]: https://github.com/jdavisp3 + [@jensendw]: https://github.com/jensendw + [@jfrost]: https://github.com/jfrost + [@jniesen]: https://github.com/jniesen + [@jubagarie]: https://github.com/jubagarie + [@jvanbrunschot]: https://github.com/jvanbrunschot + [@kevin-bowers]: https://github.com/kevin-bowers + [@kitchen]: https://github.com/kitchen + [@lowkeyshift]: https://github.com/lowkeyshift + [@mcasper]: https://github.com/mcasper + [@milescrabill]: https://github.com/milescrabill + [@mraylu]: https://github.com/mraylu + [@mrunkel-ut]: https://github.com/mrunkel-ut + [@mtougeron]: https://github.com/mtougeron + [@murdok5]: https://github.com/murdok5 + [@npaufler]: https://github.com/npaufler + [@o0oxid]: https://github.com/o0oxid + [@obi11235]: https://github.com/obi11235 + [@obowersa]: https://github.com/obowersa + [@oshmyrko]: https://github.com/oshmyrko + [@pabrahamsson]: https://github.com/pabrahamsson + [@paulhamby]: https://github.com/paulhamby + [@pid1]: https://github.com/pid1 + [@pulkitsethi]: https://github.com/pulkitsethi + [@rgergo]: https://github.com/rgergo + [@rmrf-run]: https://github.com/rmrf-run + [@rooprob]: https://github.com/rooprob + [@rothgar]: https://github.com/rothgar + [@rtyler]: https://github.com/rtyler + [@rud]: https://github.com/rud + [@ryan-dyer-sp]: https://github.com/ryan-dyer-sp + [@sambanks]: https://github.com/sambanks + [@samueljamesmarshall]: https://github.com/samueljamesmarshall + [@scottgeary]: https://github.com/scottgeary + [@sethcleveland]: https://github.com/sethcleveland + [@siebrand]: https://github.com/siebrand + [@skiedude]: https://github.com/skiedude + [@spectralblu]: https://github.com/spectralblu + [@stamak]: https://github.com/stamak + [@stantona]: https://github.com/stantona + [@swwolf]: https://github.com/swwolf + [@szponek]: https://github.com/szponek + [@tdm4]: https://github.com/tdm4 + [@teintuc]: https://github.com/teintuc + [@tommoyangn]: https://github.com/tommoyangn + [@turnopil]: https://github.com/turnopil + [@tuxinaut]: https://github.com/tuxinaut + [@vaisingh]: https://github.com/vaisingh + [@yanjunding]: https://github.com/yanjunding + [@yrcjaya]: https://github.com/yrcjaya + [@zabacad]: https://github.com/zabacad + [@zickzackv]: https://github.com/zickzackv + [@zoom-kris-anderson]: https://github.com/zoom-kris-anderson diff --git a/README.md b/README.md index 86fe3d249..f39d31b1c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ This module installs the Datadog Agent and sends Puppet reports to Datadog. ### Requirements -The Datadog Puppet module supports Linux and Windows and is compatible with Puppet >= 4.6.x or Puppet Enterprise version >= 2016.4. For detailed information on compatibility, check the [module page on Puppet Forge][1]. +The Datadog Puppet module supports Linux and Windows and is compatible with Puppet >= 7.34.x or Puppet Enterprise +version >= 2021.7.x. For detailed information on compatibility, check the [module page on Puppet Forge][1]. ### Installation @@ -16,17 +17,25 @@ puppet module install datadog-datadog_agent #### Upgrading -- By default Datadog Agent v7.x is installed. To use an earlier Agent version, change the setting `agent_major_version`. -- `agent5_enable` is no longer used, as it has been replaced by `agent_major_version`. -- `agent6_extra_options` has been renamed to `agent_extra_options` since it applies to both Agent v6 and v7. -- `agent6_log_file` has been renamed to `agent_log_file` since it applies to both Agent v6 and v7. -- `agent5_repo_uri` and `agent6_repo_uri` become `agent_repo_uri` for all Agent versions. -- `conf_dir` and `conf6_dir` become `conf_dir` for all Agent versions. -- The repository file created on Linux is named `datadog` for all Agent versions instead of `datadog5`/`datadog6`. +> [!IMPORTANT] +> The Datadog Puppet Module v4.x drops support for Puppet <= 6 and Datadog Agent v5. To upgrade or install the Datadog +> Agent v5+ on Puppet <= 6, use module v3.x. + +- By default Datadog Agent v7.x is installed. To use Agent version 6, change the setting `agent_major_version`. +- Agent v5-specific legacy options have been removed. Refer to the CHANGELOG.md for more details and the datadog_agent class comments for all available options. +- Configuration options for the following integrations have been updated: + - ElasticSearch + - `ssl_verify` accepts only Boolean values + - `tls_verify`options have been added + - PostgreSQL + - `custom_metrics` option has been removed. Use `custom_queries` instead. + - TCP Check + - `skip_event` option has been removed sinced Datadog Agent v6.4+ ### Configuration -Once the `datadog_agent` module is installed on your `puppetserver`/`puppetmaster` (or on a masterless host), follow these configuration steps: +Once the `datadog_agent` module is installed on your `puppetserver`/`puppetmaster` (or on a masterless host), follow +these configuration steps: 1. Obtain your [Datadog API key][2]. 2. Add the Datadog class to your node manifests (eg: `/etc/puppetlabs/code/environments/production/manifests/site.pp`). @@ -37,7 +46,7 @@ Once the `datadog_agent` module is installed on your `puppetserver`/`puppetmaste } ``` - If using a Datadog site other than the default 'datadoghq.com', set it here as well: + If using a Datadog site other than the default 'datadoghq.com', set it here as well: ```conf class { 'datadog_agent': @@ -46,7 +55,7 @@ Once the `datadog_agent` module is installed on your `puppetserver`/`puppetmaste } ``` - For CentOS/RHEL versions <7.0 and for Ubuntu < 15.04, specify the service provider as `upstart`: + For CentOS/RHEL versions <7.0 and for Ubuntu < 15.04, specify the service provider as `upstart`: ```conf class { 'datadog_agent': @@ -55,9 +64,10 @@ Once the `datadog_agent` module is installed on your `puppetserver`/`puppetmaste } ``` - See the [Configuration variables](#configuration-variables) section for list of arguments you can use here. + See the [Configuration variables](#configuration-variables) section for list of arguments you can use here. -4. (Optional) Include any integrations you want to use with the Agent. The following example installs the mongo integration: +4. (Optional) Include any integrations you want to use with the Agent. The following example installs the mongo + integration: ```conf class { 'datadog_agent::integrations::mongo': @@ -65,9 +75,10 @@ Once the `datadog_agent` module is installed on your `puppetserver`/`puppetmaste } ``` - See the [comments in code][6] for all arguments available for a given integration. + See the [comments in code][6] for all arguments available for a given integration. - If an integration does not have a [manifest with a dedicated class][7], you can still add a configuration for it. Below is an example for the `ntp` check: + If an integration does not have a [manifest with a dedicated class][7], you can still add a configuration for it. + Below is an example for the `ntp` check: ```conf class { 'datadog_agent': @@ -87,7 +98,8 @@ Once the `datadog_agent` module is installed on your `puppetserver`/`puppetmaste ### Upgrading integrations -To install and pin specific integration versions, use `datadog_agent::install_integration`. This calls the `datadog-agent integration` command to ensure a specific integration is installed or uninstalled, for example: +To install and pin specific integration versions, use `datadog_agent::install_integration`. This calls the +`datadog-agent integration` command to ensure a specific integration is installed or uninstalled, for example: ```conf datadog_agent::install_integration { "mongo-1.9": @@ -109,7 +121,8 @@ Note it's not possible to downgrade an integration to a version older than the o ### Reporting -To enable reporting of Puppet runs to your Datadog timeline, enable the report processor on your Puppet master and reporting for your clients. The clients send a run report after each check-in back to the master. +To enable reporting of Puppet runs to your Datadog timeline, enable the report processor on your Puppet master and +reporting for your clients. The clients send a run report after each check-in back to the master. 1. Set the `puppet_run_reports` option to true in the node configuration manifest for your master: @@ -121,7 +134,8 @@ To enable reporting of Puppet runs to your Datadog timeline, enable the report p } ``` - The dogapi gem is automatically installed. Set `manage_dogapi_gem` to false if you want to customize the installation. + The dogapi gem is automatically installed. Set `manage_dogapi_gem` to false if you want to customize the + installation. 2. Add these configuration options to the Puppet master config (eg: `/etc/puppetlabs/puppet/puppet.conf`): @@ -183,14 +197,23 @@ With the [`ini_setting` module](https://forge.puppet.com/modules/puppetlabs/inif 4. (Optional) Enable tagging of reports with facts: - You can add tags to reports that are sent to Datadog as events. These tags can be sourced from Puppet facts for the given node the report is regarding. These should be 1:1 and not involve structured facts (hashes, arrays, etc.) to ensure readability. To enable regular fact tagging, set the parameter `datadog_agent::reports::report_fact_tags` to the array value of facts—for example `["virtual","operatingsystem"]`. To enable trusted fact tagging, set the parameter `datadog_agent::reports::report_trusted_fact_tags` to the array value of facts—for example `["certname","extensions.pp_role","hostname"]`. + You can add tags to reports that are sent to Datadog as events. These tags can be sourced from Puppet facts for the + given node the report is regarding. These should be 1:1 and not involve structured facts (hashes, arrays, etc.) to + ensure readability. To enable regular fact tagging, set the parameter `datadog_agent::reports::report_fact_tags` to + the array value of facts—for example `["virtual","operatingsystem"]`. To enable trusted fact tagging, set the + parameter `datadog_agent::reports::report_trusted_fact_tags` to the array value of facts—for example + `["certname","extensions.pp_role","hostname"]`. - NOTE: Changing these settings requires a restart of pe-puppetserver (or puppetserver) to re-read the report processor. Ensure the changes are deployed prior to restarting the service(s). + NOTE: Changing these settings requires a restart of pe-puppetserver (or puppetserver) to re-read the report + processor. Ensure the changes are deployed prior to restarting the service(s). - Tips: - - Use dot index to specify a target fact; otherwise, the entire fact data set becomes the value as a string (not very useful) - - Do not duplicate common data from monitoring like hostname, uptime, memory, etc. - - Coordinate core facts like role, owner, template, datacenter, etc., that help you build meaningful correlations to the same tags from metrics + Tips: + +- Use dot index to specify a target fact; otherwise, the entire fact data set becomes the value as a string (not + very useful) +- Do not duplicate common data from monitoring like hostname, uptime, memory, etc. +- Coordinate core facts like role, owner, template, datacenter, etc., that help you build meaningful correlations to + the same tags from metrics 5. Verify your Puppet data is in Datadog by searching for `sources:puppet` in the [Event Stream][5]. @@ -198,8 +221,10 @@ With the [`ini_setting` module](https://forge.puppet.com/modules/puppetlabs/inif To enable the Datadog Agent Network Performance Monitoring (NPM) features follow these steps: -1. (Windows only) If the Agent is already installed, uninstall it by passing `win_ensure => absent` to the main class and removing other classes' definitions. -2. (Windows only) Pass the `windows_npm_install` option with value `true` to the `datadog::datadog_agent` class. Remove `win_ensure` if added on previous step. +1. (Windows only) If the Agent is already installed, uninstall it by passing `win_ensure => absent` to the main class + and removing other classes' definitions. +2. (Windows only) Pass the `windows_npm_install` option with value `true` to the `datadog::datadog_agent` class. Remove + `win_ensure` if added on previous step. 3. Use the `datadog_agent::system_probe` class to properly create the configuration file: ```conf @@ -210,7 +235,8 @@ class { 'datadog_agent::system_probe': ### USM setup -To enable the Datadog Agent Universal Service Monitoring (USM) use the `datadog_agent::system_probe` class to properly create the configuration file: +To enable the Datadog Agent Universal Service Monitoring (USM) use the `datadog_agent::system_probe` class to properly +create the configuration file: ```conf class { 'datadog_agent::system_probe': @@ -264,14 +290,17 @@ If you don't see any reports coming in, check your Puppet server logs. ### Tagging client nodes -The Datadog Agent configuration file is recreated from the template every Puppet run. If you need to tag your nodes, add an array entry in Hiera: +The Datadog Agent configuration file is recreated from the template every Puppet run. If you need to tag your nodes, add +an array entry in Hiera: ```conf datadog_agent::tags: - 'keyname:value' - 'anotherkey:%{factname}' ``` -To generate tags from custom facts classify your nodes with Puppet facts as an array to the ```facts_to_tags``` paramter either through the Puppet Enterprise console or Hiera. Here is an example: + +To generate tags from custom facts classify your nodes with Puppet facts as an array to the ```facts_to_tags``` paramter +either through the Puppet Enterprise console or Hiera. Here is an example: ```conf class { "datadog_agent": @@ -282,24 +311,27 @@ class { "datadog_agent": Tips: -1. For structured facts index into the specific fact value otherwise the entire array comes over as a string and ultimately be difficult to use. -2. Dynamic facts such as CPU usage, Uptime, and others that are expected to change each run are not ideal for tagging. Static facts that are expected to stay for the life of a node are best candidates for tagging. +1. For structured facts index into the specific fact value otherwise the entire array comes over as a string and + ultimately be difficult to use. +2. Dynamic facts such as CPU usage, Uptime, and others that are expected to change each run are not ideal for tagging. + Static facts that are expected to stay for the life of a node are best candidates for tagging. ### Configuration variables -These variables can be set in the `datadog_agent` class to control settings in the Agent. See the [comments in code][8] for the full list of supported arguments. +These variables can be set in the `datadog_agent` class to control settings in the Agent. See the [comments in code][8] +for the full list of supported arguments. | variable name | description | |-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `agent_major_version` | The version of the Agent to install: either 5, 6 or 7 (default: 7). | +| `agent_major_version` | The version of the Agent to install: either 6 or 7 (default: 7). | | `agent_version` | Lets you pin a specific minor version of the Agent to install, for example: `1:7.16.0-1`. Leave empty to install the latest version. | | `collect_ec2_tags` | Collect an instance's custom EC2 tags as Agent tags by using `true`. | | `collect_instance_metadata` | Collect an instance's EC2 metadata as Agent tags by using `true`. | -| `datadog_site` | The Datadog site to report to (Agent v6 and v7 only). Defaults to `datadoghq.com`, eg: `datadoghq.eu` or `us3.datadoghq.com`. | +| `datadog_site` | The Datadog site to report to. Defaults to `datadoghq.com`, eg: `datadoghq.eu` or `us3.datadoghq.com`. | | `dd_url` | The Datadog intake server URL. You are unlikely to need to change this. Overrides `datadog_site` | | `host` | Overrides the node's host name. | | `local_tags` | An array of `` strings that are set as tags for the node. | -| `non_local_traffic` | Allow other nodes to relay their traffic through this node. | +| `non_local_traffic` | Allow other nodes to relay their DogstatsD traffic through this node. | | `apm_enabled` | A boolean to enable the APM Agent (defaults to false). | | `process_enabled` | A boolean to enable the process Agent (defaults to false). | | `scrub_args` | A boolean to enable the process cmdline scrubbing (defaults to true). | @@ -311,7 +343,8 @@ These variables can be set in the `datadog_agent` class to control settings in t | `agent_extra_options`1 | A hash to provide additional configuration options (Agent v6 and v7 only). | | `hostname_extraction_regex`2 | A regex used to extract the hostname captured group to report the run in Datadog instead of reporting the Puppet nodename, for example:
`'^(?.*\.datadoghq\.com)(\.i-\w{8}\..*)?$'` | -(1) `agent_extra_options` is used to provide a fine grain control of additional Agent v6/v7 config options. A deep merge is performed that may override options provided in the `datadog_agent` class parameters. For example: +(1) `agent_extra_options` is used to provide a fine grain control of additional Agent v6/v7 config options. A deep merge +is performed that may override options provided in the `datadog_agent` class parameters. For example: ``` class { "datadog_agent": @@ -324,13 +357,21 @@ class { "datadog_agent": } ``` -(2) `hostname_extraction_regex` is useful when the Puppet module and the Datadog Agent are reporting different host names for the same host in the infrastructure list. +(2) `hostname_extraction_regex` is useful when the Puppet module and the Datadog Agent are reporting different host +names for the same host in the infrastructure list. [1]: https://forge.puppet.com/datadog/datadog_agent + [2]: https://app.datadoghq.com/organization-settings/api-keys + [3]: https://github.com/DataDog/dogapi-rb + [4]: https://app.datadoghq.com/account/settings#integrations + [5]: https://app.datadoghq.com/event/stream + [6]: https://github.com/DataDog/puppet-datadog-agent/blob/master/manifests/integrations/mongo.pp + [7]: https://github.com/DataDog/puppet-datadog-agent/tree/master/manifests/integrations + [8]: https://github.com/DataDog/puppet-datadog-agent/blob/master/manifests/init.pp diff --git a/manifests/init.pp b/manifests/init.pp index ab9e712b2..f4fdf417f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -49,9 +49,6 @@ # $non_local_traffic # Enable you to use the agent as a proxy. Defaults to false. # See https://github.com/DataDog/dd-agent/wiki/Proxy-Configuration -# $dogstreams -# Optional array of logs to parse and custom parsers to use. -# See https://github.com/DataDog/dd-agent/blob/ed5e698/datadog.conf.example#L149-L178 # $log_level # Set value of 'log_level' variable. Default is 'info' as in dd-agent. # Valid values here are: critical, debug, error, fatal, info, warn and warning. @@ -92,8 +89,6 @@ # separate way of adding keys. # $skip_ssl_validation # Skip SSL validation. -# $use_curl_http_client -# Uses the curl HTTP client for the forwarder # $recent_point_threshold # Sets the threshold for accepting points. # String. Default: empty (30 second intervals) @@ -147,12 +142,6 @@ # $device_blacklist_re # Specifies pattern for device blacklisting. # String. Default: empty -# $dogstreams -# Specifies port for list of logstreams/modules to be used. -# String. Default: empty -# $custom_emitters -# Specifies a comma seperated list of non standard emitters to be used -# String. Default: empty # $agent_log_file # Specifies the log file location (Agent 6 and 7 only). # String. Default: empty @@ -288,7 +277,6 @@ String $puppetmaster_user = $settings::user, String $puppet_gem_provider = $datadog_agent::params::gem_provider, Boolean $non_local_traffic = false, - Array $dogstreams = [], String $log_level = 'info', Boolean $log_to_syslog = true, String $service_ensure = 'running', @@ -314,7 +302,6 @@ String $extra_template = '', Boolean $skip_ssl_validation = false, Boolean $skip_apt_key_trusting = false, - Boolean $use_curl_http_client = false, String $recent_point_threshold = '', Variant[Stdlib::Port, Pattern[/^\d*$/]] $listen_port = '', Optional[String] $additional_checksd = undef, @@ -328,7 +315,6 @@ String $dogstatsd_interval = '', Boolean $dogstatsd_normalize = true, String $device_blacklist_re = '', - String $custom_emitters = '', String $agent_log_file = $datadog_agent::params::agent_log_file, String $collector_log_file = '', String $forwarder_log_file = '', diff --git a/templates/datadog_footer.conf.erb b/templates/datadog_footer.conf.erb index c926f039c..9bf4bb35b 100644 --- a/templates/datadog_footer.conf.erb +++ b/templates/datadog_footer.conf.erb @@ -27,13 +27,6 @@ recent_point_threshold: <%= @recent_point_threshold %> listen_port: <%= @listen_port %> <% end -%> -# Start a graphite listener on this port -<% if @graphite_listen_port.to_s.empty? -%> -# graphite_listen_port: 17124 -<% else -%> -graphite_listen_port: <%= @graphite_listen_port %> -<% end -%> - # Additional directory to look for Datadog checks <% if @additional_checksd.nil? -%> # additional_checksd: /etc/dd-agent/checks.d/ @@ -48,10 +41,6 @@ additional_checksd: <%= @additional_checksd %> # https://github.com/DataDog/dd-agent/wiki/Network-Traffic-and-Proxy-Configuration non_local_traffic: <%= @non_local_traffic %> -# Select the Tornado HTTP Client in the forwarder -# Default to the simple http client -use_curl_http_client: <%= @use_curl_http_client %> - # The loopback address the Forwarder and Dogstatsd will bind. # Optional, it is mainly used when running the agent on Openshift <% if @bind_host.empty? -%> @@ -162,61 +151,6 @@ statsd_forward_port: <%= @statsd_forward_port %> device_blacklist_re: <%= @device_blacklist_re %> <% end -%> -# -------------------------------------------------------------------------- # -# Dogstream (log file parser) -# -------------------------------------------------------------------------- # - -# Comma-separated list of logs to parse and optionally custom parsers to use. -# The form should look like this: -# -# dogstreams: /path/to/log1:parsers_module:custom_parser, /path/to/log2, /path/to/log3, ... -# -# Or this: -# -# dogstreams: /path/to/log1:/path/to/my/parsers_module.py:custom_parser, /path/to/log2, /path/to/log3, ... -# -# Each entry is a path to a log file and optionally a Python module/function pair -# separated by colons. -# -# Custom parsers should take a 2 parameters, a logger object and -# a string parameter of the current line to parse. It should return a tuple of -# the form: -# (metric (str), timestamp (unix timestamp), value (float), attributes (dict)) -# where attributes should at least contain the key 'metric_type', specifying -# whether the given metric is a 'counter' or 'gauge'. -# -# Unless parsers are specified with an absolute path, the modules must exist in -# the Agent's PYTHONPATH. You can set this as an environment variable when -# starting the Agent. If the name of the custom parser function is not passed, -# 'parser' is assumed. -# -# If this value isn't specified, the default parser assumes this log format: -# metric timestamp value key0=val0 key1=val1 ... -# -<% -if not @dogstreams.empty? --%> -dogstreams: <%= @dogstreams.join(', ') %> -<% end -%> - -# ========================================================================== # -# Custom Emitters # -# ========================================================================== # - -# Comma-separated list of emitters to be used in addition to the standard one -# -# Expected to be passed as a comma-separated list of colon-delimited -# name/object pairs. -# -<% if @custom_emitters.empty? -%> -# custom_emitters: /usr/local/my-code/emitters/rabbitmq.py:RabbitMQEmitter -<% else -%> -custom_emitters: <%= @custom_emitters %> -<% end -%> -# -# If the name of the emitter function is not specified, 'emitter' is assumed. - - # ========================================================================== # # Logging # ========================================================================== # From e998581935daa15f42ae2df305f87f2545c7cfa1 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 7 Mar 2025 11:16:34 -0500 Subject: [PATCH 128/133] fix changelog, readme --- CHANGELOG.md | 471 +++------------------------------------------------ README.md | 85 +++------- 2 files changed, 45 insertions(+), 511 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c75b970ef..396c30fda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,8 +38,7 @@ could break existing implementations. * [FEATURE] Add support for Datadog installer on Linux systems ([#820]) * [DEPRECATE] Deprecate CentOS 6 to 7.51.1 maximum and install only relevant gpg keys on redhat based systems ([#806]) * [SANITY] Remove a duplicate parameter in the documentation ([#799])(thanks [@albertollamaso]) -* [FEATURE] Allow defining `apm_filter_tags` and `apm_filter_tags_regex` to filter traces/spans ([#798])( - thanks [@erik-frontify]) +* [FEATURE] Allow defining `apm_filter_tags` and `apm_filter_tags_regex` to filter traces/spans ([#798])(thanks [@erik-frontify]) # 3.22.0 / 2023-11-15 @@ -96,8 +95,7 @@ could break existing implementations. * [BUGFIX] Do not add process integration configuration file if not configured ([#703][]) (Thanks [@yanjunding][]) * [FEATURE] add support for `min_collection_interval` for HTTP check ([#699][]) (Thanks [@yanjunding][]) * [FEATURE] Improvements for APT keys management ([#698][], [#700][], [#701][] and [#714][]) -* [FEATURE] Include 'datadog_agent' class in the catalog when using the generic integration ([#697][]) ( - Thanks [@stantona][]) +* [FEATURE] Include 'datadog_agent' class in the catalog when using the generic integration ([#697][]) (Thanks [@stantona][]) * [BUGFIX] Update `excluded_interface_re` type to String ([#696][]) (Thanks [@florusboth][]) # 3.12.0 / 2021-05-06 @@ -173,10 +171,8 @@ could break existing implementations. # 3.1.0 / 2020-01-14 * [FEATURE] Accept the same version string in Debian/Ubuntu than in other OSes when pinning the Agent. See [#591][] -* [FEATURE] Add the `check_hostname` and `ssl_server_name` parameters to the `http_check` integration. See [#599][] ( - Thanks [@asenci][]) -* [BUGFIX] Remove include from `system_probe.pp` that caused error "This Function Call is unacceptable as a top level - construct in this location" on recent Puppet versions. See [#596][] (thanks again [@asenci][]) +* [FEATURE] Add the `check_hostname` and `ssl_server_name` parameters to the `http_check` integration. See [#599][] (Thanks [@asenci][]) +* [BUGFIX] Remove include from `system_probe.pp` that caused error "This Function Call is unacceptable as a top level construct in this location" on recent Puppet versions. See [#596][] (thanks again [@asenci][]) * [BUGFIX] Fix broken `facts_to_tags` on Agent 5. See [#598][] * [CHORE] Migrate project to PDK (Puppet Development Kit). See [#597][] @@ -232,10 +228,8 @@ then it is safe to upgrade. * [FEATURE] Initial Windows support. See [#557][] * [FEATURE] Add ignore_ssl_warning to HTTP check. See [#556][] (Thanks [@zabacad][]) * [FEATURE] Add logs_open_files_limit parameter [#548][]. (Thanks [@rmrf-run][]) -* [BUGFIX] Fix a warning caused by calling `validate_legacy` with the default `additional_checksd` value of `undef`. - See [#551][]. -* [BUGFIX] Fix Redis integration, where tags weren't evaluated when the keys param was empty. See [#558][] ( - Thanks [@jubagarie][]) +* [BUGFIX] Fix a warning caused by calling `validate_legacy` with the default `additional_checksd` value of `undef`. See [#551][]. +* [BUGFIX] Fix Redis integration, where tags weren't evaluated when the keys param was empty. See [#558][] (Thanks [@jubagarie][]) * [DOCUMENTATION] Fix doc for HTTP check include_content. See [#555][] (Thanks [@zabacad][]) # 2.7.0 / 2019-07-11 @@ -244,8 +238,7 @@ then it is safe to upgrade. * [FEATURE] Support puppet 6. See [#537][] * [FEATURE] Added a define that wraps the agent integration command. See [#534][] -* [BUGFIX] Add whitespace surpression to redisdb.yaml.erb to ensure a valid yaml. See [#533][] (Thanks - again [@Aramack][]) +* [BUGFIX] Add whitespace surpression to redisdb.yaml.erb to ensure a valid yaml. See [#533][] (Thanks again [@Aramack][]) * [BUGFIX] Do not include additional_checksd if not set. See [#545][] (Thanks [@turnopil][]) * [IMPROVEMENT] Raise if hostname_extraction_regex doesn't capture hostname. See [#544][] @@ -259,8 +252,7 @@ then it is safe to upgrade. * [FEATURE] Redis: adding multi-instance support. See [#520][] * [FEATURE] HTTP check: add support for `method`, `data` configuration. See [#515][] (Thanks [@Aramack][]) * [FEATURE] HTTP check: add reverse content-match support. See [#524][] (Thanks [@dorg-kanderson][]) -* [BUGFIX] Agent 6: track integration configuration directories - fixes `conf_dir_purge`. See [#525][] ( - Thanks [@Aramack][]) +* [BUGFIX] Agent 6: track integration configuration directories - fixes `conf_dir_purge`. See [#525][] (Thanks [@Aramack][]) * [BUGFIX] Agent 6: fixes `additional_checksd` not appearing in agent config. See [#513][] (Thanks [@gotyaio][]) * [BUGFIX] Postgres: allow setting password in Hiera. See [#514][] (Thanks [@cabrinha][]) * [BUGFIX] Redis: fix trying to call `empty?` on an integer on template. See [#527][] @@ -363,8 +355,7 @@ then it is safe to upgrade. * [BUGFIX] Stdlib: fix deprecations after stdlib 4.24.0. See [#403][] and [#404][] (Thanks [@teintuc][]) * [BUGFIX] RHEL: stop specifying service resource provider `redhat`. See [#401][] (Thanks [@milescrabill][]) * [IMPROVEMENT] Add types to multiple manifest parameters. See [#404][] -* [COMPATIBILITY] Drop puppetlabs-apt dependency lower bound to `2.4.0`. See [#404][] and 400 ( - Thanks [@samueljamesmarshall][]) +* [COMPATIBILITY] Drop puppetlabs-apt dependency lower bound to `2.4.0`. See [#404][] and 400 (Thanks [@samueljamesmarshall][]) # 2.0.1 / 2018-02-28 @@ -395,8 +386,7 @@ Please read the [docs]() for more details. ### Notes -* [MAJOR] Datadog agent defaults to 6.x. Puppet >=4.6. See [#387][] - and [docs](https://github.com/DataDog/puppet-datadog-agent/blob/master/README.md) +* [MAJOR] Datadog agent defaults to 6.x. Puppet >=4.6. See [#387][] and [docs](https://github.com/DataDog/puppet-datadog-agent/blob/master/README.md) * [FEATURE] Postgresl: adding SSL parameter support. See [#391][] (thanks [@com6056][]) * [FEATURE] Docker_daemon: parametrize integration. See [#378][] (thanks [@flyinprogrammer][]) * [FEATURE] Kafka: added support for multiple instances. See [#343][], [#395][] (thanks [@jensendw][]) @@ -493,13 +483,11 @@ Please read the [docs]() for more details. * [BUGFIX] Reporting: allow the report processor to run on Puppet Enterprise. See [#266][]. (Thanks [@binford2k][]). * [BUGFIX] RHEL/CentOS: Fix gpg and test binary paths. See [#259][]. (Thanks [@sethcleveland][]). * [BUGFIX] NTP: fix template. See [#280][]. (Thanks [@MartinDelta][]). -* [BUGFIX] Multiple integrations: swapped order of optional vs. non-optional parameters. See [#232][]. ( - Thanks [@sethcleveland][]). +* [BUGFIX] Multiple integrations: swapped order of optional vs. non-optional parameters. See [#232][]. (Thanks [@sethcleveland][]). * [IMPROVEMENT] [rpm+deb] repo keys rotated. See [#242][]. * [IMPROVEMENT] MySQL: Allow multiple MySQL instances See [#267][]. (Thanks [@IanCrouch][]). -* [IMPROVEMENT] Http check: `allow_redirects` + `check_certificate_expiration` improvement. See [#282][]. ( - Thanks [@cristianjuve][]). +* [IMPROVEMENT] Http check: `allow_redirects` + `check_certificate_expiration` improvement. See [#282][]. (Thanks [@cristianjuve][]). * [IMPROVEMENT] Http_check: update to include new attributes. See [#276][]. (Thanks [@aepod][]). * [IMPROVEMENT] Http_check: set disable_ssl_validation parameter. See [#258][]. * [IMPROVEMENT] Postgres: support generic postgres custom metrics. See [#224][]. (Thanks [@sethcleveland][]). @@ -567,22 +555,18 @@ Please read the [docs]() for more details. * [FEATURE] Added manifest for PGBouncer. See [#175][]. (Thanks [@mcasper][]). * [FEATURE] Added manifest for Consul. See [#174][]. (Thanks [@flyinprogrammer][]). -* [FEATURE] Added mesos master and slave manifests for individual management. See [#174][]. (Thanks [@flyinprogrammer][] - and [@jangie][]). -* [FEATURE] Added option to extract the hostname from puppet hostname strings with a regex capture group. - See [#173][]. (Thanks [@LeoCavaille][]). +* [FEATURE] Added mesos master and slave manifests for individual management. See [#174][]. (Thanks [@flyinprogrammer][] and [@jangie][]). +* [FEATURE] Added option to extract the hostname from puppet hostname strings with a regex capture group. See [#173][]. (Thanks [@LeoCavaille][]). * [FEATURE] Added support on multiple ports per host on Redis integration. See [#169][]. (Thanks [@fzwart][]). * [FEATURE] Added support for `disable_ssl_validation` on Apache integration. See[#171. (Thanks [@BIAndrews][]). -* [FEATURE] Added support for SSL, additional metrics and database connection in Mongo integration. See [#164][]. ( - Thanks [@bflad][]). +* [FEATURE] Added support for SSL, additional metrics and database connection in Mongo integration. See [#164][]. (Thanks [@bflad][]). * [FEATURE] Added support for multiple instance in HTTP check. See [#155][]. (Thanks [@jniesen][]). * [FEATURE] Added support for multiple new datadog.conf directives. See [#79][]. (Thanks [@obowersa][]). * [FEATURE] Decouple yum repo from agent package. See [#168][]. (Thanks [@b2jrock][]). * [IMPROVEMENT] Moved GPG key to its own parameter. See [#158][]. (Thanks [@davidgibbons][]). -* [BUFIX] Updated docker to use more current `docker_daemon`. See [#174][]. (Thanks [@flyinprogrammer][] - and [@jangie][]). +* [BUFIX] Updated docker to use more current `docker_daemon`. See [#174][]. (Thanks [@flyinprogrammer][] and [@jangie][]). * [DEPRECATE] Deprecated old docker manifest. See [#174][]. (Thanks [@flyinprogrammer][]). * [DEPRECATE] Deprecated `new_tag_names` in `docker_daemon` manifest. See [#176][]. @@ -600,8 +584,7 @@ Please read the [docs]() for more details. * [BIGFIX] Use ensure_packages(), to be more polite about apt-transport-https. See [#154][]. (Thanks [@rtyler][]). * [BUGFIX] Fixed Zookeeper template. See [#150][] (Thanks [@tuxinaut][]). -* [BUGFIX] Raised priority of `changed` event types to normal - they'll now show in Datadog UI. See [#156][]. ( - Thanks [@rtyler][]). +* [BUGFIX] Raised priority of `changed` event types to normal - they'll now show in Datadog UI. See [#156][]. (Thanks [@rtyler][]). * [BUGFIX] Require stdlib >=4.6 (provide `validate_integer()`). See [#161][]. (Thanks [@mrunkel-ut][]). * [CI] Testable up to puppet 4.2. See [#161][]. (Thanks [@grubernaut][]). @@ -646,7 +629,7 @@ Please read the [docs]() for more details. * [FEATURE] Add `sock` parameter in MySQL integration * [FEATURE] Add support for graphite listener option in the main class * [FEATURE] Add NTP integration -* [FEATURE] Add support for dogstreams array in the main class +* [FEATURE] Add support for dogstreams array in the main class * [FEATURE] Add HAProxy integration * [FEATURE] Add RabbitMQ integration * [FEATURE] Add support for an extra template appended to datadog.conf @@ -671,8 +654,7 @@ Please read the [docs]() for more details. * [FEATURE] Add proxy options in the base datadog_agent class * [BUGFIX] Use correct JMX-styled tags in JMX integrations -> Careful this means that you probably have to update a buggy array of tags (that gives you nothing in the agent) to a -> hash of tags. +> Careful this means that you probably have to update a buggy array of tags (that gives you nothing in the agent) to a hash of tags. * [BUGFIX] Fix ordering in YAML templates using `to_yaml` broken because of ruby 1.8 * [CI] Add boilerpate for specs and linting rake tasks @@ -701,833 +683,418 @@ Please read the [docs]() for more details. [docs]: https://github.com/DataDog/puppet-datadog-agent/blob/master/README.md - [#79]: https://github.com/DataDog/puppet-datadog-agent/issues/79 - [#139]: https://github.com/DataDog/puppet-datadog-agent/issues/139 - [#145]: https://github.com/DataDog/puppet-datadog-agent/issues/145 - [#149]: https://github.com/DataDog/puppet-datadog-agent/issues/149 - [#150]: https://github.com/DataDog/puppet-datadog-agent/issues/150 - [#154]: https://github.com/DataDog/puppet-datadog-agent/issues/154 - [#155]: https://github.com/DataDog/puppet-datadog-agent/issues/155 - [#156]: https://github.com/DataDog/puppet-datadog-agent/issues/156 - [#158]: https://github.com/DataDog/puppet-datadog-agent/issues/158 - [#161]: https://github.com/DataDog/puppet-datadog-agent/issues/161 - [#164]: https://github.com/DataDog/puppet-datadog-agent/issues/164 - [#168]: https://github.com/DataDog/puppet-datadog-agent/issues/168 - [#169]: https://github.com/DataDog/puppet-datadog-agent/issues/169 - [#173]: https://github.com/DataDog/puppet-datadog-agent/issues/173 - [#174]: https://github.com/DataDog/puppet-datadog-agent/issues/174 - [#175]: https://github.com/DataDog/puppet-datadog-agent/issues/175 - [#176]: https://github.com/DataDog/puppet-datadog-agent/issues/176 - [#183]: https://github.com/DataDog/puppet-datadog-agent/issues/183 - [#186]: https://github.com/DataDog/puppet-datadog-agent/issues/186 - [#187]: https://github.com/DataDog/puppet-datadog-agent/issues/187 - [#188]: https://github.com/DataDog/puppet-datadog-agent/issues/188 - [#189]: https://github.com/DataDog/puppet-datadog-agent/issues/189 - [#195]: https://github.com/DataDog/puppet-datadog-agent/issues/195 - [#197]: https://github.com/DataDog/puppet-datadog-agent/issues/197 - [#202]: https://github.com/DataDog/puppet-datadog-agent/issues/202 - [#203]: https://github.com/DataDog/puppet-datadog-agent/issues/203 - [#204]: https://github.com/DataDog/puppet-datadog-agent/issues/204 - [#205]: https://github.com/DataDog/puppet-datadog-agent/issues/205 - [#207]: https://github.com/DataDog/puppet-datadog-agent/issues/207 - [#208]: https://github.com/DataDog/puppet-datadog-agent/issues/208 - [#209]: https://github.com/DataDog/puppet-datadog-agent/issues/209 - [#210]: https://github.com/DataDog/puppet-datadog-agent/issues/210 - [#211]: https://github.com/DataDog/puppet-datadog-agent/issues/211 - [#212]: https://github.com/DataDog/puppet-datadog-agent/issues/212 - [#213]: https://github.com/DataDog/puppet-datadog-agent/issues/213 - [#214]: https://github.com/DataDog/puppet-datadog-agent/issues/214 - [#215]: https://github.com/DataDog/puppet-datadog-agent/issues/215 - [#216]: https://github.com/DataDog/puppet-datadog-agent/issues/216 - [#217]: https://github.com/DataDog/puppet-datadog-agent/issues/217 - [#219]: https://github.com/DataDog/puppet-datadog-agent/issues/219 - [#222]: https://github.com/DataDog/puppet-datadog-agent/issues/222 - [#223]: https://github.com/DataDog/puppet-datadog-agent/issues/223 - [#224]: https://github.com/DataDog/puppet-datadog-agent/issues/224 - [#231]: https://github.com/DataDog/puppet-datadog-agent/issues/231 - [#232]: https://github.com/DataDog/puppet-datadog-agent/issues/232 - [#233]: https://github.com/DataDog/puppet-datadog-agent/issues/233 - [#242]: https://github.com/DataDog/puppet-datadog-agent/issues/242 - [#243]: https://github.com/DataDog/puppet-datadog-agent/issues/243 - [#247]: https://github.com/DataDog/puppet-datadog-agent/issues/247 - [#252]: https://github.com/DataDog/puppet-datadog-agent/issues/252 - [#256]: https://github.com/DataDog/puppet-datadog-agent/issues/256 - [#258]: https://github.com/DataDog/puppet-datadog-agent/issues/258 - [#259]: https://github.com/DataDog/puppet-datadog-agent/issues/259 - [#261]: https://github.com/DataDog/puppet-datadog-agent/issues/261 - [#263]: https://github.com/DataDog/puppet-datadog-agent/issues/263 - [#264]: https://github.com/DataDog/puppet-datadog-agent/issues/264 - [#266]: https://github.com/DataDog/puppet-datadog-agent/issues/266 - [#267]: https://github.com/DataDog/puppet-datadog-agent/issues/267 - [#276]: https://github.com/DataDog/puppet-datadog-agent/issues/276 - [#279]: https://github.com/DataDog/puppet-datadog-agent/issues/279 - [#280]: https://github.com/DataDog/puppet-datadog-agent/issues/280 - [#281]: https://github.com/DataDog/puppet-datadog-agent/issues/281 - [#282]: https://github.com/DataDog/puppet-datadog-agent/issues/282 - [#283]: https://github.com/DataDog/puppet-datadog-agent/issues/283 - [#286]: https://github.com/DataDog/puppet-datadog-agent/issues/286 - [#288]: https://github.com/DataDog/puppet-datadog-agent/issues/288 - [#290]: https://github.com/DataDog/puppet-datadog-agent/issues/290 - [#291]: https://github.com/DataDog/puppet-datadog-agent/issues/291 - [#292]: https://github.com/DataDog/puppet-datadog-agent/issues/292 - [#293]: https://github.com/DataDog/puppet-datadog-agent/issues/293 - [#296]: https://github.com/DataDog/puppet-datadog-agent/issues/296 - [#297]: https://github.com/DataDog/puppet-datadog-agent/issues/297 - [#299]: https://github.com/DataDog/puppet-datadog-agent/issues/299 - [#302]: https://github.com/DataDog/puppet-datadog-agent/issues/302 - [#309]: https://github.com/DataDog/puppet-datadog-agent/issues/309 - [#310]: https://github.com/DataDog/puppet-datadog-agent/issues/310 - [#311]: https://github.com/DataDog/puppet-datadog-agent/issues/311 - [#313]: https://github.com/DataDog/puppet-datadog-agent/issues/313 - [#315]: https://github.com/DataDog/puppet-datadog-agent/issues/315 - [#316]: https://github.com/DataDog/puppet-datadog-agent/issues/316 - [#318]: https://github.com/DataDog/puppet-datadog-agent/issues/318 - [#322]: https://github.com/DataDog/puppet-datadog-agent/issues/322 - [#323]: https://github.com/DataDog/puppet-datadog-agent/issues/323 - [#325]: https://github.com/DataDog/puppet-datadog-agent/issues/325 - [#326]: https://github.com/DataDog/puppet-datadog-agent/issues/326 - [#327]: https://github.com/DataDog/puppet-datadog-agent/issues/327 - [#329]: https://github.com/DataDog/puppet-datadog-agent/issues/329 - [#331]: https://github.com/DataDog/puppet-datadog-agent/issues/331 - [#332]: https://github.com/DataDog/puppet-datadog-agent/issues/332 - [#333]: https://github.com/DataDog/puppet-datadog-agent/issues/333 - [#334]: https://github.com/DataDog/puppet-datadog-agent/issues/334 - [#335]: https://github.com/DataDog/puppet-datadog-agent/issues/335 - [#336]: https://github.com/DataDog/puppet-datadog-agent/issues/336 - [#338]: https://github.com/DataDog/puppet-datadog-agent/issues/338 - [#340]: https://github.com/DataDog/puppet-datadog-agent/issues/340 - [#341]: https://github.com/DataDog/puppet-datadog-agent/issues/341 - [#343]: https://github.com/DataDog/puppet-datadog-agent/issues/343 - [#346]: https://github.com/DataDog/puppet-datadog-agent/issues/346 - [#347]: https://github.com/DataDog/puppet-datadog-agent/issues/347 - [#352]: https://github.com/DataDog/puppet-datadog-agent/issues/352 - [#356]: https://github.com/DataDog/puppet-datadog-agent/issues/356 - [#357]: https://github.com/DataDog/puppet-datadog-agent/issues/357 - [#359]: https://github.com/DataDog/puppet-datadog-agent/issues/359 - [#361]: https://github.com/DataDog/puppet-datadog-agent/issues/361 - [#362]: https://github.com/DataDog/puppet-datadog-agent/issues/362 - [#369]: https://github.com/DataDog/puppet-datadog-agent/issues/369 - [#370]: https://github.com/DataDog/puppet-datadog-agent/issues/370 - [#373]: https://github.com/DataDog/puppet-datadog-agent/issues/373 - [#374]: https://github.com/DataDog/puppet-datadog-agent/issues/374 - [#375]: https://github.com/DataDog/puppet-datadog-agent/issues/375 - [#376]: https://github.com/DataDog/puppet-datadog-agent/issues/376 - [#377]: https://github.com/DataDog/puppet-datadog-agent/issues/377 - [#378]: https://github.com/DataDog/puppet-datadog-agent/issues/378 - [#379]: https://github.com/DataDog/puppet-datadog-agent/issues/379 - [#381]: https://github.com/DataDog/puppet-datadog-agent/issues/381 - [#384]: https://github.com/DataDog/puppet-datadog-agent/issues/384 - [#387]: https://github.com/DataDog/puppet-datadog-agent/issues/387 - [#389]: https://github.com/DataDog/puppet-datadog-agent/issues/389 - [#390]: https://github.com/DataDog/puppet-datadog-agent/issues/390 - [#391]: https://github.com/DataDog/puppet-datadog-agent/issues/391 - [#394]: https://github.com/DataDog/puppet-datadog-agent/issues/394 - [#395]: https://github.com/DataDog/puppet-datadog-agent/issues/395 - [#397]: https://github.com/DataDog/puppet-datadog-agent/issues/397 - [#401]: https://github.com/DataDog/puppet-datadog-agent/issues/401 - [#403]: https://github.com/DataDog/puppet-datadog-agent/issues/403 - [#404]: https://github.com/DataDog/puppet-datadog-agent/issues/404 - [#406]: https://github.com/DataDog/puppet-datadog-agent/issues/406 - [#408]: https://github.com/DataDog/puppet-datadog-agent/issues/408 - [#411]: https://github.com/DataDog/puppet-datadog-agent/issues/411 - [#412]: https://github.com/DataDog/puppet-datadog-agent/issues/412 - [#417]: https://github.com/DataDog/puppet-datadog-agent/issues/417 - [#418]: https://github.com/DataDog/puppet-datadog-agent/issues/418 - [#420]: https://github.com/DataDog/puppet-datadog-agent/issues/420 - [#424]: https://github.com/DataDog/puppet-datadog-agent/issues/424 - [#426]: https://github.com/DataDog/puppet-datadog-agent/issues/426 - [#427]: https://github.com/DataDog/puppet-datadog-agent/issues/427 - [#431]: https://github.com/DataDog/puppet-datadog-agent/issues/431 - [#433]: https://github.com/DataDog/puppet-datadog-agent/issues/433 - [#437]: https://github.com/DataDog/puppet-datadog-agent/issues/437 - [#438]: https://github.com/DataDog/puppet-datadog-agent/issues/438 - [#439]: https://github.com/DataDog/puppet-datadog-agent/issues/439 - [#443]: https://github.com/DataDog/puppet-datadog-agent/issues/443 - [#444]: https://github.com/DataDog/puppet-datadog-agent/issues/444 - [#445]: https://github.com/DataDog/puppet-datadog-agent/issues/445 - [#446]: https://github.com/DataDog/puppet-datadog-agent/issues/446 - [#449]: https://github.com/DataDog/puppet-datadog-agent/issues/449 - [#455]: https://github.com/DataDog/puppet-datadog-agent/issues/455 - [#462]: https://github.com/DataDog/puppet-datadog-agent/issues/462 - [#463]: https://github.com/DataDog/puppet-datadog-agent/issues/463 - [#464]: https://github.com/DataDog/puppet-datadog-agent/issues/464 - [#466]: https://github.com/DataDog/puppet-datadog-agent/issues/466 - [#468]: https://github.com/DataDog/puppet-datadog-agent/issues/468 - [#470]: https://github.com/DataDog/puppet-datadog-agent/issues/470 - [#471]: https://github.com/DataDog/puppet-datadog-agent/issues/471 - [#472]: https://github.com/DataDog/puppet-datadog-agent/issues/472 - [#473]: https://github.com/DataDog/puppet-datadog-agent/issues/473 - [#475]: https://github.com/DataDog/puppet-datadog-agent/issues/475 - [#481]: https://github.com/DataDog/puppet-datadog-agent/issues/481 - [#482]: https://github.com/DataDog/puppet-datadog-agent/issues/482 - [#484]: https://github.com/DataDog/puppet-datadog-agent/issues/484 - [#485]: https://github.com/DataDog/puppet-datadog-agent/issues/485 - [#486]: https://github.com/DataDog/puppet-datadog-agent/issues/486 - [#487]: https://github.com/DataDog/puppet-datadog-agent/issues/487 - [#490]: https://github.com/DataDog/puppet-datadog-agent/issues/490 - [#492]: https://github.com/DataDog/puppet-datadog-agent/issues/492 - [#493]: https://github.com/DataDog/puppet-datadog-agent/issues/493 - [#496]: https://github.com/DataDog/puppet-datadog-agent/issues/496 - [#498]: https://github.com/DataDog/puppet-datadog-agent/issues/498 - [#501]: https://github.com/DataDog/puppet-datadog-agent/issues/501 - [#502]: https://github.com/DataDog/puppet-datadog-agent/issues/502 - [#503]: https://github.com/DataDog/puppet-datadog-agent/issues/503 - [#504]: https://github.com/DataDog/puppet-datadog-agent/issues/504 - [#506]: https://github.com/DataDog/puppet-datadog-agent/issues/506 - [#507]: https://github.com/DataDog/puppet-datadog-agent/issues/507 - [#508]: https://github.com/DataDog/puppet-datadog-agent/issues/508 - [#511]: https://github.com/DataDog/puppet-datadog-agent/issues/511 - [#513]: https://github.com/DataDog/puppet-datadog-agent/issues/513 - [#514]: https://github.com/DataDog/puppet-datadog-agent/issues/514 - [#515]: https://github.com/DataDog/puppet-datadog-agent/issues/515 - [#516]: https://github.com/DataDog/puppet-datadog-agent/issues/516 - [#519]: https://github.com/DataDog/puppet-datadog-agent/issues/519 - [#520]: https://github.com/DataDog/puppet-datadog-agent/issues/520 - [#521]: https://github.com/DataDog/puppet-datadog-agent/issues/521 - [#524]: https://github.com/DataDog/puppet-datadog-agent/issues/524 - [#525]: https://github.com/DataDog/puppet-datadog-agent/issues/525 - [#527]: https://github.com/DataDog/puppet-datadog-agent/issues/527 - [#528]: https://github.com/DataDog/puppet-datadog-agent/issues/528 - [#533]: https://github.com/DataDog/puppet-datadog-agent/issues/533 - [#534]: https://github.com/DataDog/puppet-datadog-agent/issues/534 - [#537]: https://github.com/DataDog/puppet-datadog-agent/issues/537 - [#544]: https://github.com/DataDog/puppet-datadog-agent/issues/544 - [#545]: https://github.com/DataDog/puppet-datadog-agent/issues/545 - [#548]: https://github.com/DataDog/puppet-datadog-agent/issues/548 - [#551]: https://github.com/DataDog/puppet-datadog-agent/issues/551 - [#555]: https://github.com/DataDog/puppet-datadog-agent/issues/555 - [#556]: https://github.com/DataDog/puppet-datadog-agent/issues/556 - [#557]: https://github.com/DataDog/puppet-datadog-agent/issues/557 - [#558]: https://github.com/DataDog/puppet-datadog-agent/issues/558 - [#562]: https://github.com/DataDog/puppet-datadog-agent/issues/562 - [#571]: https://github.com/DataDog/puppet-datadog-agent/issues/571 - [#572]: https://github.com/DataDog/puppet-datadog-agent/issues/572 - [#574]: https://github.com/DataDog/puppet-datadog-agent/issues/574 - [#576]: https://github.com/DataDog/puppet-datadog-agent/issues/576 - [#578]: https://github.com/DataDog/puppet-datadog-agent/issues/578 - [#581]: https://github.com/DataDog/puppet-datadog-agent/issues/581 - [#584]: https://github.com/DataDog/puppet-datadog-agent/issues/584 - [#587]: https://github.com/DataDog/puppet-datadog-agent/issues/587 - [#588]: https://github.com/DataDog/puppet-datadog-agent/issues/588 - [#591]: https://github.com/DataDog/puppet-datadog-agent/issues/591 - [#596]: https://github.com/DataDog/puppet-datadog-agent/issues/596 - [#597]: https://github.com/DataDog/puppet-datadog-agent/issues/597 - [#598]: https://github.com/DataDog/puppet-datadog-agent/issues/598 - [#599]: https://github.com/DataDog/puppet-datadog-agent/issues/599 - [#608]: https://github.com/DataDog/puppet-datadog-agent/issues/608 - [#613]: https://github.com/DataDog/puppet-datadog-agent/issues/613 - [#615]: https://github.com/DataDog/puppet-datadog-agent/issues/615 - [#616]: https://github.com/DataDog/puppet-datadog-agent/issues/616 - [#621]: https://github.com/DataDog/puppet-datadog-agent/issues/621 - [#622]: https://github.com/DataDog/puppet-datadog-agent/issues/622 - [#624]: https://github.com/DataDog/puppet-datadog-agent/issues/624 - [#626]: https://github.com/DataDog/puppet-datadog-agent/issues/626 - [#628]: https://github.com/DataDog/puppet-datadog-agent/issues/628 - [#630]: https://github.com/DataDog/puppet-datadog-agent/issues/630 - [#633]: https://github.com/DataDog/puppet-datadog-agent/issues/633 - [#636]: https://github.com/DataDog/puppet-datadog-agent/issues/636 - [#639]: https://github.com/DataDog/puppet-datadog-agent/issues/639 - [#641]: https://github.com/DataDog/puppet-datadog-agent/issues/641 - [#643]: https://github.com/DataDog/puppet-datadog-agent/issues/643 - [#653]: https://github.com/DataDog/puppet-datadog-agent/issues/653 - [#654]: https://github.com/DataDog/puppet-datadog-agent/issues/654 - [#656]: https://github.com/DataDog/puppet-datadog-agent/issues/656 - [#658]: https://github.com/DataDog/puppet-datadog-agent/issues/658 - [#661]: https://github.com/DataDog/puppet-datadog-agent/issues/661 - [#662]: https://github.com/DataDog/puppet-datadog-agent/issues/662 - [#664]: https://github.com/DataDog/puppet-datadog-agent/issues/664 - [#666]: https://github.com/DataDog/puppet-datadog-agent/issues/666 - [#667]: https://github.com/DataDog/puppet-datadog-agent/issues/667 - [#672]: https://github.com/DataDog/puppet-datadog-agent/issues/672 - [#675]: https://github.com/DataDog/puppet-datadog-agent/issues/675 - [#677]: https://github.com/DataDog/puppet-datadog-agent/issues/677 - [#679]: https://github.com/DataDog/puppet-datadog-agent/issues/679 - [#681]: https://github.com/DataDog/puppet-datadog-agent/issues/681 - [#682]: https://github.com/DataDog/puppet-datadog-agent/issues/682 - [#686]: https://github.com/DataDog/puppet-datadog-agent/issues/686 - [#687]: https://github.com/DataDog/puppet-datadog-agent/issues/687 - [#688]: https://github.com/DataDog/puppet-datadog-agent/issues/688 - [#690]: https://github.com/DataDog/puppet-datadog-agent/issues/690 - [#692]: https://github.com/DataDog/puppet-datadog-agent/issues/692 - [#693]: https://github.com/DataDog/puppet-datadog-agent/issues/693 - [#696]: https://github.com/DataDog/puppet-datadog-agent/issues/696 - [#697]: https://github.com/DataDog/puppet-datadog-agent/issues/697 - [#698]: https://github.com/DataDog/puppet-datadog-agent/issues/698 - [#699]: https://github.com/DataDog/puppet-datadog-agent/issues/699 - [#700]: https://github.com/DataDog/puppet-datadog-agent/issues/700 - [#701]: https://github.com/DataDog/puppet-datadog-agent/issues/701 - [#703]: https://github.com/DataDog/puppet-datadog-agent/issues/703 - [#706]: https://github.com/DataDog/puppet-datadog-agent/issues/706 - [#709]: https://github.com/DataDog/puppet-datadog-agent/issues/709 - [#712]: https://github.com/DataDog/puppet-datadog-agent/issues/712 - [#714]: https://github.com/DataDog/puppet-datadog-agent/issues/714 - [#719]: https://github.com/DataDog/puppet-datadog-agent/issues/719 - [#721]: https://github.com/DataDog/puppet-datadog-agent/issues/721 - [#725]: https://github.com/DataDog/puppet-datadog-agent/issues/725 - [#726]: https://github.com/DataDog/puppet-datadog-agent/issues/726 - [#728]: https://github.com/DataDog/puppet-datadog-agent/issues/728 - [#732]: https://github.com/DataDog/puppet-datadog-agent/issues/732 - [#733]: https://github.com/DataDog/puppet-datadog-agent/issues/733 - [#741]: https://github.com/DataDog/puppet-datadog-agent/issues/741 - [#746]: https://github.com/DataDog/puppet-datadog-agent/issues/746 - [#748]: https://github.com/DataDog/puppet-datadog-agent/issues/748 - [#751]: https://github.com/DataDog/puppet-datadog-agent/issues/751 - [#752]: https://github.com/DataDog/puppet-datadog-agent/issues/752 - [#755]: https://github.com/DataDog/puppet-datadog-agent/issues/755 - [#756]: https://github.com/DataDog/puppet-datadog-agent/issues/756 - [#761]: https://github.com/DataDog/puppet-datadog-agent/issues/761 - [#770]: https://github.com/DataDog/puppet-datadog-agent/issues/770 - [#779]: https://github.com/DataDog/puppet-datadog-agent/issues/779 - [#782]: https://github.com/DataDog/puppet-datadog-agent/issues/782 - [#785]: https://github.com/DataDog/puppet-datadog-agent/issues/785 - [#789]: https://github.com/DataDog/puppet-datadog-agent/issues/789 - [#790]: https://github.com/DataDog/puppet-datadog-agent/issues/790 - [#798]: https://github.com/DataDog/puppet-datadog-agent/issues/798 - [#799]: https://github.com/DataDog/puppet-datadog-agent/issues/799 - [#800]: https://github.com/DataDog/puppet-datadog-agent/issues/800 - [#806]: https://github.com/DataDog/puppet-datadog-agent/issues/806 - [#814]: https://github.com/DataDog/puppet-datadog-agent/issues/814 - [#820]: https://github.com/DataDog/puppet-datadog-agent/issues/820 - [#821]: https://github.com/DataDog/puppet-datadog-agent/issues/821 - [#824]: https://github.com/DataDog/puppet-datadog-agent/issues/824 - [#835]: https://github.com/DataDog/puppet-datadog-agent/issues/835 - [@Aramack]: https://github.com/Aramack - [@BIAndrews]: https://github.com/BIAndrews - [@ChannoneArif-nbcuni]: https://github.com/ChannoneArif-nbcuni - [@ColinHebert]: https://github.com/ColinHebert - [@ColinHerbert]: https://github.com/ColinHerbert - [@DDRBoxman]: https://github.com/DDRBoxman - [@IanCrouch]: https://github.com/IanCrouch - [@LeoCavaille]: https://github.com/LeoCavaille - [@MartinDelta]: https://github.com/MartinDelta - [@Mstrodl]: https://github.com/Mstrodl - [@NoodlesNZ]: https://github.com/NoodlesNZ - [@aaron-miller]: https://github.com/aaron-miller - [@aepod]: https://github.com/aepod - [@ajvb]: https://github.com/ajvb - [@albertollamaso]: https://github.com/albertollamaso - [@alexberry]: https://github.com/alexberry - [@alexfouche]: https://github.com/alexfouche - [@alexharv074]: https://github.com/alexharv074 - [@alvin-huang]: https://github.com/alvin-huang - [@ardichoke]: https://github.com/ardichoke - [@arkpoah]: https://github.com/arkpoah - [@asenci]: https://github.com/asenci - [@atayts]: https://github.com/atayts - [@b2jrock]: https://github.com/b2jrock - [@bflad]: https://github.com/bflad - [@binford2k]: https://github.com/binford2k - [@bit-herder]: https://github.com/bit-herder - [@bittner]: https://github.com/bittner - [@butangero]: https://github.com/butangero - [@cabrinha]: https://github.com/cabrinha - [@charles-ferguson]: https://github.com/charles-ferguson - [@ckolos]: https://github.com/ckolos - [@cocker-cc]: https://github.com/cocker-cc - [@com6056]: https://github.com/com6056 - [@craigwatson]: https://github.com/craigwatson - [@cristianjuve]: https://github.com/cristianjuve - [@cwood]: https://github.com/cwood - [@damonmaria]: https://github.com/damonmaria - [@dan70402]: https://github.com/dan70402 - [@davejrt]: https://github.com/davejrt - [@davidgibbons]: https://github.com/davidgibbons - [@dbednall]: https://github.com/dbednall - [@degemer]: https://github.com/degemer - [@denmat]: https://github.com/denmat - [@devinmatte]: https://github.com/devinmatte - [@diogokiss]: https://github.com/diogokiss - [@djova]: https://github.com/djova - [@dorg-kanderson]: https://github.com/dorg-kanderson - [@dpricha89]: https://github.com/dpricha89 - [@dschaaff]: https://github.com/dschaaff - [@dzinek]: https://github.com/dzinek - [@eddmann]: https://github.com/eddmann - [@erik-frontify]: https://github.com/erik-frontify - [@evansj]: https://github.com/evansj - [@ewansteele]: https://github.com/ewansteele - [@ffleming]: https://github.com/ffleming - [@ffrants]: https://github.com/ffrants - [@florusboth]: https://github.com/florusboth - [@flyinbutrs]: https://github.com/flyinbutrs - [@flyinprogrammer]: https://github.com/flyinprogrammer - [@fr3nd]: https://github.com/fr3nd - [@fwelschen]: https://github.com/fwelschen - [@fzwart]: https://github.com/fzwart - [@generica]: https://github.com/generica - [@gotyaio]: https://github.com/gotyaio - [@grubernaut]: https://github.com/grubernaut - [@jabbate19]: https://github.com/jabbate19 - [@jacobbednarz]: https://github.com/jacobbednarz - [@jadams-av]: https://github.com/jadams-av - [@jameynelson]: https://github.com/jameynelson - [@jangie]: https://github.com/jangie - [@jcarr-sailthru]: https://github.com/jcarr-sailthru - [@jdavisp3]: https://github.com/jdavisp3 - [@jensendw]: https://github.com/jensendw - [@jfrost]: https://github.com/jfrost - [@jniesen]: https://github.com/jniesen - [@jubagarie]: https://github.com/jubagarie - [@jvanbrunschot]: https://github.com/jvanbrunschot - [@kevin-bowers]: https://github.com/kevin-bowers - [@kitchen]: https://github.com/kitchen - [@lowkeyshift]: https://github.com/lowkeyshift - [@mcasper]: https://github.com/mcasper - [@milescrabill]: https://github.com/milescrabill - [@mraylu]: https://github.com/mraylu - [@mrunkel-ut]: https://github.com/mrunkel-ut - [@mtougeron]: https://github.com/mtougeron - [@murdok5]: https://github.com/murdok5 - [@npaufler]: https://github.com/npaufler - [@o0oxid]: https://github.com/o0oxid - [@obi11235]: https://github.com/obi11235 - [@obowersa]: https://github.com/obowersa - [@oshmyrko]: https://github.com/oshmyrko - [@pabrahamsson]: https://github.com/pabrahamsson - [@paulhamby]: https://github.com/paulhamby - [@pid1]: https://github.com/pid1 - [@pulkitsethi]: https://github.com/pulkitsethi - [@rgergo]: https://github.com/rgergo - [@rmrf-run]: https://github.com/rmrf-run - [@rooprob]: https://github.com/rooprob - [@rothgar]: https://github.com/rothgar - [@rtyler]: https://github.com/rtyler - [@rud]: https://github.com/rud - [@ryan-dyer-sp]: https://github.com/ryan-dyer-sp - [@sambanks]: https://github.com/sambanks - [@samueljamesmarshall]: https://github.com/samueljamesmarshall - [@scottgeary]: https://github.com/scottgeary - [@sethcleveland]: https://github.com/sethcleveland - [@siebrand]: https://github.com/siebrand - [@skiedude]: https://github.com/skiedude - [@spectralblu]: https://github.com/spectralblu - [@stamak]: https://github.com/stamak - [@stantona]: https://github.com/stantona - [@swwolf]: https://github.com/swwolf - [@szponek]: https://github.com/szponek - [@tdm4]: https://github.com/tdm4 - [@teintuc]: https://github.com/teintuc - [@tommoyangn]: https://github.com/tommoyangn - [@turnopil]: https://github.com/turnopil - [@tuxinaut]: https://github.com/tuxinaut - [@vaisingh]: https://github.com/vaisingh - [@yanjunding]: https://github.com/yanjunding - [@yrcjaya]: https://github.com/yrcjaya - [@zabacad]: https://github.com/zabacad - [@zickzackv]: https://github.com/zickzackv - [@zoom-kris-anderson]: https://github.com/zoom-kris-anderson diff --git a/README.md b/README.md index f39d31b1c..48c3b563b 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,7 @@ puppet module install datadog-datadog_agent ### Configuration -Once the `datadog_agent` module is installed on your `puppetserver`/`puppetmaster` (or on a masterless host), follow -these configuration steps: +Once the `datadog_agent` module is installed on your `puppetserver`/`puppetmaster` (or on a masterless host), follow these configuration steps: 1. Obtain your [Datadog API key][2]. 2. Add the Datadog class to your node manifests (eg: `/etc/puppetlabs/code/environments/production/manifests/site.pp`). @@ -46,7 +45,7 @@ these configuration steps: } ``` - If using a Datadog site other than the default 'datadoghq.com', set it here as well: + If using a Datadog site other than the default 'datadoghq.com', set it here as well: ```conf class { 'datadog_agent': @@ -55,7 +54,7 @@ these configuration steps: } ``` - For CentOS/RHEL versions <7.0 and for Ubuntu < 15.04, specify the service provider as `upstart`: + For CentOS/RHEL versions <7.0 and for Ubuntu < 15.04, specify the service provider as `upstart`: ```conf class { 'datadog_agent': @@ -64,10 +63,9 @@ these configuration steps: } ``` - See the [Configuration variables](#configuration-variables) section for list of arguments you can use here. + See the [Configuration variables](#configuration-variables) section for list of arguments you can use here. -4. (Optional) Include any integrations you want to use with the Agent. The following example installs the mongo - integration: +4. (Optional) Include any integrations you want to use with the Agent. The following example installs the mongo integration: ```conf class { 'datadog_agent::integrations::mongo': @@ -75,10 +73,9 @@ these configuration steps: } ``` - See the [comments in code][6] for all arguments available for a given integration. + See the [comments in code][6] for all arguments available for a given integration. - If an integration does not have a [manifest with a dedicated class][7], you can still add a configuration for it. - Below is an example for the `ntp` check: + If an integration does not have a [manifest with a dedicated class][7], you can still add a configuration for it. Below is an example for the `ntp` check: ```conf class { 'datadog_agent': @@ -98,8 +95,7 @@ these configuration steps: ### Upgrading integrations -To install and pin specific integration versions, use `datadog_agent::install_integration`. This calls the -`datadog-agent integration` command to ensure a specific integration is installed or uninstalled, for example: +To install and pin specific integration versions, use `datadog_agent::install_integration`. This calls the `datadog-agent integration` command to ensure a specific integration is installed or uninstalled, for example: ```conf datadog_agent::install_integration { "mongo-1.9": @@ -121,8 +117,7 @@ Note it's not possible to downgrade an integration to a version older than the o ### Reporting -To enable reporting of Puppet runs to your Datadog timeline, enable the report processor on your Puppet master and -reporting for your clients. The clients send a run report after each check-in back to the master. +To enable reporting of Puppet runs to your Datadog timeline, enable the report processor on your Puppet master and reporting for your clients. The clients send a run report after each check-in back to the master. 1. Set the `puppet_run_reports` option to true in the node configuration manifest for your master: @@ -134,8 +129,7 @@ reporting for your clients. The clients send a run report after each check-in ba } ``` - The dogapi gem is automatically installed. Set `manage_dogapi_gem` to false if you want to customize the - installation. + The dogapi gem is automatically installed. Set `manage_dogapi_gem` to false if you want to customize the installation. 2. Add these configuration options to the Puppet master config (eg: `/etc/puppetlabs/puppet/puppet.conf`): @@ -197,23 +191,14 @@ With the [`ini_setting` module](https://forge.puppet.com/modules/puppetlabs/inif 4. (Optional) Enable tagging of reports with facts: - You can add tags to reports that are sent to Datadog as events. These tags can be sourced from Puppet facts for the - given node the report is regarding. These should be 1:1 and not involve structured facts (hashes, arrays, etc.) to - ensure readability. To enable regular fact tagging, set the parameter `datadog_agent::reports::report_fact_tags` to - the array value of facts—for example `["virtual","operatingsystem"]`. To enable trusted fact tagging, set the - parameter `datadog_agent::reports::report_trusted_fact_tags` to the array value of facts—for example - `["certname","extensions.pp_role","hostname"]`. + You can add tags to reports that are sent to Datadog as events. These tags can be sourced from Puppet facts for the given node the report is regarding. These should be 1:1 and not involve structured facts (hashes, arrays, etc.) to ensure readability. To enable regular fact tagging, set the parameter `datadog_agent::reports::report_fact_tags` to the array value of facts—for example `["virtual","operatingsystem"]`. To enable trusted fact tagging, set the parameter `datadog_agent::reports::report_trusted_fact_tags` to the array value of facts—for example `["certname","extensions.pp_role","hostname"]`. - NOTE: Changing these settings requires a restart of pe-puppetserver (or puppetserver) to re-read the report - processor. Ensure the changes are deployed prior to restarting the service(s). + NOTE: Changing these settings requires a restart of pe-puppetserver (or puppetserver) to re-read the report processor. Ensure the changes are deployed prior to restarting the service(s). - Tips: - -- Use dot index to specify a target fact; otherwise, the entire fact data set becomes the value as a string (not - very useful) -- Do not duplicate common data from monitoring like hostname, uptime, memory, etc. -- Coordinate core facts like role, owner, template, datacenter, etc., that help you build meaningful correlations to - the same tags from metrics + Tips: + - Use dot index to specify a target fact; otherwise, the entire fact data set becomes the value as a string (not very useful) + - Do not duplicate common data from monitoring like hostname, uptime, memory, etc. + - Coordinate core facts like role, owner, template, datacenter, etc., that help you build meaningful correlations to the same tags from metrics 5. Verify your Puppet data is in Datadog by searching for `sources:puppet` in the [Event Stream][5]. @@ -221,10 +206,8 @@ With the [`ini_setting` module](https://forge.puppet.com/modules/puppetlabs/inif To enable the Datadog Agent Network Performance Monitoring (NPM) features follow these steps: -1. (Windows only) If the Agent is already installed, uninstall it by passing `win_ensure => absent` to the main class - and removing other classes' definitions. -2. (Windows only) Pass the `windows_npm_install` option with value `true` to the `datadog::datadog_agent` class. Remove - `win_ensure` if added on previous step. +1. (Windows only) If the Agent is already installed, uninstall it by passing `win_ensure => absent` to the main class and removing other classes' definitions. +2. (Windows only) Pass the `windows_npm_install` option with value `true` to the `datadog::datadog_agent` class. Remove `win_ensure` if added on previous step. 3. Use the `datadog_agent::system_probe` class to properly create the configuration file: ```conf @@ -235,8 +218,7 @@ class { 'datadog_agent::system_probe': ### USM setup -To enable the Datadog Agent Universal Service Monitoring (USM) use the `datadog_agent::system_probe` class to properly -create the configuration file: +To enable the Datadog Agent Universal Service Monitoring (USM) use the `datadog_agent::system_probe` class to properly create the configuration file: ```conf class { 'datadog_agent::system_probe': @@ -290,17 +272,14 @@ If you don't see any reports coming in, check your Puppet server logs. ### Tagging client nodes -The Datadog Agent configuration file is recreated from the template every Puppet run. If you need to tag your nodes, add -an array entry in Hiera: +The Datadog Agent configuration file is recreated from the template every Puppet run. If you need to tag your nodes, add an array entry in Hiera: ```conf datadog_agent::tags: - 'keyname:value' - 'anotherkey:%{factname}' ``` - -To generate tags from custom facts classify your nodes with Puppet facts as an array to the ```facts_to_tags``` paramter -either through the Puppet Enterprise console or Hiera. Here is an example: +To generate tags from custom facts classify your nodes with Puppet facts as an array to the ```facts_to_tags``` paramter either through the Puppet Enterprise console or Hiera. Here is an example: ```conf class { "datadog_agent": @@ -311,15 +290,12 @@ class { "datadog_agent": Tips: -1. For structured facts index into the specific fact value otherwise the entire array comes over as a string and - ultimately be difficult to use. -2. Dynamic facts such as CPU usage, Uptime, and others that are expected to change each run are not ideal for tagging. - Static facts that are expected to stay for the life of a node are best candidates for tagging. +1. For structured facts index into the specific fact value otherwise the entire array comes over as a string and ultimately be difficult to use. +2. Dynamic facts such as CPU usage, Uptime, and others that are expected to change each run are not ideal for tagging. Static facts that are expected to stay for the life of a node are best candidates for tagging. ### Configuration variables -These variables can be set in the `datadog_agent` class to control settings in the Agent. See the [comments in code][8] -for the full list of supported arguments. +These variables can be set in the `datadog_agent` class to control settings in the Agent. See the [comments in code][8] for the full list of supported arguments. | variable name | description | |-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -343,8 +319,7 @@ for the full list of supported arguments. | `agent_extra_options`1 | A hash to provide additional configuration options (Agent v6 and v7 only). | | `hostname_extraction_regex`2 | A regex used to extract the hostname captured group to report the run in Datadog instead of reporting the Puppet nodename, for example:
`'^(?.*\.datadoghq\.com)(\.i-\w{8}\..*)?$'` | -(1) `agent_extra_options` is used to provide a fine grain control of additional Agent v6/v7 config options. A deep merge -is performed that may override options provided in the `datadog_agent` class parameters. For example: +(1) `agent_extra_options` is used to provide a fine grain control of additional Agent v6/v7 config options. A deep merge is performed that may override options provided in the `datadog_agent` class parameters. For example: ``` class { "datadog_agent": @@ -357,21 +332,13 @@ class { "datadog_agent": } ``` -(2) `hostname_extraction_regex` is useful when the Puppet module and the Datadog Agent are reporting different host -names for the same host in the infrastructure list. +(2) `hostname_extraction_regex` is useful when the Puppet module and the Datadog Agent are reporting different host names for the same host in the infrastructure list. [1]: https://forge.puppet.com/datadog/datadog_agent - [2]: https://app.datadoghq.com/organization-settings/api-keys - [3]: https://github.com/DataDog/dogapi-rb - [4]: https://app.datadoghq.com/account/settings#integrations - [5]: https://app.datadoghq.com/event/stream - [6]: https://github.com/DataDog/puppet-datadog-agent/blob/master/manifests/integrations/mongo.pp - [7]: https://github.com/DataDog/puppet-datadog-agent/tree/master/manifests/integrations - [8]: https://github.com/DataDog/puppet-datadog-agent/blob/master/manifests/init.pp From c51fbda5bba47278cbd89b4932ac63310cd62d47 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 7 Mar 2025 11:32:12 -0500 Subject: [PATCH 129/133] update readme --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 48c3b563b..453d4fe64 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,9 @@ puppet module install datadog-datadog_agent - By default Datadog Agent v7.x is installed. To use Agent version 6, change the setting `agent_major_version`. - Agent v5-specific legacy options have been removed. Refer to the CHANGELOG.md for more details and the datadog_agent class comments for all available options. - Configuration options for the following integrations have been updated: - - ElasticSearch + - ElasticSearch **[BREAKING CHANGES]** - `ssl_verify` accepts only Boolean values - - `tls_verify`options have been added - - PostgreSQL - - `custom_metrics` option has been removed. Use `custom_queries` instead. + - `tls_verify` options have been added - TCP Check - `skip_event` option has been removed sinced Datadog Agent v6.4+ From 235d89492966d00360100c9e05b70865c479d376 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 7 Mar 2025 11:37:30 -0500 Subject: [PATCH 130/133] make note of breaking changes in readme --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 453d4fe64..a56c26a20 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,15 @@ puppet module install datadog-datadog_agent - By default Datadog Agent v7.x is installed. To use Agent version 6, change the setting `agent_major_version`. - Agent v5-specific legacy options have been removed. Refer to the CHANGELOG.md for more details and the datadog_agent class comments for all available options. -- Configuration options for the following integrations have been updated: + +> [!IMPORTANT] +> Updates and breaking changes have been made in the below agent integrations: + - ElasticSearch **[BREAKING CHANGES]** - `ssl_verify` accepts only Boolean values - `tls_verify` options have been added + - Disk Check **[BREAKING CHANGES]** + - `use_mount`, `all_partitions`, and `tag_by_filesystem` accept only Boolean values - TCP Check - `skip_event` option has been removed sinced Datadog Agent v6.4+ From 7b7a5df7b0846ede9cda0eea3004707bd35cfccc Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Mon, 10 Mar 2025 15:18:11 -0400 Subject: [PATCH 131/133] Apply suggestions from code review Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com> --- CHANGELOG.md | 34 +++++++++++++++++----------------- README.md | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 396c30fda..ac34b0d60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,24 +7,24 @@ Changes # 4.0.0 / 2025-03-07 -This release has multiple breaking changes, you may need to update your module integration; note that module -dependencies has been updated. - -This release brings support for Puppet 8, which means all classes are now using defined class parameters types; this -could break existing implementations. - -* [FEATURE] Add Support for Puppet 8 ([#779]) -* [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#800]) -* [FEATURE] Class definitions updated with references to Datadog examples -* [FEATURE] Update to CI Builds to work with Ruby 3 -* [BUGFIX] Fix issue where MSI path was not correctly parsed ([#814]) -* [BUGFIX] BREAKING - `datadog_agent::integrations::disk` now expects booleans for `use_mount`, `all_partitions` and `tag_by_filesystem` -* [DEPRECATE] Drop support for Puppet 6 and below -* [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests -* [DEPRECATE] Remove `ganglia`, `graphite`, `dogstreams`, `custom_emitters` and `use_curl_http_client` legacy configuration options which are no longer supported since Datadog Agent v6+ +This release has multiple breaking changes. You may need to update your module integration. Note that module +dependencies have been updated. + +This release adds support for Puppet 8, updating all classes to use defined class parameters types. Be aware that this change +may break existing implementations. + +* [FEATURE] Add Support for Puppet 8 ([#779]). +* [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#800]). +* [FEATURE] Class definitions updated with references to Datadog examples. +* [FEATURE] Update to CI Builds to work with Ruby 3. +* [BUGFIX] Fix issue where MSI path was not correctly parsed ([#814]). +* [BUGFIX] BREAKING - `datadog_agent::integrations::disk` now expects booleans for `use_mount`, `all_partitions`, and `tag_by_filesystem`. +* [DEPRECATE] Drop support for Puppet 6 and below. +* [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests. +* [DEPRECATE] Remove `ganglia`, `graphite`, `dogstreams`, `custom_emitters`, and `use_curl_http_client` legacy configuration options, which are no longer supported since Datadog Agent v6+ * [DEPRECATE] Remove support for supplying a string to the `ssl_verify` option on the elasticsearch integration. We now use `tls_verify` which matches core Datadog code. -* [DEPRECATE] Remove legacy Jenkins integration -* [DEPRECATE] `skip_event` setting on TCP Check class has been removed from DataDog integration (removed since Datadog Agent v6.4+) +* [DEPRECATE] Remove legacy Jenkins integration. +* [DEPRECATE] `skip_event` setting on TCP Check class has been removed from the Datadog integration (removed since Datadog Agent v6.4+). * [DEPRECATE] Remove support for supplying a String to the `ssl_verify` option on the elasticsearch integration. Add updated `tls_*` options to match core Datadog code. # 3.24.0 / 2025-02-25 diff --git a/README.md b/README.md index a56c26a20..09bc9f9b5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ puppet module install datadog-datadog_agent > The Datadog Puppet Module v4.x drops support for Puppet <= 6 and Datadog Agent v5. To upgrade or install the Datadog > Agent v5+ on Puppet <= 6, use module v3.x. -- By default Datadog Agent v7.x is installed. To use Agent version 6, change the setting `agent_major_version`. +- By default, Datadog Agent v7.x is installed. To use Agent version 6, change the setting `agent_major_version`. - Agent v5-specific legacy options have been removed. Refer to the CHANGELOG.md for more details and the datadog_agent class comments for all available options. > [!IMPORTANT] From bab49589312884130ed297159c774e40597e3c56 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Mon, 10 Mar 2025 15:52:39 -0400 Subject: [PATCH 132/133] fix suppress_errors --- CHANGELOG.md | 1 + manifests/integrations/activemq_xml.pp | 11 ++++++----- .../datadog_agent_integrations_activemq_xml_spec.rb | 10 +++++----- templates/agent-conf.d/activemq_xml.yaml.erb | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac34b0d60..2d60892d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ may break existing implementations. * [FEATURE] Update to CI Builds to work with Ruby 3. * [BUGFIX] Fix issue where MSI path was not correctly parsed ([#814]). * [BUGFIX] BREAKING - `datadog_agent::integrations::disk` now expects booleans for `use_mount`, `all_partitions`, and `tag_by_filesystem`. +* [BUGFIX] Fix `supress_errors` typo in the ActiveMQ_xml check. `supress_errors` is preserved for backwards compatibility, but new `suppress_errors` should be used instead. * [DEPRECATE] Drop support for Puppet 6 and below. * [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests. * [DEPRECATE] Remove `ganglia`, `graphite`, `dogstreams`, `custom_emitters`, and `use_curl_http_client` legacy configuration options, which are no longer supported since Datadog Agent v6+ diff --git a/manifests/integrations/activemq_xml.pp b/manifests/integrations/activemq_xml.pp index 8debb24eb..2b8bb7f8f 100644 --- a/manifests/integrations/activemq_xml.pp +++ b/manifests/integrations/activemq_xml.pp @@ -18,7 +18,7 @@ # Username to use for authentication - optional # $password # Password to use for authentication - optional -# $supress_errors +# $suppress_errors # Supress connection errors if URL is expected to be offline at times (eg. standby host) - optional # $detailed_queues # List of queues to monitor, required if you have more than 300 queues you wish to track, otherwise optional. @@ -33,7 +33,7 @@ # url => 'http://localhost:8161', # username => 'datadog', # password => 'some_pass', -# supress_errors => false, +# suppress_errors => false, # detailed_queues => ['queue1', 'queue2', 'queue3'], # detailed_topics => ['topic1', 'topic2', 'topic3'], # detailed_subscribers => ['subscriber1', 'subscriber2', 'subscriber3'], @@ -45,7 +45,7 @@ # - url: 'http://localhost:8161' # username: 'datadog' # password: 'some_pass' -# supress_errors: false +# suppress_errors: false # detailed_queues: ['queue1', 'queue2', 'queue3'] # detailed_topics: ['topic1', 'topic2', 'topic3'] # detailed_subscribers: ['subscriber1', 'subscriber2', 'subscriber3'] @@ -53,7 +53,8 @@ # class datadog_agent::integrations::activemq_xml ( String $url = 'http://localhost:8161', - Boolean $supress_errors = false, + Boolean $supress_errors = false, # keep for backwards-compatibility + Boolean $suppress_errors = $supress_errors, Optional[String] $username = undef, Optional[String] $password = undef, Array[String] $detailed_queues = [], @@ -80,7 +81,7 @@ 'url' => $url, 'username' => $username, 'password' => $password, - 'supress_errors' => $supress_errors, + 'suppress_errors' => $suppress_errors, 'detailed_queues' => $detailed_queues, 'detailed_topics' => $detailed_topics, 'detailed_subscribers' => $detailed_subscribers, diff --git a/spec/classes/datadog_agent_integrations_activemq_xml_spec.rb b/spec/classes/datadog_agent_integrations_activemq_xml_spec.rb index 503464218..dcb55facd 100644 --- a/spec/classes/datadog_agent_integrations_activemq_xml_spec.rb +++ b/spec/classes/datadog_agent_integrations_activemq_xml_spec.rb @@ -36,7 +36,7 @@ it { is_expected.to contain_file(conf_file) .with_content(%r{http://localhost:8161}) - .with_content(%r{supress_errors: false}) + .with_content(%r{suppress_errors: false}) .without_content(%r{detailed_queues:}) .without_content(%r{detailed_topics:}) .without_content(%r{detailed_subscribers:}) @@ -46,7 +46,7 @@ context 'with extra detailed parameters' do let(:params) do { - supress_errors: true, + suppress_errors: true, detailed_queues: ['queue1', 'queue2'], detailed_topics: ['topic1', 'topic2'], detailed_subscribers: ['subscriber1', 'subscriber2'], @@ -56,7 +56,7 @@ it { is_expected.to contain_file(conf_file) .with_content(%r{http://localhost:8161}) - .with_content(%r{supress_errors: true}) + .with_content(%r{suppress_errors: true}) .with_content(%r{detailed_queues:.*\s+- queue1\s+- queue2}) .with_content(%r{detailed_topics:.*\s+- topic1\s+- topic2}) .with_content(%r{detailed_subscribers:.*\s+- subscriber1\s+- subscriber2}) @@ -90,14 +90,14 @@ it { is_expected.to contain_file(conf_file) .with_content(%r{url: http://localhost:8161}) - .without_content(%r{supress_errors:}) + .without_content(%r{suppress_errors:}) .with_content(%r{username: joe}) .with_content(%r{password: hunter1}) .with_content(%r{detailed_queues:.*\s+- queue1\s+- queue2}) .with_content(%r{detailed_topics:.*\s+- topic1\s+- topic2}) .with_content(%r{detailed_subscribers:.*\s+- subscriber1\s+- subscriber2}) .with_content(%r{url: http://remotehost:8162}) - .without_content(%r{supress_errors:}) + .without_content(%r{suppress_errors:}) .with_content(%r{username: moe}) .with_content(%r{password: hunter2}) .with_content(%r{detailed_queues:.*\s+- queue3\s+- queue4}) diff --git a/templates/agent-conf.d/activemq_xml.yaml.erb b/templates/agent-conf.d/activemq_xml.yaml.erb index a4053baa1..dd0150235 100644 --- a/templates/agent-conf.d/activemq_xml.yaml.erb +++ b/templates/agent-conf.d/activemq_xml.yaml.erb @@ -11,8 +11,8 @@ instances: <% unless instance['password'].nil? -%> password: <%= instance['password'] %> <%- end -%> -<% unless instance['supress_errors'].nil? -%> - supress_errors: <%= instance['supress_errors'] %> +<% unless instance['suppress_errors'].nil? -%> + suppress_errors: <%= instance['suppress_errors'] %> <%- end -%> <%- unless instance['detailed_queues'].nil? || instance['detailed_queues'].empty? -%> detailed_queues: From 8fe63754926905d4c6bd7ac14d8b13de7d4a464b Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Mon, 10 Mar 2025 16:28:46 -0400 Subject: [PATCH 133/133] update changelog, readme, metadata --- CHANGELOG.md | 34 +++++++++++++++++++--------------- README.md | 2 ++ metadata.json | 38 ++++++++++++++++++++++++++++++-------- 3 files changed, 51 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d60892d8..435f05530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Changes -# 4.0.0 / 2025-03-07 +# 4.0.0 / 2025-03-10 This release has multiple breaking changes. You may need to update your module integration. Note that module dependencies have been updated. @@ -13,20 +13,21 @@ dependencies have been updated. This release adds support for Puppet 8, updating all classes to use defined class parameters types. Be aware that this change may break existing implementations. -* [FEATURE] Add Support for Puppet 8 ([#779]). -* [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate ([#800]). -* [FEATURE] Class definitions updated with references to Datadog examples. -* [FEATURE] Update to CI Builds to work with Ruby 3. -* [BUGFIX] Fix issue where MSI path was not correctly parsed ([#814]). -* [BUGFIX] BREAKING - `datadog_agent::integrations::disk` now expects booleans for `use_mount`, `all_partitions`, and `tag_by_filesystem`. -* [BUGFIX] Fix `supress_errors` typo in the ActiveMQ_xml check. `supress_errors` is preserved for backwards compatibility, but new `suppress_errors` should be used instead. -* [DEPRECATE] Drop support for Puppet 6 and below. -* [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests. -* [DEPRECATE] Remove `ganglia`, `graphite`, `dogstreams`, `custom_emitters`, and `use_curl_http_client` legacy configuration options, which are no longer supported since Datadog Agent v6+ -* [DEPRECATE] Remove support for supplying a string to the `ssl_verify` option on the elasticsearch integration. We now use `tls_verify` which matches core Datadog code. -* [DEPRECATE] Remove legacy Jenkins integration. -* [DEPRECATE] `skip_event` setting on TCP Check class has been removed from the Datadog integration (removed since Datadog Agent v6.4+). -* [DEPRECATE] Remove support for supplying a String to the `ssl_verify` option on the elasticsearch integration. Add updated `tls_*` options to match core Datadog code. +* [FEATURE] Add Support for Puppet 8 ([#823])(thanks [@xenon8], [@nielstholenaar]). + * [FEATURE] Update Module Dependencies including updates for StdLib, migrating to newer functions where appropriate. + * [FEATURE] Class definitions updated with references to Datadog examples. + * [FEATURE] Update to CI Builds to work with Ruby 3. + * [BUGFIX] Fix issue where MSI path was not correctly parsed. + * [BUGFIX] BREAKING - `datadog_agent::integrations::disk` now expects booleans for `use_mount`, `all_partitions`, and `tag_by_filesystem`. + * [BUGFIX] Fix `supress_errors` typo in the ActiveMQ_xml check. `supress_errors` is preserved for backwards compatibility, but new `suppress_errors` should be used instead. + * [DEPRECATE] Drop support for Puppet 6 and below. + * [DEPRECATE] Drop support for Datadog Agent version 5, including removal of unit tests. + * [DEPRECATE] Remove `ganglia`, `graphite`, `dogstreams`, `custom_emitters`, and `use_curl_http_client` legacy configuration options, which are no longer supported since Datadog Agent v6+ + * [DEPRECATE] Remove support for supplying a string to the `ssl_verify` option on the elasticsearch integration. We now use `tls_verify` which matches core Datadog code. + * [DEPRECATE] Remove legacy Jenkins integration. + * [DEPRECATE] `skip_event` setting on TCP Check class has been removed from the Datadog integration (removed since Datadog Agent v6.4+). + * [DEPRECATE] Remove support for supplying a String to the `ssl_verify` option on the elasticsearch integration. Add updated `tls_*` options to match core Datadog code. +* [FEATURE] Update mongo configuration template with `dbm`, `database_autodiscovery`, `reported_database_hostname`, and `hosts` parameters. ([#838]) (thanks [@lu-zhengda]). # 3.24.0 / 2025-02-25 @@ -1055,12 +1056,14 @@ Please read the [docs]() for more details. [@kevin-bowers]: https://github.com/kevin-bowers [@kitchen]: https://github.com/kitchen [@lowkeyshift]: https://github.com/lowkeyshift +[@lu-zhengda]: https://github.com/lu-zhengda [@mcasper]: https://github.com/mcasper [@milescrabill]: https://github.com/milescrabill [@mraylu]: https://github.com/mraylu [@mrunkel-ut]: https://github.com/mrunkel-ut [@mtougeron]: https://github.com/mtougeron [@murdok5]: https://github.com/murdok5 +[@nielstholenaar]: https://github.com/nielstholenaar [@npaufler]: https://github.com/npaufler [@o0oxid]: https://github.com/o0oxid [@obi11235]: https://github.com/obi11235 @@ -1094,6 +1097,7 @@ Please read the [docs]() for more details. [@turnopil]: https://github.com/turnopil [@tuxinaut]: https://github.com/tuxinaut [@vaisingh]: https://github.com/vaisingh +[@xenon8]: https://github.com/xenon8 [@yanjunding]: https://github.com/yanjunding [@yrcjaya]: https://github.com/yrcjaya [@zabacad]: https://github.com/zabacad diff --git a/README.md b/README.md index 09bc9f9b5..5a2fdf375 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ puppet module install datadog-datadog_agent > [!IMPORTANT] > Updates and breaking changes have been made in the below agent integrations: + - ActiveMQ_XML + - `suppress_errors` config should now be used instead of `supress_errors` (backward-compatible) - ElasticSearch **[BREAKING CHANGES]** - `ssl_verify` accepts only Boolean values - `tls_verify` options have been added diff --git a/metadata.json b/metadata.json index 0429bb5f4..10b7e5f94 100644 --- a/metadata.json +++ b/metadata.json @@ -38,33 +38,41 @@ "operatingsystem": "RedHat", "operatingsystemrelease": [ "6", - "7" + "7", + "8", + "9" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "6", - "7" + "7", + "8", + "9" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "6", - "7" + "7", + "8", + "9" ] }, { "operatingsystem": "AlmaLinux", "operatingsystemrelease": [ - "8" + "8", + "9" ] }, { "operatingsystem": "Rocky", "operatingsystemrelease": [ - "8" + "8", + "9" ] }, { @@ -87,7 +95,13 @@ "26", "27", "28", - "29" + "29", + "30", + "31", + "32", + "33", + "34", + "35" ] }, { @@ -96,7 +110,12 @@ "6", "7", "8", - "9" + "9", + "10", + "11", + "12", + "13", + "14" ] }, { @@ -107,7 +126,10 @@ "17.04", "17.10", "18.04", - "18.10" + "18.10", + "20.04", + "22.04", + "24.04" ] }, {