feat(podman_prometheus): add hostname labels to targets
Some checks failed
Ansible Lint Check / lint (push) Failing after 1m2s

This commit is contained in:
Iain Learmonth 2026-05-25 17:23:34 +01:00
parent c404d08b89
commit 0d92344f16
7 changed files with 74 additions and 79 deletions

View file

@ -0,0 +1,16 @@
[Container]
ContainerName=prometheus-ts
Image=docker.io/tailscale/tailscale:latest
HostName=prometheus
Environment=TS_AUTH_KEY={{ podman_prometheus_ts_auth_key }}
Environment=TS_STATE_DIR=/var/lib/tailscale
Environment=TS_USERSPACE=true
Environment=TS_EXTRA_ARGS="--login-server https://hs.sr2.uk/"
Network=monitor.network
[Service]
Restart=on-failure
[Install]
WantedBy=default.target

View file

@ -13,26 +13,18 @@ scrape_configs:
- targets: ['alertmanager:9093']
- job_name: 'node'
scrape_interval: 5s
scheme: https
basic_auth:
username: metrics
password: "{{ node_exporter_password }}"
tls_config:
insecure_skip_verify: true
scheme: http
static_configs:
- targets: ['{{ node_exporter_tailscale_ipv4.stdout }}:9100']
labels:
instance: "{{ inventory_hostname }}"
hostname: "{{ inventory_hostname }}"
{% for host in (groups['ipaservers'] + groups['keycloak'] + groups['radius'] + groups['generic']) %}
- targets:
- 'host.containers.internal:9100'
{% for host in groups['ipaservers'] %}
- '{{ host }}:9100'
{% endfor %}
{% for host in groups['keycloak'] %}
- '{{ host }}:9100'
{% endfor %}
{% for host in groups['radius'] %}
- '{{ host }}:9100'
{% endfor %}
{% for host in groups['generic'] %}
- '{{ host }}:9100'
- "{{ hostvars[host]['node_exporter_tailscale_ipv4'].stdout }}:9100"
labels:
instance: "{{ host }}"
hostname: "{{ host }}"
{% endfor %}
file_sd_configs:
- files: