diff --git a/manifests/integrations/redis.pp b/manifests/integrations/redis.pp index a79016df..81d573dc 100644 --- a/manifests/integrations/redis.pp +++ b/manifests/integrations/redis.pp @@ -7,8 +7,8 @@ # The host redis is running on # $password # The redis password (optional) -# $port -# The redis port +# $ports +# Array of redis ports # $slowlog_max_len # The max length of the slow-query log (optional) # $tags @@ -26,14 +26,14 @@ class datadog_agent::integrations::redis( $host = 'localhost', $password = '', - $port = 6379, + $ports = [ 6379 ], $slowlog_max_len = '', $tags = [], $keys = [], $warn_on_missing_keys = true, ) inherits datadog_agent::params { - validate_re($port, '^\d+$') + validate_array($ports) validate_array($tags) validate_array($keys) validate_bool($warn_on_missing_keys) diff --git a/templates/agent-conf.d/redisdb.yaml.erb b/templates/agent-conf.d/redisdb.yaml.erb index a8543414..59ce7418 100644 --- a/templates/agent-conf.d/redisdb.yaml.erb +++ b/templates/agent-conf.d/redisdb.yaml.erb @@ -5,8 +5,9 @@ init_config: instances: +<% @ports.each do |port| -%> - host: <%= @host %> - port: <%= @port %> + port: <%= port %> warn_on_missing_keys: <%= @warn_on_missing_keys %> <% if @password.empty? %># <%end %>password: <%= @password %> # unix_socket_path: /var/run/redis/redis.sock # optional, can be used in lieu of host/port @@ -23,3 +24,4 @@ instances: - <%= key %> <% end -%> <% end -%> +<% end -%>