From 29c30145062ec66c2630803c2e5ad7a825578e1c Mon Sep 17 00:00:00 2001 From: Ludovic Cartier Date: Mon, 14 Nov 2022 11:05:19 +0100 Subject: [PATCH] same correction --- tasks/exporter/_common.yml | 2 +- tasks/server/prometheus.yml | 2 +- templates/conf/prometheus-mongodb-exporter.j2 | 2 +- templates/conf/prometheus-opcache-exporter.j2 | 2 +- templates/conf/prometheus.yml.j2 | 38 +++++++++---------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tasks/exporter/_common.yml b/tasks/exporter/_common.yml index d372eed..5ac7a49 100644 --- a/tasks/exporter/_common.yml +++ b/tasks/exporter/_common.yml @@ -35,7 +35,7 @@ when: not stat_result.stat.exists or exporter_upgrade == "yes" tags: [ 'prometheus_{{ exporter }}' ] -- name: '{{ exporter }} exporter | get latest release from GitHub' +- name: '{{ exporter }} exporter | get latest release from GitHub' shell: curl --silent "https://api.github.com/repos/{{ prometheus_repo }}/{{ exporter }}_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" args: warn: false diff --git a/tasks/server/prometheus.yml b/tasks/server/prometheus.yml index 9ba9b85..373e426 100644 --- a/tasks/server/prometheus.yml +++ b/tasks/server/prometheus.yml @@ -39,7 +39,7 @@ notify: - 'prometheus | server | restart container' -- name: 'prometheus | server | deploy container' +- name: 'prometheus | server | deploy container' docker_container: name: prometheus hostname: '{{ inventory_hostname }}' diff --git a/templates/conf/prometheus-mongodb-exporter.j2 b/templates/conf/prometheus-mongodb-exporter.j2 index 740314f..91ef41f 100644 --- a/templates/conf/prometheus-mongodb-exporter.j2 +++ b/templates/conf/prometheus-mongodb-exporter.j2 @@ -1,6 +1,6 @@ # {{ ansible_managed }} {% if (prometheus_mongodb_exporter_user is defined) and (prometheus_mongodb_exporter_pass is defined) %} -MONGODB_URI=mongodb://{{ prometheus_mongodb_exporter_user }}:{{ prometheus_mongodb_exporter_pass }}@{{ prometheus_mongodb_exporter_host }}:{{ prometheus_mongodb_exporter_port }}/{{ prometheus_mongodb_exporter_database }} +MONGODB_URI=mongodb://{{ prometheus_mongodb_exporter_user }}:{{ prometheus_mongodb_exporter_pass }}@{{ prometheus_mongodb_exporter_host }}:{{ prometheus_mongodb_exporter_port }}/{{ prometheus_mongodb_exporter_database }} {% else %} MONGODB_URI=mongodb://{{ prometheus_mongodb_exporter_host }}:{{ prometheus_mongodb_exporter_port }}/{{ prometheus_mongodb_exporter_database }} {% endif %} diff --git a/templates/conf/prometheus-opcache-exporter.j2 b/templates/conf/prometheus-opcache-exporter.j2 index b90f92a..ca5d0ef 100644 --- a/templates/conf/prometheus-opcache-exporter.j2 +++ b/templates/conf/prometheus-opcache-exporter.j2 @@ -1,4 +1,4 @@ # {{ ansible_managed }} {% if (prometheus_opcache_exporter_fcgi_uri is defined) %} -ARGS='"--opcache.fcgi-uri="{{ prometheus_opcache_exporter_fcgi_uri }}"' +ARGS='"--opcache.fcgi-uri="{{ prometheus_opcache_exporter_fcgi_uri }}"' {% endif %} diff --git a/templates/conf/prometheus.yml.j2 b/templates/conf/prometheus.yml.j2 index 14645a1..b37024d 100644 --- a/templates/conf/prometheus.yml.j2 +++ b/templates/conf/prometheus.yml.j2 @@ -19,7 +19,7 @@ rule_files: # Here it's Prometheus itself. scrape_configs: # The job name is added as a label `job=` to any timeseries scraped from this config. - - job_name: '{{ prometheus_server_job_name }}' + - job_name: '{{ prometheus_server_job_name }}' # Override the global default and scrape targets from this job every 5 seconds. scrape_interval: {{ prometheus_server_scrape_interval }}s @@ -39,7 +39,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_node_exporter_targets %} - - {{ target }}:9100 + - {{ target }}:9100 {% endfor %} relabel_configs: - source_labels: [ __address__ ] @@ -66,7 +66,7 @@ scrape_configs: {% else %} - targets: {% for target in prometheus_mysqld_exporter_targets %} - - {{ target }}:9104 + - {{ target }}:9104 {% endfor %} {% endif %} relabel_configs: @@ -94,7 +94,7 @@ scrape_configs: {% else %} - targets: {% for target in prometheus_mongodb_exporter_targets %} - - {{ target }}:9216 + - {{ target }}:9216 {% endfor %} {% endif %} {% endif %} @@ -117,7 +117,7 @@ scrape_configs: {% else %} - targets: {% for target in prometheus_postgres_exporter_targets %} - - {{ target }}:9187 + - {{ target }}:9187 {% endfor %} {% endif %} {% endif %} @@ -130,7 +130,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_phpfpm_exporter_targets %} - - {{ target }}:9253 + - {{ target }}:9253 {% endfor %} relabel_configs: - source_labels: [ __address__ ] @@ -147,7 +147,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_opcache_exporter_targets %} - - {{ target }}:9101 + - {{ target }}:9101 {% endfor %} relabel_configs: - source_labels: [ __address__ ] @@ -164,7 +164,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_apache_exporter_targets %} - - {{ target }}:9117 + - {{ target }}:9117 {% endfor %} relabel_configs: - source_labels: [ __address__ ] @@ -181,7 +181,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_haproxy_exporter_targets %} - - {{ target }}:8404 + - {{ target }}:8404 {% endfor %} relabel_configs: - source_labels: [ __address__ ] @@ -198,7 +198,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_varnish_exporter_targets %} - - {{ target }}:9131 + - {{ target }}:9131 {% endfor %} relabel_configs: - source_labels: [ __address__ ] @@ -228,7 +228,7 @@ scrape_configs: - source_labels: [__param_target] target_label: instance - target_label: __address__ - replacement: {{ prometheus_blackbox_exporter_host }}:9115 + replacement: {{ prometheus_blackbox_exporter_host }}:9115 {% endif %} {% if prometheus_blackbox_exporter_ping is defined %} ## ping ## @@ -240,7 +240,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_blackbox_exporter_ping %} - - {{ target }} + - {{ target }} {% endfor %} relabel_configs: - source_labels: [__address__] @@ -248,7 +248,7 @@ scrape_configs: - source_labels: [__param_target] target_label: instance - target_label: __address__ - replacement: {{ prometheus_blackbox_exporter_host }}:9115 + replacement: {{ prometheus_blackbox_exporter_host }}:9115 {% endif %} {% endif %} @@ -258,7 +258,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_redis_multi_instances_exporter_targets %} - - {{ target }} + - {{ target }} {% endfor %} metrics_path: /scrape relabel_configs: @@ -280,7 +280,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_redis_exporter_targets %} - - {{ target }}:9121 + - {{ target }}:9121 {% endfor %} relabel_configs: - source_labels: [ __address__ ] @@ -297,7 +297,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_proxysql_exporter_targets %} - - {{ target }}:6070 + - {{ target }}:6070 relabel_configs: - source_labels: [ __address__ ] target_label: instance @@ -318,7 +318,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_kong_exporter_targets %} - - {{ target }} + - {{ target }} {% endfor %} {% endif %} @@ -330,7 +330,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_memcached_exporter_targets %} - - {{ target }}:9150 + - {{ target }}:9150 {% endfor %} relabel_configs: - source_labels: [ __address__ ] @@ -347,7 +347,7 @@ scrape_configs: static_configs: - targets: {% for target in prometheus_docker_exporter_targets %} - - {{ target }}:9323 + - {{ target }}:9323 {% endfor %} relabel_configs: - source_labels: [ __address__ ]