Fix prometheus.yml templating

This change fixes a bug in the prometheus.yml template which breaks
alertmanager configuration

Closes-Bug: 2076660
Change-Id: I9adf34747a22d7d5aef31fad3f68f7880e18f022
This commit is contained in:
Alex-Welsh 2024-07-29 14:53:24 +01:00
parent eb98c053c6
commit 0acccc0423
2 changed files with 7 additions and 2 deletions

View File

@ -254,9 +254,9 @@ scrape_configs:
alerting:
alertmanagers:
- static_configs:
- targets:
- static_configs:
{% for host in groups["prometheus-alertmanager"] %}
- targets:
- '{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ hostvars[host]['prometheus_alertmanager_port'] }}'
{% if hostvars[host].prometheus_instance_label | default(false, true) %}
labels:

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixed an issue with the ``prometheus.yml`` template which would break when
deploying alertmanager.