handle postgresql

This commit is contained in:
Ludovic Cartier
2021-10-29 18:16:32 +02:00
parent 97a4f54b40
commit 0332bad2bd
3 changed files with 18 additions and 0 deletions

View File

@ -1,2 +1,6 @@
# {{ ansible_managed }}
{% if (prometheus_postgres_exporter_user is defined) and (prometheus_postgres_exporter_password is defined) %}
DATA_SOURCE_NAME=postgresql://{{ prometheus_postgres_exporter_user }}:{{ prometheus_postgres_exporter_password }}@{{ prometheus_postgres_exporter_host }}:{{ prometheus_postgres_exporter_port }}/postgres?sslmode=prometheus_postgres_exporter_sslmode
{% else %}
DATA_SOURCE_NAME="user={{ prometheus_postgres_exporter_user }} host={{ prometheus_postgres_exporter_host }} sslmode={{ prometheus_postgres_exporter_sslmode }}"
{% endif %}