add promtail role

This commit is contained in:
Sergey Malyuk
2025-12-17 17:58:14 +03:00
parent cb48bdd979
commit 5b6ecbd32d
16 changed files with 308 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
{% if custom_server_config is defined %}
{{ custom_server_config }}
{% else %}
server:
http_listen_port: {{ promtail_http_port }}
grpc_listen_port: 0
{% endif %}
positions:
filename: {{ promtail_positions_path }}
clients:
- url: "http://{{ loki_server }}:{{ loki_port }}/loki/api/v1/push"
scrape_configs:
{% if add_var_logs %}
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /var/log/*log
host: {{ ansible_hostname }}
{% endif %}
{% if custom_scrape_configs is defined %}
{{ custom_scrape_configs }}
{% endif %}