Change tags by global_tags

This commit is contained in:
Anthony ARNAUD
2017-07-20 23:02:51 -04:00
parent 7766329cb8
commit b4317d8e5d
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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 %}