aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/monitoring/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/monitoring/tasks')
-rw-r--r--ansible/roles/monitoring/tasks/main.yaml5
-rw-r--r--ansible/roles/monitoring/tasks/setup.yaml20
2 files changed, 25 insertions, 0 deletions
diff --git a/ansible/roles/monitoring/tasks/main.yaml b/ansible/roles/monitoring/tasks/main.yaml
new file mode 100644
index 0000000..256a09f
--- /dev/null
+++ b/ansible/roles/monitoring/tasks/main.yaml
@@ -0,0 +1,5 @@
+---
+
+- name: 'Run the setup tasks'
+ ansible.builtin.import_tasks: 'setup.yaml'
+ tags: 'monitoring'
diff --git a/ansible/roles/monitoring/tasks/setup.yaml b/ansible/roles/monitoring/tasks/setup.yaml
new file mode 100644
index 0000000..824d2db
--- /dev/null
+++ b/ansible/roles/monitoring/tasks/setup.yaml
@@ -0,0 +1,20 @@
+---
+
+- name: 'setup | Install required pkgs'
+ ansible.builtin.package:
+ name:
+ - 'prometheus'
+ - 'prometheus-node-exporter'
+ - 'prometheus-blackbox-exporter'
+
+- name: 'setup | Set the Prom config'
+ ansible.builtin.template:
+ src: 'prometheus.yml.j2'
+ dest: '/etc/prometheus/prometheus.yml'
+ mode: '644'
+
+- name: 'setup | Start the service'
+ ansible.builtin.service:
+ name: 'prometheus'
+ state: 'restarted'
+ enabled: true