Make variables of telegraf parameters, SC-2522

This commit is contained in:
Patrik Holmqvist 2025-03-27 09:18:10 +01:00
parent eca1174b72
commit cfd7712c69
Signed by: pahol
GPG key ID: 5D5B0D4E93F77273
2 changed files with 12 additions and 13 deletions

View file

@ -11,14 +11,13 @@ class eid::telegraf2 (
Array $ports = [], Array $ports = [],
String $service_dir = '/etc/telegraf', String $service_dir = '/etc/telegraf',
Array $influx_urls = ["https://metrics-external-1.sunet.se:8086"], Array $influx_urls = ["https://metrics-external-1.sunet.se:8086"],
String $influxdb2_org = "SwedenConnect"
String $influxdb2_bucket = "eidas"
String $influxdb2_bucket_proxy = "eidas-proxy"
) { ) {
# Get influx values # Get influx values
$influxdb2_token = hiera(influxdb2_token,'NOT_SET_IN_HIERA')
$influx2_token = hiera(influx2_token,'NOT_SET_IN_HIERA') $influx2_token = hiera(influx2_token,'NOT_SET_IN_HIERA')
# $influxdb2_org = hiera(influxdb2_org,'NOT_SET_IN_HIERA')
# $influxdb2_bucket = hiera(influxdb2_bucket,'NOT_SET_IN_HIERA')
$influxdb2_bucket_proxy = hiera(influxdb2_bucket_proxy,'NOT_SET_IN_HIERA')
sunet::docker_compose { 'telegraf': sunet::docker_compose { 'telegraf':
content => template('eid/telegraf2/docker-compose.yml.erb'), content => template('eid/telegraf2/docker-compose.yml.erb'),

View file

@ -37,16 +37,16 @@
[[outputs.influxdb_v2]] [[outputs.influxdb_v2]]
urls = <%= @influx_urls %> urls = <%= @influx_urls %>
token = "<%= @influx2_token %>" token = "<%= @influx2_token %>"
organization = "SwedenConnect" organization = "<%= @influxdb2_org %>"
bucket = "eidas" bucket = "<%= @influxdb2_bucket %>"
insecure_skip_verify = true insecure_skip_verify = true
[outputs.influxdb_v2.tagdrop] [outputs.influxdb_v2.tagdrop]
influxdb_database = ["*"] influxdb_database = ["*"]
[[outputs.influxdb_v2]] [[outputs.influxdb_v2]]
urls = <%= @influx_urls %> urls = <%= @influx_urls %>
token = "<%= @influx2_token %>" token = "<%= @influx2_token %>"
organization = "SwedenConnect" organization = "<%= @influxdb2_org %>"
bucket = "eidas-proxy" bucket = "<%= @influxdb2_bucket_proxy %>"
insecure_skip_verify = true insecure_skip_verify = true
tagexclude = ["influxdb_database"] tagexclude = ["influxdb_database"]
[outputs.influxdb_v2.tagpass] [outputs.influxdb_v2.tagpass]