summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-05-30 16:08:03 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-06-20 01:44:16 +0200
commit3ef83057161e6d973f79805340d4c3d210425465 (patch)
treecf151e9dea64b0c72914e2f59939f12e47585cba /roles
parentroot part has been resized for some hosts (diff)
cleanup: old preliminary tasks
Diffstat (limited to 'roles')
-rw-r--r--roles/monitoring/prometheus/exporter/base/tasks/main.yml21
-rw-r--r--roles/monitoring/prometheus/exporter/base/templates/nginx-vhost.conf.j215
-rw-r--r--roles/monitoring/prometheus/exporter/node/tasks/main.yml28
-rw-r--r--roles/monitoring/prometheus/server/tasks/main.yml11
4 files changed, 18 insertions, 57 deletions
diff --git a/roles/monitoring/prometheus/exporter/base/tasks/main.yml b/roles/monitoring/prometheus/exporter/base/tasks/main.yml
index c3a04bd9..7982f1f9 100644
--- a/roles/monitoring/prometheus/exporter/base/tasks/main.yml
+++ b/roles/monitoring/prometheus/exporter/base/tasks/main.yml
@@ -1,16 +1,15 @@
---
- name: create main configuration directories
- loop:
- - exporters-available
- - exporters-enabled
file:
- path: "/etc/prometheus-exporter/{{ item }}"
+ path: "/etc/prometheus/exporters"
state: directory
-- name: install nginx vhost
- vars:
- nginx_vhost:
- name: prometheus-exporter
- content: "{{ lookup('template', 'nginx-vhost.conf.j2') }}"
- include_role:
- name: nginx/vhost
+- name: install apt packages
+ apt:
+ name: prom-exporter-exporter
+ state: present
+
+## TODO:
+## - systemd service unit
+## - add snippet to exporter-exporter config-dir
+## - create certificate/key
diff --git a/roles/monitoring/prometheus/exporter/base/templates/nginx-vhost.conf.j2 b/roles/monitoring/prometheus/exporter/base/templates/nginx-vhost.conf.j2
deleted file mode 100644
index e032ca3d..00000000
--- a/roles/monitoring/prometheus/exporter/base/templates/nginx-vhost.conf.j2
+++ /dev/null
@@ -1,15 +0,0 @@
-server {
- listen {{ prometheus_exporter_port }};
- listen [::]:{{ prometheus_exporter_port }};
- server_name _;
-
- ## TODO: configure ssl
-
- location / {
- return 404 "unknown exporter: $uri\n";
- }
- include /etc/prometheus-exporter/exporters-enabled/*;
-
- access_log /var/log/nginx/access-prometheus-exporter.log;
- error_log /var/log/nginx/error-prometheus-exporter.log;
-}
diff --git a/roles/monitoring/prometheus/exporter/node/tasks/main.yml b/roles/monitoring/prometheus/exporter/node/tasks/main.yml
index 286b6d75..0758eb3f 100644
--- a/roles/monitoring/prometheus/exporter/node/tasks/main.yml
+++ b/roles/monitoring/prometheus/exporter/node/tasks/main.yml
@@ -1,29 +1,9 @@
---
- name: install apt packages
apt:
- name: prometheus-node-exporter
+ name: prom-exporter-node
state: present
- ## TODO: add other configs
-- name: listen on localhost only
- lineinfile:
- path: /etc/default/prometheus-node-exporter
- regexp: '^ARGS='
- line: 'ARGS="--web.listen-address=127.0.0.1:9100"'
- notify: restart prometheus-node-exporter
-
-- name: create nginx snippet
- copy:
- content: |
- location = /node {
- proxy_pass http://127.0.0.1:9100/metrics;
- }
- dest: /etc/prometheus-exporter/exporters-available/node
- # notify: reload nginx
-
-- name: enable nginx snippet
- file:
- src: /etc/prometheus-exporter/exporters-available/node
- dest: /etc/prometheus-exporter/exporters-enabled/node
- state: link
- # notify: reload nginx
+## TODO:
+## - systemd service unit
+## - add snippet to exporter-exporter config-dir
diff --git a/roles/monitoring/prometheus/server/tasks/main.yml b/roles/monitoring/prometheus/server/tasks/main.yml
index 784e872a..ec5bd9a9 100644
--- a/roles/monitoring/prometheus/server/tasks/main.yml
+++ b/roles/monitoring/prometheus/server/tasks/main.yml
@@ -8,12 +8,9 @@
- name: install apt packages
apt:
- name: prometheus
+ name: prom-server
state: present
-- name: listen on localhost only
- lineinfile:
- path: /etc/default/prometheus
- regexp: '^ARGS='
- line: 'ARGS="--web.listen-address=127.0.0.1:9090 --storage.tsdb.retention={{ prometheus_server_retention }}"'
- notify: restart prometheus
+## TODO:
+## - systemd service unit
+## - create CA and certificate/key