-
Notifications
You must be signed in to change notification settings - Fork 4
/
install_monitoring_stack.yml
42 lines (38 loc) 路 1.08 KB
/
install_monitoring_stack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022-2024, E36 Knots
---
- name: Install Prometheus Node Exporter
hosts: avalanche_nodes
become: true
roles:
- role: prometheus.prometheus.node_exporter
- name: Install Prometheus
hosts: prometheus
become: true
roles:
- role: prometheus.prometheus.prometheus
- name: Install Grafana
hosts: grafana
become: true
roles:
- role: grafana.grafana.grafana
- name: Import templated Grafana dashboard
hosts: grafana
become: true
tasks:
- name: Template subnets Grafana dashboard
template:
src: "{{ item }}"
dest: "{{ grafana_data_dir }}/dashboards/{{ item | basename | regex_replace('\\.j2$', '') }}"
owner: grafana
group: grafana
mode: 0640
loop:
- "{{ playbook_dir }}/../files/dashboards/subnets.json.j2"
when: (grafana_subnets_dashboard_variables | default([]) | length) > 0
register: template_subnets
- name: Restart Grafana
service:
name: grafana-server
state: restarted
when: template_subnets.changed