2021-08-20 07:33:22 +00:00
|
|
|
# {{ 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() %}
|
2021-10-13 14:25:21 +00:00
|
|
|
{% if option != 'submodule' %}
|
2021-08-20 07:33:22 +00:00
|
|
|
{{ 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 %}
|
2021-10-13 14:25:21 +00:00
|
|
|
{% else %}
|
|
|
|
{% for submod in value %}
|
|
|
|
[[inputs.{{ input }}.{{ submod.name }} ]]
|
|
|
|
{% for opt, val in submod.config.items() %}
|
|
|
|
{{ opt }} = {% if val is sameas true %}true
|
|
|
|
{% elif val is sameas false %}false
|
|
|
|
{% elif val is string %}"{{ val }}"
|
|
|
|
{% elif val is number %}{{ val }}
|
|
|
|
{% else %}["{{ val|join('", "') }}"]
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2021-08-20 07:33:22 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|