ansible-vector-role/templates/vector.toml.j2
2022-01-16 13:37:10 +01:00

35 lines
745 B
Django/Jinja

# {{ ansible_managed }}
# Set global options
data_dir = "/var/lib/vector"
[api]
enabled = true
address = "0.0.0.0:8686"
{% set loop_helper = {
"sources": (sources | default({})),
"transforms": (transforms | default({})),
"sinks": (sinks | default({}))
} %}
{% for name, cat in loop_helper.items() | sort(attribute='0') %}
{% for key, value in cat.items() | sort(attribute='0') %}
[{{ name }}.{{ key }}]
{% if value %}
{%- for skey, svalue in value.items() | sort(attribute='0') %}
{%- if svalue is string %}
{%- if svalue[0] == "'" %}
{{ skey }} = {{ svalue }}
{% else %}
{{ skey }} = "{{ svalue }}"
{% endif %}
{% else %}
{{ skey }} = {{ svalue | tojson }}
{% endif %}
{% endfor %}
{%- endif %}
{% endfor %}
{% endfor %}