add ansible
This commit is contained in:
@@ -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 %}
|
@@ -0,0 +1,17 @@
|
||||
{{ ansible_managed | comment }}
|
||||
|
||||
|
||||
[Unit]
|
||||
Description=promtail
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
TimeoutSec=5
|
||||
User={{ promtail_system_user }}
|
||||
Group={{ promtail_system_group }}
|
||||
ExecStart=/usr/local/bin/promtail -config.file={{ promtail_config_file }} -log.level={{ promtail_log_level }}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Reference in New Issue
Block a user