diff options
Diffstat (limited to 'roles/services/monitoring/prometheus/node_exporter/tasks')
-rw-r--r-- | roles/services/monitoring/prometheus/node_exporter/tasks/main.yml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/services/monitoring/prometheus/node_exporter/tasks/main.yml b/roles/services/monitoring/prometheus/node_exporter/tasks/main.yml new file mode 100644 index 0000000..6bbcc08 --- /dev/null +++ b/roles/services/monitoring/prometheus/node_exporter/tasks/main.yml | |||
@@ -0,0 +1,28 @@ | |||
1 | - name: install package (Debian) | ||
2 | when: ansible_facts['distribution'] == "Debian" | ||
3 | package: | ||
4 | name: "{{ node_exporter_debian_package }}" | ||
5 | |||
6 | - name: install package (Fedora) | ||
7 | when: ansible_facts['distribution'] == "Fedora" | ||
8 | package: | ||
9 | name: "{{ node_exporter_fedora_package }}" | ||
10 | |||
11 | - name: allow port | ||
12 | ufw: | ||
13 | rule: allow | ||
14 | direction: in | ||
15 | proto: tcp | ||
16 | src: "{{ prometheus_server_ip }}" | ||
17 | to_port: "{{ node_exporter_port }}" | ||
18 | |||
19 | - name: enable service | ||
20 | systemd: | ||
21 | name: prometheus-node-exporter | ||
22 | enabled: yes | ||
23 | masked: no | ||
24 | |||
25 | - name: restart service | ||
26 | service: | ||
27 | name: prometheus-node-exporter | ||
28 | state: restarted | ||