ansible-collection-prometheus/roles/nginx_exporter/templates/web_config.yaml.j2
Oleg Klyuchkin 830e69814f
feat: Add nginx_exporter role
Signed-off-by: anviar <oleg.kluchkin+github@gmail.com>
2024-02-09 08:49:59 +03:00

18 lines
691 B
Django/Jinja

---
{{ ansible_managed | comment }}
{% if nginx_exporter_tls_server_config | length > 0 %}
tls_server_config:
{{ nginx_exporter_tls_server_config | to_nice_yaml | indent(2, true) }}
{% endif %}
{% if nginx_exporter_http_server_config | length > 0 %}
http_server_config:
{{ nginx_exporter_http_server_config | to_nice_yaml | indent(2, true) }}
{% endif %}
{% if nginx_exporter_basic_auth_users | length > 0 %}
basic_auth_users:
{% for k, v in nginx_exporter_basic_auth_users.items() %}
{{ k }}: {{ v | string | password_hash('bcrypt', ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' | shuffle(seed=inventory_hostname) | join)[:22], rounds=9) }}
{% endfor %}
{% endif %}