File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111# Sample Usage:
1212#
1313# class { 'datadog_agent::integrations::twemproxy' :
14- # servers => [
14+ # instances => [
1515# {
1616# 'host' => 'localhost',
1717# 'port' => '22222',
2424# }
2525#
2626class datadog_agent::integrations::twemproxy (
27- $servers = [{' host' => ' localhost' , ' port' => ' 22222' }]
27+ $host = ' localhost' ,
28+ $port = ' 22222' ,
29+ $instances = [],
2830) inherits datadog_agent::params {
2931 include datadog_agent
3032
31- validate_array($servers )
33+ if !$instances and $host {
34+ $_instances = [{
35+ ' host' => $host ,
36+ ' port' => $port ,
37+ }]
38+ } elsif !$instances {
39+ $_instances = []
40+ } else {
41+ $_instances = $instances
42+ }
3243
3344 file { "${datadog_agent::params::conf_dir}/twemproxy.yaml" :
3445 ensure => file ,
Original file line number Diff line number Diff line change 55init_config:
66
77instances:
8- <% @servers .each do |server| -%>
8+ <% @instances .each do |server| -%>
99 - host: <%= server['host'] %>
1010 port: <%= server['port'] %>
1111<% end -%>
You can’t perform that action at this time.
0 commit comments