mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Change tags by global_tags
This commit is contained in:
@ -19,7 +19,7 @@ telegraf_agent_quiet: False
|
||||
telegraf_agent_logfile: ""
|
||||
telegraf_agent_omit_hostname: False
|
||||
|
||||
telegraf_agent_tags:
|
||||
telegraf_global_tags: []
|
||||
|
||||
telegraf_agent_output:
|
||||
- type: influxdb
|
||||
|
@ -34,7 +34,7 @@
|
||||
- name: "Copy telegraf extra plugins"
|
||||
template:
|
||||
src: "telegraf-extra-plugin.conf.j2"
|
||||
dest: "/etc/telegraf/telegraf.d/extra-plugins.conf"
|
||||
dest: "/etc/telegraf/telegraf.d/{{ item.plugin }}.conf"
|
||||
owner: telegraf
|
||||
group: telegraf
|
||||
mode: 0640
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Telegraf configuration
|
||||
|
||||
[tags]
|
||||
{% if telegraf_agent_tags is defined and telegraf_agent_tags is iterable %}
|
||||
{% for item in telegraf_agent_tags %}
|
||||
[global_tags]
|
||||
{% if telegraf_global_tags is defined and telegraf_global_tags is iterable %}
|
||||
{% for item in telegraf_global_tags %}
|
||||
{{ item.tag_name }} = "{{ item.tag_value }}"
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user