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 %}