From 40628f6352db10cf7b9357b5b0ab1f013f11f4e8 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Tue, 16 May 2017 12:50:34 -0500 Subject: [PATCH 1/3] Change owner/group of /etc/dd-agent (#325) Set the owner groups to the default one after installation, `dd-agent:dd-agent`. --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 11324ad6..56342165 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -363,8 +363,8 @@ file { '/etc/dd-agent': ensure => present, - owner => 'root', - group => 'root', + owner => $dd_user, + group => $dd_group, mode => '0755', require => Package['datadog-agent'], } From 54a59d5c364112e79807ebde031fabe68d5c9c5b Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 31 May 2017 13:50:17 -0700 Subject: [PATCH 2/3] Redis updates - Allow command_stats (#327) * Updating redis.pp to include new command_stats * Add command_stats to template * Updating redis spec --- manifests/integrations/redis.pp | 5 +++++ spec/classes/datadog_agent_integrations_redis_spec.rb | 3 +++ templates/agent-conf.d/redisdb.yaml.erb | 1 + 3 files changed, 9 insertions(+) diff --git a/manifests/integrations/redis.pp b/manifests/integrations/redis.pp index 109788ff..a537b277 100644 --- a/manifests/integrations/redis.pp +++ b/manifests/integrations/redis.pp @@ -17,6 +17,8 @@ # Optional array of tags # $keys # Optional array of keys to check length +# $command_stats +# Collect INFO COMMANDSTATS output as metrics # # Sample Usage: # @@ -34,12 +36,15 @@ $tags = [], $keys = [], $warn_on_missing_keys = true, + $command_stats = false, + ) inherits datadog_agent::params { include datadog_agent validate_array($tags) validate_array($keys) validate_bool($warn_on_missing_keys) + validate_bool($command_stats) if $ports == undef { $_ports = [ $port ] diff --git a/spec/classes/datadog_agent_integrations_redis_spec.rb b/spec/classes/datadog_agent_integrations_redis_spec.rb index cc10fbe8..e15d9017 100644 --- a/spec/classes/datadog_agent_integrations_redis_spec.rb +++ b/spec/classes/datadog_agent_integrations_redis_spec.rb @@ -28,6 +28,7 @@ it { should contain_file(conf_file).without_content(%r{tags:}) } it { should contain_file(conf_file).without_content(%r{\bkeys:}) } it { should contain_file(conf_file).with_content(%r{warn_on_missing_keys: true}) } + it { should contain_file(conf_file).with_content(%r{command_stats: false}) } end context 'with parameters set' do @@ -39,6 +40,7 @@ tags: %w{foo bar}, keys: %w{baz bat}, warn_on_missing_keys: false, + command_stats: true, }} it { should contain_file(conf_file).with_content(%r{host: redis1}) } it { should contain_file(conf_file).with_content(%r{^[^#]*password: hunter2}) } @@ -47,6 +49,7 @@ it { should contain_file(conf_file).with_content(%r{tags:.*\s+- foo\s+- bar}) } it { should contain_file(conf_file).with_content(%r{keys:.*\s+- baz\s+- bat}) } it { should contain_file(conf_file).with_content(%r{warn_on_missing_keys: false}) } + it { should contain_file(conf_file).with_content(%r{command_stats: true}) } end end diff --git a/templates/agent-conf.d/redisdb.yaml.erb b/templates/agent-conf.d/redisdb.yaml.erb index 99c61e61..c522c45e 100644 --- a/templates/agent-conf.d/redisdb.yaml.erb +++ b/templates/agent-conf.d/redisdb.yaml.erb @@ -9,6 +9,7 @@ instances: - host: <%= @host %> port: <%= port %> warn_on_missing_keys: <%= @warn_on_missing_keys %> + command_stats: <%= @command_stats %> <% if @password.empty? %># <%end %>password: <%= @password %> # unix_socket_path: /var/run/redis/redis.sock # optional, can be used in lieu of host/port <% if @slowlog_max_len.empty? %># <%end %>slowlog-max-len: <%= @slowlog_max_len %> From efccc9a84e3ce795a2e79a771860d88334d3db54 Mon Sep 17 00:00:00 2001 From: Travis Smith Date: Fri, 16 Jun 2017 07:48:24 -0600 Subject: [PATCH 3/3] Create init.pp (#332) --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 56342165..d92158a6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -362,7 +362,7 @@ } file { '/etc/dd-agent': - ensure => present, + ensure => directory, owner => $dd_user, group => $dd_group, mode => '0755',