From f91150b542b4c6821fd26233266551b5c1579184 Mon Sep 17 00:00:00 2001 From: Leonhard Mayr Date: Mon, 3 Jun 2024 16:40:37 +0200 Subject: [PATCH] Fix scrape config files path Signed-off-by: Leonhard Mayr --- roles/prometheus/defaults/main.yml | 4 ++-- roles/prometheus/templates/prometheus.yml.j2 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/prometheus/defaults/main.yml b/roles/prometheus/defaults/main.yml index 0fc82829a..70ce8385f 100644 --- a/roles/prometheus/defaults/main.yml +++ b/roles/prometheus/defaults/main.yml @@ -98,8 +98,8 @@ prometheus_static_targets_files: - prometheus/targets/*.json prometheus_scrape_config_files: - - prometheus/targets/*.yml - - prometheus/targets/*.json + - prometheus/scrapes/*.yml + - prometheus/scrapes/*.json # yamllint disable rule:line-length prometheus_alert_rules: # noqa yaml[line-length] # noqa line-length diff --git a/roles/prometheus/templates/prometheus.yml.j2 b/roles/prometheus/templates/prometheus.yml.j2 index a49d47e34..63dc1bdcb 100644 --- a/roles/prometheus/templates/prometheus.yml.j2 +++ b/roles/prometheus/templates/prometheus.yml.j2 @@ -38,6 +38,6 @@ scrape_configs: {% if prometheus_version is version('2.43.0', '>=') %} {% if prometheus_scrape_config_files != [] %} scrape_config_files: - - scrapes/* + {{ prometheus_scrape_config_files | to_nice_yaml(indent=2,sort_keys=False) | indent(2,False) }} {% endif %} {% endif %}