add ansible

This commit is contained in:
Vassiliy Yegorov
2022-11-15 10:30:03 +07:00
parent 2d44f9f8f8
commit a08e7b0120
31 changed files with 1172 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
{{ ansible_managed | comment }}
# https://github.com/grafana/loki/blob/master/docs/clients/promtail/configuration.md
server:
{{ promtail_config_server | to_nice_yaml(indent=2) | indent(2, False) }}
{% if promtail_config_positions != {} %}
positions:
{{ promtail_config_positions | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
clients:
{{ promtail_config_clients | to_nice_yaml(indent=2) | indent(2, False) }}
scrape_configs:
{% if promtail_config_include_default_file_sd_config | bool %}
{{ promtail_config_default_file_sd_config | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
{% if promtail_config_scrape_configs|length %}
{{ promtail_config_scrape_configs | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
{% if promtail_target_config != {} %}
target_config:
{{ promtail_target_config | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}