add promtail role
This commit is contained in:
19
roles/promtail/templates/promtail.service.j2
Normal file
19
roles/promtail/templates/promtail.service.j2
Normal 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
|
21
roles/promtail/templates/promtail.yaml.j2
Normal file
21
roles/promtail/templates/promtail.yaml.j2
Normal 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 -%}
|
Reference in New Issue
Block a user