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_logfile: ""
|
||||||
telegraf_agent_omit_hostname: False
|
telegraf_agent_omit_hostname: False
|
||||||
|
|
||||||
telegraf_agent_tags:
|
telegraf_global_tags: []
|
||||||
|
|
||||||
telegraf_agent_output:
|
telegraf_agent_output:
|
||||||
- type: influxdb
|
- type: influxdb
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
- name: "Copy telegraf extra plugins"
|
- name: "Copy telegraf extra plugins"
|
||||||
template:
|
template:
|
||||||
src: "telegraf-extra-plugin.conf.j2"
|
src: "telegraf-extra-plugin.conf.j2"
|
||||||
dest: "/etc/telegraf/telegraf.d/extra-plugins.conf"
|
dest: "/etc/telegraf/telegraf.d/{{ item.plugin }}.conf"
|
||||||
owner: telegraf
|
owner: telegraf
|
||||||
group: telegraf
|
group: telegraf
|
||||||
mode: 0640
|
mode: 0640
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Telegraf configuration
|
# Telegraf configuration
|
||||||
|
|
||||||
[tags]
|
[global_tags]
|
||||||
{% if telegraf_agent_tags is defined and telegraf_agent_tags is iterable %}
|
{% if telegraf_global_tags is defined and telegraf_global_tags is iterable %}
|
||||||
{% for item in telegraf_agent_tags %}
|
{% for item in telegraf_global_tags %}
|
||||||
{{ item.tag_name }} = "{{ item.tag_value }}"
|
{{ item.tag_name }} = "{{ item.tag_value }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user