Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
swwolf committed Jun 21, 2017
2 parents 65597fb + efccc9a commit 9524e47
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@
}

file { '/etc/dd-agent':
ensure => present,
owner => 'root',
group => 'root',
ensure => directory,
owner => $dd_user,
group => $dd_group,
mode => '0755',
require => Package['datadog-agent'],
}
Expand Down
5 changes: 5 additions & 0 deletions manifests/integrations/redis.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand All @@ -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 ]
Expand Down
3 changes: 3 additions & 0 deletions spec/classes/datadog_agent_integrations_redis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}) }
Expand All @@ -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
1 change: 1 addition & 0 deletions templates/agent-conf.d/redisdb.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down

0 comments on commit 9524e47

Please sign in to comment.