From c7bce9fa368ac4f45e3ca45bc8a03cff547d9cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Sun, 12 Dec 2021 16:47:08 +0000 Subject: roles: Add prometheus and node_exporter --- roles/prometheus/tasks/main.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 roles/prometheus/tasks/main.yml (limited to 'roles/prometheus/tasks/main.yml') diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml new file mode 100644 index 0000000..5d5c1f3 --- /dev/null +++ b/roles/prometheus/tasks/main.yml @@ -0,0 +1,23 @@ +- name: install prometheus + package: + name: + - prometheus + - node_exporter + state: present + +- name: generate prometheus configuration + template: + src: prometheus.conf.j2 + dest: "{{ prometheus_configuration_file }}" + owner: 0 + group: 0 + mode: 0644 + +- name: enable and restart prometheus services + service: + name: "{{ item }}" + state: restarted + enabled: true + loop: + - prometheus + - node_exporter -- cgit v1.2.3