diff --git a/playbooks/roles/telegraf/templates/telegraf.conf.j2 b/playbooks/roles/telegraf/templates/telegraf.conf.j2 index 654b933..04b44c1 100644 --- a/playbooks/roles/telegraf/templates/telegraf.conf.j2 +++ b/playbooks/roles/telegraf/templates/telegraf.conf.j2 @@ -7,7 +7,7 @@ flush_interval = "10s" flush_jitter = "0s" precision = "" - hostname = "node002.serguzim.me" + hostname = "{{ inventory_hostname }}" omit_hostname = false [[outputs.influxdb_v2]] @@ -16,6 +16,13 @@ organization = "{{ svc.influxdb.organization }}" bucket = "{{ svc.influxdb.bucket }}" +[[inputs.prometheus]] + urls = [ + {%- for host_data in opentofu.hosts.values() -%} + "https://{{ host_data.fqdn_vpn }}:2019/metrics", + {%- endfor -%} + ] + [[inputs.prometheus]] urls = [ {%- for url in svc.prometheus_unprotected.urls -%} diff --git a/playbooks/roles/telegraf/vars/main.yml b/playbooks/roles/telegraf/vars/main.yml index 5210f29..3a864b8 100644 --- a/playbooks/roles/telegraf/vars/main.yml +++ b/playbooks/roles/telegraf/vars/main.yml @@ -7,7 +7,6 @@ telegraf_svc: bucket: metrics prometheus_unprotected: urls: - - http://node002.vpn.serguzim.net:2019/metrics - https://matrix.serguzim.me/_synapse/metrics - https://push.serguzim.me/metrics - https://tick.serguzim.me/metrics