From 0460ecb3cfefc67a79d46d6d8f56676d77c9f507 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Fri, 19 Sep 2025 14:40:06 +0200 Subject: Fix env files paths on different distros --- roles/prometheus/tasks/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'roles/prometheus/tasks') diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml index c24bddf9..236b0111 100644 --- a/roles/prometheus/tasks/main.yml +++ b/roles/prometheus/tasks/main.yml @@ -1,4 +1,7 @@ --- +- name: "Include OS-specific variables" + ansible.builtin.include_vars: "{{ ansible_distribution | lower }}.yml" + - name: "Create prometheus group" become: true ansible.builtin.group: @@ -50,7 +53,7 @@ ansible.builtin.copy: content: | PROMETHEUS_ARGS="--web.listen-address={{ prometheus_host }}:{{ prometheus_port }}" - dest: "/etc/conf.d/prometheus" + dest: "{{ prometheus_env_file }}" mode: "0644" notify: "Restart prometheus" @@ -63,7 +66,7 @@ --web.listen-address={{ prometheus_host }}:{{ prometheus_node_exporter_port }} --collector.systemd " - dest: "/etc/conf.d/prometheus-node-exporter" + dest: "{{ prometheus_node_exporter_env_file }}" mode: "0644" notify: "Restart node-exporter" -- cgit v1.2.3