1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-11-22 09:41:01 +01:00
ansible-collection-prometheus/roles/prometheus/templates/prometheus-base.yml
2020-11-13 10:36:46 +01:00

25 lines
746 B
YAML

---
{{ ansible_managed | comment }}
global:
scrape_interval: {{ prometheus_scrape_interval }}
evaluation_interval: {{ prometheus_evaluation_interval }}
external_labels:
monitor: {{ prometheus_monitor_name | default(ansible_hostname) }}
alerting:
alertmanagers:
- static_configs:
{% if groups['alertmanagers'] | default([]) | length == 0 -%}
- targets: []
{%- else -%}
- targets:
{% for host in groups['alertmanagers'] -%}
- "{{ hostvars[host].inventory_hostname }}:{{ hostvars[host].prometheus_alertmanager_port | default(prometheus_alertmanager_port) | int }}"
{%- endfor %}
{%- endif %}
rule_files:
- /etc/prometheus/alert_rules.yml
scrape_configs: