diff --git a/etc/kayobe/ansible/prometheus.yml.j2 b/etc/kayobe/ansible/prometheus.yml.j2 index 8ee107ecd..c40b0cdcb 100644 --- a/etc/kayobe/ansible/prometheus.yml.j2 +++ b/etc/kayobe/ansible/prometheus.yml.j2 @@ -273,9 +273,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: diff --git a/releasenotes/notes/apply-prometheus-template-fix-4ec4ee6c2785bfea.yaml b/releasenotes/notes/apply-prometheus-template-fix-4ec4ee6c2785bfea.yaml new file mode 100644 index 000000000..5aade4453 --- /dev/null +++ b/releasenotes/notes/apply-prometheus-template-fix-4ec4ee6c2785bfea.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixed an issue with the ``prometheus.yml`` template which would break when + deploying alertmanager.