blob: ba5095bfc7352d4f5a462f59169c196ed60403ce (
plain) (
blame)
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
|
# prometheus ~~ roles/prometheus/tasks/main.yml
# init prometheus database, mainly used by grafana
---
- name: install prometheus
package: name=prometheus state=present
- name: install node_exporter
package: name="{{ packages[os_distribution].node_exporter }}" state=present
- name: generate prometheus configuration
template:
src: prometheus.conf.j2
dest: "{{ path_prometheusconfig }}"
owner: "{{ user_root }}"
group: "{{ group_root }}"
mode: 0644
- name: ensure prometheus service is started and enabled
service: name=prometheus state=restarted enabled=true
- name: start and enable node_exporter
service: name=node_exporter state=restarted enabled=true
when: os_type == "bsd"
- name: start and enable node_exporter
service: name=node-exporter state=restarted enabled=true
when: os_type != "bsd"
|