add loki role

This commit is contained in:
2022-08-30 07:48:13 -05:00
parent 4a497c211a
commit 341583bbe1
10 changed files with 286 additions and 0 deletions

View File

@ -0,0 +1,19 @@
{{ ansible_managed | comment }}
[Unit]
Description=Loki
After=network-online.target
[Service]
Type=simple
User={{ loki_user }}
Group={{ loki_group }}
ExecStart={{ loki_bin_path }}/loki \
-config.file {{ loki_config_path }}
WorkingDirectory={{ loki_var_path }}
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,30 @@
{{ ansible_managed | comment }}
---
{% if loki_auth_enabled is defined %}
auth_enabled: {{ loki_auth_enabled | bool | lower }}
{% endif %}
{% if loki_server is defined %}
server:
{{ loki_server | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif -%}
{% if loki_ingester is defined %}
ingester:
{{ loki_ingester | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif -%}
{% if loki_schema_config is defined %}
schema_config:
{{ loki_schema_config | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif -%}
{% if loki_storage_config is defined %}
storage_config:
{{ loki_storage_config | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif -%}
{% if loki_limits_config is defined %}
limits_config:
{{ loki_limits_config | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif -%}