Another piggy back on the Telegraf class to test dual outputs.

This commit is contained in:
Einar Lönn 2020-11-12 12:51:12 +01:00
parent c472792d3b
commit fb0518552c

View file

@ -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"]
}
}
}
}