Another piggy back on the Telegraf class to test dual outputs.
This commit is contained in:
parent
c472792d3b
commit
fb0518552c
1 changed files with 12 additions and 2 deletions
|
@ -35,12 +35,22 @@ class eid::telegraf(String $version = "stable", Array $volumes = [], Array $port
|
|||
|
||||
$_volumes = flatten(["/dev/log:/dev/log","/var/log:/var/log","/etc/telegraf:/etc/telegraf","/var/run/utmp:/var/run/utmp:ro",$volumes])
|
||||
|
||||
sunet::docker_run {"telegraf":
|
||||
if ($influx2_token != 'NOT_SET_IN_HIERA') {
|
||||
sunet::docker_run {"telegraf":
|
||||
hostname => "${::fqdn}",
|
||||
image => "docker.sunet.se/eduid/telegraf",
|
||||
imagetag => "latest",
|
||||
volumes => $_volumes,
|
||||
ports => $ports,
|
||||
env => ["INFLUXDB2_TOKEN=$influxdb2_token","INFLUXDB2_ORG=$influxdb2_org","INFLUXDB2_BUCKET=$influxdb2_bucket"]
|
||||
} else {
|
||||
sunet::docker_run {"telegraf":
|
||||
hostname => "${::fqdn}",
|
||||
image => "docker.sunet.se/eduid/telegraf",
|
||||
imagetag => $version,
|
||||
volumes => $_volumes,
|
||||
ports => $ports,
|
||||
env => ["INFLUXDB2_TOKEN=$influxdb2_token","INFLUXDB2_ORG=$influxdb2_org","INFLUXDB2_BUCKET=$influxdb2_bucket"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue