ansible-role-telegraf/templates/telegraf.conf.j2
2021-08-20 09:33:22 +02:00

37 lines
1.1 KiB
Django/Jinja

# {{ ansible_managed }}
{% for section, options in telegraf_full_config.items() %}
[{{ section }}]
{% for option, value in options.items() %}
{{ option }} = {% if value is sameas true %}true
{% elif value is sameas false %}false
{% elif value is string %}"{{ value }}"
{% elif value is number %}{{ value }}
{% else %}["{{ value|join('", "') }}"]
{% endif %}
{% endfor %}
{% endfor %}
{% for output, options in telegraf_outputs.items() %}
[[outputs.{{ output }}]]
{% for option, value in options.items() %}
{{ option }} = {% if value is sameas true %}true
{% elif value is sameas false %}false
{% elif value is string %}"{{ value }}"
{% elif value is number %}{{ value }}
{% else %}["{{ value|join('", "') }}"]
{% endif %}
{% endfor %}
{% endfor %}
{% for input, options in telegraf_inputs.items() %}
[[inputs.{{ input }}]]
{% for option, value in options.items() %}
{{ option }} = {% if value is sameas true %}true
{% elif value is sameas false %}false
{% elif value is string %}"{{ value }}"
{% elif value is number %}{{ value }}
{% else %}["{{ value|join('", "') }}"]
{% endif %}
{% endfor %}
{% endfor %}