add promtail role

This commit is contained in:
2022-08-30 07:50:35 -05:00
parent eae4e0120c
commit a948debbf8
10 changed files with 255 additions and 0 deletions

View File

@ -0,0 +1,19 @@
{{ ansible_managed | comment }}
[Unit]
Description=Loki
After=network-online.target
[Service]
Type=simple
User={{ promtail_user }}
Group={{ promtail_group }}
ExecStart={{ promtail_bin_path }}/promtail \
-config.file {{ promtail_config_path }}
WorkingDirectory={{ promtail_var_path }}
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,21 @@
{{ ansible_managed | comment }}
---
{% if promtail_server is defined %}
server:
{{ promtail_server | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif -%}
{% if promtail_positions is defined %}
positions:
{{ promtail_positions | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif -%}
{% if promtail_clients is defined %}
clients:
{{ promtail_clients | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif -%}
{% if promtail_scrape_configs is defined %}
scrape_configs:
{{ promtail_scrape_configs | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif -%}