From 94f56133bb0035fe85ee9e58d573eb4485e9fa42 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 2 Jun 2021 00:46:12 +0200 Subject: prometheus: initial serverside config --- roles/monitoring/prometheus/server/tasks/main.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'roles/monitoring/prometheus/server/tasks/main.yml') diff --git a/roles/monitoring/prometheus/server/tasks/main.yml b/roles/monitoring/prometheus/server/tasks/main.yml index ffbc5ffe..5c649f34 100644 --- a/roles/monitoring/prometheus/server/tasks/main.yml +++ b/roles/monitoring/prometheus/server/tasks/main.yml @@ -20,16 +20,18 @@ - name: create configuration directories loop: + - jobs - rules - targets file: path: "/etc/prometheus/{{ item }}" state: directory -- name: generate configuration file - template: - src: prometheus.yml.j2 - dest: /etc/prometheus/prometheus.yml +- name: create sub-directroy for all exporter types in jobs directory + loop: "{{ prometheus_server_jobs }}" + file: + path: "/etc/prometheus/jobs/{{ item }}" + state: directory - name: add user for server user: @@ -48,6 +50,12 @@ ## TODO: ## - create CA and certificate/key +- name: generate configuration file + template: + src: prometheus.yml.j2 + dest: /etc/prometheus/prometheus.yml + notify: restart prometheus + - name: generate systemd service unit template: src: prometheus.service.j2 -- cgit v1.2.3