From 4c11d448d4ee2c54e56872920babd3ded2b9e6ff Mon Sep 17 00:00:00 2001 From: Patrik Holmqvist Date: Wed, 2 Apr 2025 13:24:35 +0200 Subject: [PATCH] Try new syntax for telegraf ports, SC-2522 --- global/overlay/etc/puppet/cosmos-rules.yaml | 2 +- .../overlay/etc/puppet/modules/eid/manifests/telegraf2.pp | 2 +- .../modules/eid/templates/telegraf2/docker-compose.yml.erb | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/global/overlay/etc/puppet/cosmos-rules.yaml b/global/overlay/etc/puppet/cosmos-rules.yaml index d071d1dc..84603a74 100644 --- a/global/overlay/etc/puppet/cosmos-rules.yaml +++ b/global/overlay/etc/puppet/cosmos-rules.yaml @@ -1264,7 +1264,7 @@ log-qa-sto1-1.komreg.net: sunet::dockerhost2: eid::telegraf2: server_type: 'log' - ports: '127.0.0.1:9999:9999' + ports: ['127.0.0.1:9999:9999'] sunet::fticks: args: -j url: http://127.0.0.1:9999/telegraf diff --git a/global/overlay/etc/puppet/modules/eid/manifests/telegraf2.pp b/global/overlay/etc/puppet/modules/eid/manifests/telegraf2.pp index 39de199a..d3a500b0 100644 --- a/global/overlay/etc/puppet/modules/eid/manifests/telegraf2.pp +++ b/global/overlay/etc/puppet/modules/eid/manifests/telegraf2.pp @@ -3,7 +3,7 @@ # @param version Version of the docker image to use. (referenced in compose file) # @param server_fqdn The FQDN of the server. (referenced in compose file) # @param server_type Type of server, used in compose for config differentiation -# @param ports Port mappings for container +# @param ports Port mappings for container to override default # @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 # @param influxdb2_org Influx organization (referenced in compose file) diff --git a/global/overlay/etc/puppet/modules/eid/templates/telegraf2/docker-compose.yml.erb b/global/overlay/etc/puppet/modules/eid/templates/telegraf2/docker-compose.yml.erb index 138f5105..dd0b1e68 100644 --- a/global/overlay/etc/puppet/modules/eid/templates/telegraf2/docker-compose.yml.erb +++ b/global/overlay/etc/puppet/modules/eid/templates/telegraf2/docker-compose.yml.erb @@ -13,7 +13,9 @@ services: - '<%= @service_dir %>:<%= @service_dir %>' - '/var/run/utmp:/var/run/utmp:ro' -<% if @ports != [] -%> +<% if @ports != '' -%> ports: - - <%= @ports %> +<% @ports.each do |port| -%> + - <%= port %> +<% end -%> <% end -%>