forked from FF-RGB/ansible
Add new prometheus/grafana roles
This commit is contained in:
parent
b8cf1837e9
commit
c00b5f854e
@ -25,6 +25,14 @@ gre_matrix:
|
||||
- { id: 26, a: gw21, b: gw31 }
|
||||
# - { id: 33, a: gw22, b: gw31 }
|
||||
|
||||
node_targets:
|
||||
- gw11.regensburg.freifunk.net:9100
|
||||
- gw21.regensburg.freifunk.net:9100
|
||||
- gw31.regensburg.freifunk.net:9100
|
||||
- confluence.regensburg.freifunk.net:9100
|
||||
- stats.ffrgb:9100
|
||||
- unms.ffrgb:9100
|
||||
|
||||
ntp_servers:
|
||||
- 0.de.pool.ntp.org
|
||||
- 1.de.pool.ntp.org
|
||||
|
1
hosts
1
hosts
@ -3,4 +3,5 @@ gw11.regensburg.freifunk.net
|
||||
gw21.regensburg.freifunk.net
|
||||
gw31.regensburg.freifunk.net
|
||||
confluence.regensburg.freifunk.net
|
||||
stats.ffrgb ansible_host=10.90.224.100
|
||||
unms.ffrgb ansible_host=10.90.224.101
|
||||
|
10
roles/grafana/tasks/main.yml
Normal file
10
roles/grafana/tasks/main.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Enable grafana apt-key
|
||||
apt_key: url='https://packagecloud.io/gpg.key'
|
||||
|
||||
- name: Enable grafana repository
|
||||
apt_repository: repo='deb https://packagecloud.io/grafana/stable/debian/ stretch main'
|
||||
|
||||
- name: Install grafana
|
||||
apt: name=grafana
|
3
roles/prometheus/handlers/main.yml
Normal file
3
roles/prometheus/handlers/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: Restart prometheus
|
||||
service: name=prometheus state=restarted
|
14
roles/prometheus/tasks/main.yml
Normal file
14
roles/prometheus/tasks/main.yml
Normal 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 enabled=yes
|
33
roles/prometheus/templates/prometheus.yml.j2
Normal file
33
roles/prometheus/templates/prometheus.yml.j2
Normal file
@ -0,0 +1,33 @@
|
||||
# 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:
|
||||
- job_name: node
|
||||
static_configs:
|
||||
- targets:
|
||||
{% for target in node_targets %}
|
||||
- {{ target }}
|
||||
{% endfor %}
|
Loading…
Reference in New Issue
Block a user