aboutsummaryrefslogtreecommitdiffstats
path: root/roles/prometheus/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/prometheus/tasks/main.yml')
-rw-r--r--roles/prometheus/tasks/main.yml23
1 files changed, 23 insertions, 0 deletions
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
remember that computers suck.