1
0
forked from infra/ansible

prometheus: new role

This commit is contained in:
Markus 2018-10-06 22:19:37 +02:00
parent 634b952321
commit e2fd44eb53
4 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
- name: Restart prometheus
service: name=prometheus state=restarted

View File

@ -0,0 +1,14 @@
---
- name: Enable backports for prometheus
apt_repository: repo='deb http://httpredir.debian.org/debian stretch-backports main'
- name: Install prometheus
apt: name=prometheus default_release='stretch-backports'
- name: Configure prometheus
template: src=prometheus.yml.j2 dest=/etc/prometheus/prometheus.yml
notify: Restart prometheus
- name: Enable prometheus
service: name=prometheus state=started enabled=yes

View File

@ -0,0 +1,35 @@
# Sample config for Prometheus.
global:
scrape_interval: 60s
evaluation_interval: 60s
# scrape_timeout is set to the global default (10s).
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'example'
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - localhost:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
{% if node_targets is defined %}
- job_name: node
static_configs:
- targets:
{% for target in node_targets %}
- {{ target }}
{% endfor %}
{% endif %}

View File

@ -26,6 +26,7 @@
hosts: nabia.binary.kitchen
roles:
- librenms
- prometheus
- racktables
- uau
- acme