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

@ -6,19 +6,18 @@
# @param service_dir The directory where all related config and files are stored. (referenced in compose file)
# @param influx_urls List of influxdb urls to send data to
class eid::telegraf2 (
String $version = 'latest',
String $server_fqdn = $facts['networking']['fqdn'],
Array $ports = [],
String $service_dir = '/etc/telegraf',
Array $influx_urls = ["https://metrics-external-1.sunet.se:8086"],
String $version = 'latest',
String $server_fqdn = $facts['networking']['fqdn'],
Array $ports = [],
String $service_dir = '/etc/telegraf',
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
$influxdb2_token = hiera(influxdb2_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':
content => template('eid/telegraf2/docker-compose.yml.erb'),

View file

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